This repository has been archived by the owner on Jul 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.php
66 lines (59 loc) · 1.46 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Yet Another Social Plugin
*
* @copyright Copyright (C) 2011-2015 Michael Babker. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
*/
/**
* Installation class to perform additional changes during install/uninstall/update
*
* @since 1.0
*/
class plgContentYetAnotherSocialInstallerScript
{
/**
* Minimum supported Joomla! version
*
* @var string
* @since 2.0
*/
protected $minimumJoomlaVersion = '3.4.1';
/**
* Minimum supported PHP version
*
* @var string
* @since 2.0
*/
protected $minimumPHPVersion = '5.4';
/**
* Function to act prior to installation process begins
*
* @param string $type The action being performed
* @param JInstallerAdapterPlugin $parent The function calling this method
*
* @return boolean
*
* @since 1.0
*/
public function preflight($type, $parent)
{
// PHP Version Check
if (version_compare(PHP_VERSION, $this->minimumPHPVersion, 'lt'))
{
JError::raiseNotice(
null, JText::sprintf('PLG_CONTENT_YETANOTHERSOCIAL_ERROR_INSTALL_PHPVERSION', $this->minimumPHPVersion)
);
return false;
}
// Joomla! Version Check
if (version_compare(JVERSION, $this->minimumJoomlaVersion, 'lt'))
{
JError::raiseNotice(
null, JText::sprintf('PLG_CONTENT_YETANOTHERSOCIAL_ERROR_INSTALL_JVERSION', $this->minimumJoomlaVersion)
);
return false;
}
return true;
}
}