-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.php
52 lines (44 loc) · 1.31 KB
/
script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* @package Joomla
* @subpackage Membership Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2016 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
class Pkg_EventbookingInstallerScript
{
protected $installType;
public function preflight($type, $parent)
{
if (!version_compare(JVERSION, '3.5.0', 'ge'))
{
JError::raiseWarning(null, 'Cannot install Events Booking in a Joomla release prior to 3.5.0');
return false;
}
if (version_compare(PHP_VERSION, '5.4.0', '<'))
{
JError::raiseWarning(null, 'Events Booking requires PHP 5.4.0+ to work. Please contact your hosting provider, ask them to update PHP version for your hosting account.');
return false;
}
}
/**
* method to install the component
*
* @return void
*/
public function install($parent)
{
$this->installType = 'install';
}
public function update($parent)
{
$this->installType = 'update';
}
public function postflight($type, $parent)
{
$app = JFactory::getApplication();
$app->setUserState('com_installer.redirect_url', 'index.php?option=com_eventbooking&task=update.update&install_type=' . $this->installType);
$app->input->set('return', base64_encode('index.php?option=com_eventbooking&task=update.update&install_type=' . $this->installType));
}
}