コード例 #1
0
 /**
  * Creates a tracks individual for the user
  * Method is called after user data is stored in the database
  *
  * @param   array    $user     holds the new user data
  * @param   boolean  $isnew    true if a new user is stored
  * @param   boolean  $success  true if user was succesfully stored in the database
  * @param   string   $msg      message
  *
  * @return void
  */
 public function onUserAfterSave($user, $isnew, $success, $msg)
 {
     $app = JFactory::getApplication();
     // Require tracks individual table
     require_once JPATH_ADMINISTRATOR . '/components/com_tracks/tables/individual.php';
     if ($isnew) {
         $table = RTable::getAdminInstance('Individual', array(), 'com_tracks');
         if ($this->params->get('map_name', 0) == 0) {
             $split = strpos($user['name'], ' ');
             if ($split && $this->params->get('split_name', 1)) {
                 $table->first_name = substr($user['name'], 0, $split);
                 $table->last_name = substr($user['name'], $split + 1);
             } else {
                 $table->last_name = $user['name'];
             }
         } else {
             $table->last_name = $user['username'];
         }
         switch ($this->params->get('map_nickname', 2)) {
             case 0:
                 break;
             case 1:
                 $table->nickname = $user['name'];
                 break;
             case 2:
                 $table->nickname = $user['username'];
                 break;
         }
         $table->user_id = $user['id'];
         if ($table->check() && $table->store()) {
         } else {
             Jerror::raiseWarning(0, JText::_('Error_while_creating_tracks_individual'));
         }
     }
 }
コード例 #2
0
ファイル: script.php プロジェクト: Ayner/Improve-my-city
 function preflight($type, $parent)
 {
     $jversion = new JVersion();
     // Installing component manifest file version
     $this->release = $parent->get("manifest")->version;
     // Manifest file minimum Joomla version
     $this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
     // Show the essential information at the install/update back-end
     echo '<p>Installing component manifest file version = ' . $this->release;
     echo '<br />Current manifest cache commponent version (if any) = ' . $this->getParam('version');
     echo '<br />Installing component manifest file minimum Joomla version = ' . $this->minimum_joomla_release;
     echo '<br />Current Joomla version = ' . $jversion->getShortVersion();
     // abort if the current Joomla release is older
     if (version_compare($jversion->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install com_improvemycity in a Joomla release prior to ' . $this->minimum_joomla_release);
         return false;
     }
     // abort if the component being installed is not newer than the currently installed version
     if ($type == 'update') {
         $oldRelease = $this->getParam('version');
         $rel = $oldRelease . ' to ' . $this->release;
         if (version_compare($this->release, $oldRelease, 'lt')) {
             Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
             return false;
         }
     } else {
         $rel = $this->release;
     }
     //echo '<p>' . JText::_('COM_IMPROVEMYCITY_PREFLIGHT_' . $type . ' ' . $rel) . '</p>';
 }
コード例 #3
0
ファイル: placeholder.php プロジェクト: Rikisha/proj
 /**
  * Get the instance of a placeholder
  * If the class for placeholder is not founded
  * then use the "Simple" placeholder class
  *
  * @param  string $name - the suffic of class (name of placeholder)
  * @param  string $namespace - the HTML or 'plain'
  *
  * @return string
  * @since 1.0
  */
 public function getInstance($name, $namespace)
 {
     $name = strtolower($name);
     $namespace = strtolower($namespace);
     if (empty($name) || empty($namespace)) {
         Jerror::throwError('The name or namespace of placeholder is missing');
     }
     /*
      * Try to get class of placeholder.
      * If 'class' is not determined then use the $name as name of class of placeholder
      */
     $pdata = !empty(self::$placeholders[$name]) ? self::$placeholders[$name] : array();
     $class = empty($pdata['class']) ? $name : $pdata['class'];
     if (isset(self::$_instances[$namespace][$class])) {
         return self::$_instances[$namespace][$class];
     }
     $path = 'migur' . DS . 'library' . DS . 'mailer' . DS . 'document' . DS . $namespace . DS . 'renderer' . DS . 'placeholder' . DS;
     if (!JLoader::import($path . $class, JPATH_LIBRARIES)) {
         $class = 'simple';
         if (!JLoader::import($path . $class, JPATH_LIBRARIES)) {
             JError::raiseError(500, 'File or class not found for ' . $class . ', ' . $namespace);
         }
     }
     $className = ucfirst($namespace) . 'Placeholder' . ucfirst($class);
     $obj = new $className();
     self::$_instances[$namespace][$class] = $obj;
     return $obj;
 }
コード例 #4
0
 /**
  * Called before any type of action
  *
  * @param   string  $type  Which action is happening (install|uninstall|discover_install)
  * @param   object  $parent  The object responsible for running this script
  *
  * @return  boolean  True on success
  */
 public function preflight($type, $parent)
 {
     // init vars
     $db = JFactory::getDBO();
     $type = strtolower($type);
     $this->_src = $parent->getParent()->getPath('source');
     // tmp folder
     $this->_target = JPATH_ROOT . '/plugins/system/zlframework';
     // install folder
     $this->_ext_version = $parent->get("manifest")->version;
     // load ZLFW sys language file EXAMPLE
     // JFactory::getLanguage()->load('plg_system_zlframework.sys', JPATH_ADMINISTRATOR, 'en-GB', true);
     // check dependencies if not uninstalling
     if ($type != 'uninstall' && !$this->checkDependencies($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
     // don't overide layouts EXAMPLE
     /* 
      * when updating we don't wont to override renderer/item folder,
      * so let's delete the temp folder before install only if it already exists
      */
     // if($type == 'update'){
     // 	JFolder::exists($this->_target.'/renderer/item') &&
     // 	JFolder::delete($this->_src.'/renderer/item');
     // }
     if ($type == 'update') {
         /* warn about update requirements only once */
         if (!JFile::exists($this->_src . '/warned.txt') && !$this->checkCompatibility($this->_src . '/zlframework/dependencies.config')) {
             // rise error
             Jerror::raiseWarning(null, $this->_error);
             // create a dummy indicational mark file
             $some = 'dummy content';
             JFile::write($this->_src . '/warned.txt', $some);
             // copy the entire install to avoid it delition on cancel
             JFolder::copy($this->_src, JPath::clean(JPATH_ROOT . '/tmp/' . basename($this->_src . '_copy')));
             // cancel update
             return false;
         } else {
             if (JFile::exists($this->_src . '/warned.txt')) {
                 JFile::delete($this->_src . '/warned.txt');
             }
         }
         // EXAMPLE make sure the DB schema is set, necesary for SQL updates
         // // get extension id
         // $db->setQuery("SELECT `extension_id` FROM `#__extensions` WHERE `type` = 'plugin' AND `element` = '{$this->_ext}' AND `folder` = 'system'");
         // if ($plg = $db->loadObject()) $this->_ext_id = (int)$plg->extension_id;
         // // set schema
         // $db->setQuery("SELECT * FROM `#__schemas` WHERE `extension_id` = '{$this->_ext_id}'");
         // if (!$db->loadObject()) {
         // 	$query = $db->getQuery(true);
         // 	$query->clear()
         // 		->insert($db->quoteName('#__schemas'))
         // 		->columns(array($db->quoteName('extension_id'), $db->quoteName('version_id')))
         // 		->values($this->_ext_id . ', ' . $db->quote('2013-01-01'));
         // 	$db->setQuery($query)->execute();
         // }
     }
 }
コード例 #5
0
 public function preflight($type, $parent)
 {
     // check dependencies if not uninstalling
     if ($type != 'uninstall' && !$this->checkRequirements($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
 }
コード例 #6
0
ファイル: install.php プロジェクト: q0821/esportshop
 public function preflight($type, $parent)
 {
     // Check if Joomla version is correct. Mainly, J2.5 can't be installed on J3.0
     if (version_compare(JVERSION, '2.5.5', '<')) {
         Jerror::raiseWarning(null, 'JFBConnect requires Joomla 2.5.5 or higher. Please upgrade Joomla to the latest stable release to use JFBConnect.');
         return false;
     }
     return true;
 }
コード例 #7
0
 public function preflight($type, $parent)
 {
     // check dependencies if not uninstalling
     if ($type != 'uninstall' && !$this->checkRequirements($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
     // load config, necesary for some packages
     require_once JPATH_ADMINISTRATOR . '/components/com_zoo/config.php';
 }
コード例 #8
0
ファイル: script.php プロジェクト: angelexevior/jedchecker
 /**
  * Function executed before the the installation
  *
  * @param   string               $type    - the installation type
  * @param   JInstallerComponent  $parent  - the parent class
  *
  * @return bool
  */
 public function preflight($type, $parent)
 {
     $this->parent = $parent;
     if (version_compare(PHP_VERSION, '5.3.1', '<')) {
         $this->loadLanguage();
         Jerror::raiseWarning(null, JText::sprintf('COM_JEDCHECKER_PHP_VERSION_INCOMPATIBLE', PHP_VERSION, '5.3.6'));
         return false;
     }
     return true;
 }
コード例 #9
0
ファイル: install.php プロジェクト: sillysachin/teamtogether
 function preflight($type, $parent)
 {
     // $parent is the class calling this method
     // $type is the type of change (install, update or discover_install)
     $version = new JVersion();
     if (!$version->isCompatible('2.5')) {
         Jerror::raiseWarning(null, 'Sorry, only Joomla 2.5 and above is supported by this extension.');
         return false;
     }
     //echo '<style>.adminform {width: 100%;}</style><div style="margin: 0 auto; text-align: center"><a href="index.php?option=com_jsonexport"><img src="../media/com_jsonexport/img/install.png" /></a></div>';
 }
コード例 #10
0
 function preflight($type, $parent)
 {
     $xmlfile = JPATH_ADMINISTRATOR . '/components/com_j2store/manifest.xml';
     $xml = JFactory::getXML($xmlfile);
     $version = (string) $xml->version;
     //check for minimum requirement
     // abort if the current J2Store release is older
     if (version_compare($version, '2.6.7', 'lt')) {
         Jerror::raiseWarning(null, 'You are using an old version of J2Store. Please upgrade to the latest version');
         return false;
     }
 }
コード例 #11
0
ファイル: pkg_script.php プロジェクト: kolydart/SEBLOD
 function preflight($type, $parent)
 {
     $version = new JVersion();
     if (version_compare($version->getShortVersion(), '2.5.1', 'lt')) {
         Jerror::raiseWarning(null, 'You should upgrade your site with Joomla 2.5.1 (or +) before installing SEBLOD 2.2(+).');
         return false;
     }
     if (!defined('DS')) {
         define('DS', DIRECTORY_SEPARATOR);
     }
     set_time_limit(0);
 }
コード例 #12
0
ファイル: install.php プロジェクト: scarsroga/blog-soa
 function preflight($type, $parent)
 {
     $jversion = new JVersion();
     // Installing component manifest file version
     $this->release = $parent->get("manifest")->version;
     // Manifest file minimum Joomla version
     $this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
     if (version_compare($jversion->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install this version of the JCK Suite package in a Joomla release prior to ' . $this->minimum_joomla_release);
         return false;
     }
 }
コード例 #13
0
 /**
  * Called before any type of action
  *
  * @param   string  $type  Which action is happening (install|uninstall|discover_install)
  * @param   object  $parent  The object responsible for running this script
  *
  * @return  boolean  True on success
  */
 public function preflight($type, $parent)
 {
     // init vars
     $db = JFactory::getDBO();
     $type = strtolower($type);
     // load ZLFW sys language file
     JFactory::getLanguage()->load('plg_system_zlframework.sys', JPATH_ADMINISTRATOR, 'en-GB', true);
     // check dependencies if not uninstalling
     if ($type != 'uninstall' && !$this->checkRequirements($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
 }
コード例 #14
0
ファイル: script.php プロジェクト: hogeh/htraininglogs2
 function preflight($type, $parent)
 {
     // this component does not work with Joomla releases prior to 1.6
     // abort if the current Joomla release is older
     $jversion = new JVersion();
     if (version_compare($jversion->getShortVersion(), '3.4', 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install com_htraininglogs in a Joomla release prior to 3.4');
         return false;
     }
     // abort if the release being installed is not newer than the currently installed version
     $rel = $this->release;
     echo '<p>' . $this->release . JText::_('COM_HTRAININGLOGS_PREFLIGHT_' . $type . '_TEXT') . '</p>';
 }
コード例 #15
0
ファイル: script.k2store.php プロジェクト: A-Bush/pprod
 function preflight($type, $parent)
 {
     $jversion = new JVersion();
     //check for minimum requirement
     // abort if the current Joomla release is older
     if (version_compare($jversion->getShortVersion(), '2.5.6', 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install K2Store in a Joomla release prior to 2.5.6');
         return false;
     }
     // Only allow to install on Joomla! 2.5.0 or later with PHP 5.3.0 or later
     if (defined('PHP_VERSION')) {
         $version = PHP_VERSION;
     } elseif (function_exists('phpversion')) {
         $version = phpversion();
     } else {
         $version = '5.0.0';
         // all bets are off!
     }
     if (!version_compare($version, '5.3.1', 'ge')) {
         $msg = "<p>You need PHP 5.3.1 or later to install this component</p>";
         if (version_compare(JVERSION, '3.0', 'gt')) {
             JLog::add($msg, JLog::WARNING, 'jerror');
         } else {
             JError::raiseWarning(100, $msg);
         }
         return false;
     }
     // Bugfix for "Can not build admin menus"
     if (in_array($type, array('install'))) {
         $this->_bugfixDBFunctionReturnedNoError();
     } elseif ($type != 'discover_install') {
         $this->_bugfixCantBuildAdminMenus();
         $this->_resetLiveUpdate();
     }
     //check k2store
     $xmlfile = JPATH_ADMINISTRATOR . '/components/com_k2store/manifest.xml';
     if (JFile::exists($xmlfile)) {
         $xml = JFactory::getXML($xmlfile);
         $version = (string) $xml->version;
         //check for minimum requirement
         // abort if the current K2Store release is older
         if (version_compare($version, '3.6.0', 'lt')) {
             Jerror::raiseWarning(null, 'You should first upgrade to K2Store 3.6.0 and then install 3.7.x version. Otherwise, the changes made till 3.6 series wont be reflected in your install');
             return false;
         }
         //check the previous version in case the user intalls it twice.
         $file = JPATH_ADMINISTRATOR . '/components/com_k2store/pre-version.txt';
         $buffer = $version;
         JFile::write($file, $buffer);
     }
 }
 /**
  * Called before any type of action
  *
  * @param  string  $type  type of current action
  *
  * @return  boolean  True on success
  */
 public function preflight($type)
 {
     // make version check only when installing the plugin
     if ($type != "discover_install" && $type != "install") {
         return true;
     }
     $version = new JVersion();
     // Abort if the current Joomla release is older
     if (version_compare($version->getShortVersion(), "3", 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install NNBootstrapparams in a Joomla release prior to 3');
         return false;
     }
     return true;
 }
コード例 #17
0
ファイル: install.php プロジェクト: vstorm83/propertease
 public function preflight($type, $parent)
 {
     $version = new JVersion();
     // get the Joomla version (JVERSION did not exist before Joomla 2.5)
     $joomla_version = $version->RELEASE . '.' . $version->DEV_LEVEL;
     if (version_compare($joomla_version, "2.5.5", "<")) {
         Jerror::raiseWarning(null, "Flexicontact Plus requires at least Joomla 2.5.5");
         return false;
     }
     if (get_magic_quotes_gpc()) {
         Jerror::raiseWarning(null, "Flexicontact Plus cannot run with PHP Magic Quotes ON. Please switch it off and re-install.");
         return false;
     }
     return true;
 }
コード例 #18
0
 /**
  * Called before any type of action
  *
  * @param   string  $type  Which action is happening (install|uninstall|discover_install)
  * @param   object  $parent  The object responsible for running this script
  *
  * @return  boolean  True on success
  */
 public function preflight($type, $parent)
 {
     // init vars
     $db = JFactory::getDBO();
     $type = strtolower($type);
     $this->_src = $parent->getParent()->getPath('source');
     // tmp folder
     $this->_target = JPATH_ROOT . '/modules/mod_zooitempro';
     // install folder
     // load ZLFW language file
     JFactory::getLanguage()->load('plg_system_zlframework.sys', JPATH_ADMINISTRATOR, 'en-GB', true);
     // check dependencies if not uninstalling
     if ($type != 'uninstall' && !$this->checkDependencies($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
     if ($type == 'update') {
         /*
          * when updating we don't wont to override renderer/item folder,
          * so let's delete the temp folder before install only if it already exists
          */
         if (JFolder::exists($this->_target . '/renderer/item') && JFolder::exists($this->_src . '/renderer/item')) {
             JFolder::delete($this->_src . '/renderer/item');
         }
         /* warn about update requirements only once */
         if (!JFile::exists($this->_src . '/warned.txt') && !$this->checkRequirements()) {
             // set the proceede link with it's behaviour
             $path = JPATH_ROOT . '/tmp/' . basename($this->_src . '_copy');
             $path = str_replace('\\', '\\/', $path);
             $javascript = "document.getElementById('install_directory').value = '{$path}';Joomla.submitbutton3();return false;";
             $this->_error = JText::sprintf('MOD_ZOOITEMPRO_SYS_OUTDATED_EXTENSIONS', $javascript);
             // rise error
             Jerror::raiseWarning(null, $this->_error);
             // create a dummy indicational mark file
             $some = 'dummy content';
             JFile::write($this->_src . '/warned.txt', $some);
             // copy the entire install to avoid it delition on cancel
             JFolder::copy($this->_src, JPath::clean(JPATH_ROOT . '/tmp/' . basename($this->_src . '_copy')));
             // cancel update
             return false;
         } else {
             if (JFile::exists($this->_src . '/warned.txt')) {
                 JFile::delete($this->_src . '/warned.txt');
             }
         }
     }
 }
コード例 #19
0
 /**
  * Called before any type of action
  *
  * @param   string  $type  Which action is happening (install|uninstall|discover_install)
  * @param   object  $parent  The object responsible for running this script
  *
  * @return  boolean  True on success
  */
 public function preflight($type, $parent)
 {
     // init vars
     $this->initVars($type, $parent);
     // load ZLFW sys language file
     JFactory::getLanguage()->load('plg_system_zlframework.sys', JPATH_ADMINISTRATOR, 'en-GB', true);
     // check dependencies if not uninstalling
     if ($this->type != 'uninstall' && !$this->checkDependencies($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
     // on uninstall
     if ($this->type == 'uninstall') {
         // save the sql files now to be able to iterate over later
         $this->sqls = JFolder::files($this->target . '/zoocart/sql');
     }
 }
コード例 #20
0
ファイル: install.php プロジェクト: sulicz/JINC_J30
 function preflight($type, $parent)
 {
     $inst_parent = $parent->getParent();
     $manifest = $inst_parent->getManifest();
     $release = $manifest->version;
     // abort if the component being installed is not newer than the currently installed version
     if ($type == 'update') {
         $oldRelease = $this->getParam('version');
         $rel = $oldRelease . ' to ' . $release;
         if (version_compare($release, $oldRelease, 'lt')) {
             Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
             return false;
         }
         echo '<p>' . sprintf(JText::_('COM_JINC_UPGRADE'), $oldRelease, $release) . ' </p>';
     } else {
         echo '<p>' . sprintf(JText::_('COM_JINC_INSTALL'), $release) . ' </p>';
     }
 }
コード例 #21
0
ファイル: install.php プロジェクト: hriggs/cs-website
 public function preflight($type, $parent)
 {
     // Joomla! broke the update call, so we have to create a workaround check.
     $db = JFactory::getDbo();
     $db->setQuery("SELECT enabled FROM #__extensions WHERE element = 'com_jevents'");
     $is_enabled = $db->loadResult();
     if (!$is_enabled) {
         $this->hasJEventsInst = 0;
         return;
     } else {
         $this->hasJEventsInst = 1;
         if (version_compare(JVERSION, '3.0', '<')) {
             Jerror::raiseWarning(null, 'This version of JEvents is desgined for Joomla 3.4.4 and later.<br/>Please update Joomla before upgrading JEvents to this version');
             return false;
         }
         return;
     }
 }
コード例 #22
0
 /**
  * Called before any type of action
  *
  * @param   string  $type  Which action is happening (install|uninstall|discover_install)
  * @param   object  $parent  The object responsible for running this script
  *
  * @return  boolean  True on success
  */
 public function preflight($type, $parent)
 {
     // init vars
     $db = JFactory::getDBO();
     $type = strtolower($type);
     $this->_src = $parent->getParent()->getPath('source');
     // tmp folder
     $this->_target = JPATH_ROOT . '/plugins/system/zlframework';
     // install folder
     $this->_ext_version = $parent->get("manifest")->version;
     // load ZLFW sys language file
     JFactory::getLanguage()->load('plg_system_zlframework.sys', JPATH_ADMINISTRATOR, 'en-GB', true);
     // check dependencies
     if ($type != 'uninstall' && !$this->checkRequirements($parent)) {
         Jerror::raiseWarning(null, $this->_error);
         return false;
     }
 }
コード例 #23
0
ファイル: install.php プロジェクト: naquib555/quBitolgy
 public function preflight($type, $parent)
 {
     $version = new JVersion();
     // get the Joomla version (JVERSION did not exist before Joomla 2.5)
     $joomla_version = $version->RELEASE . '.' . $version->DEV_LEVEL;
     if (version_compare($joomla_version, "2.5.5", "<")) {
         Jerror::raiseWarning(null, "Plotalot requires at least Joomla 2.5.5");
         return false;
     }
     if (get_magic_quotes_gpc()) {
         Jerror::raiseWarning(null, "Plotalot cannot run with PHP Magic Quotes ON. Please switch it off and re-install.");
         return false;
     }
     if (!function_exists('mysql_connect')) {
         Jerror::raiseWarning(null, "Plotalot cannot run on this server because it does not support the PHP mysql_ functions.");
         return false;
     }
     return true;
 }
コード例 #24
0
 function preflight($type, $parent)
 {
     if (!JComponentHelper::isEnabled('com_j2store')) {
         Jerror::raiseWarning(null, 'J2Store not found. Please install J2Store before installing this plugin');
         return false;
     }
     jimport('joomla.filesystem.file');
     $version_file = JPATH_ADMINISTRATOR . '/components/com_j2store/version.php';
     if (JFile::exists($version_file)) {
         // abort if the current J2Store release is older
         if (version_compare(J2STORE_VERSION, '2.7.3', 'lt')) {
             Jerror::raiseWarning(null, 'You are using an old version of J2Store. Please upgrade to the latest version');
             return false;
         }
     } else {
         Jerror::raiseWarning(null, 'J2Store not found or the version file is not found. Make sure that you have installed J2Store before installing this plugin');
         return false;
     }
 }
コード例 #25
0
ファイル: script.php プロジェクト: naka211/compac
 /**
  * method to run before an install/update/uninstall method
  *
  * @return void
  */
 function preflight($type, $parent)
 {
     $jversion = new JVersion();
     // Installing component manifest file version
     $component_version = $parent->get("manifest")->version;
     $joomla_version_dest = $jversion->getShortVersion();
     $minimun_version = $parent->get("manifest")->attributes()->minimum_version;
     $maximun_version = $parent->get("manifest")->attributes()->maximum_version;
     //abort if version less than minimun
     if ($minimun_version && version_compare($joomla_version_dest, $minimun_version, 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install in a Joomla release prior to ' . $minimun_version);
         return false;
     }
     // abort if the current Joomla release is older
     if ($maximun_version && version_compare($joomla_version_dest, $maximun_version . '.9999', 'gt')) {
         Jerror::raiseWarning(null, 'Cannot install in a Joomla release greater than ' . $maximun_version);
         return false;
     }
 }
コード例 #26
0
ファイル: install.php プロジェクト: Texpaok/joommark
 /**
  * Joomla! pre-flight event
  * 
  * @param string $type Installation type (install, update, discover_install)
  * @param JInstaller $parent Parent object
  */
 public function preflight($type, $parent)
 {
     // Only allow to install on PHP 5.3.0 or later
     if (!version_compare(PHP_VERSION, '5.3.0', 'ge')) {
         Jerror::raiseWarning(null, "Joommark requires, at least, PHP 5.3.0");
         return false;
     } else {
         if (version_compare(JVERSION, '3.0.0', 'lt')) {
             // Only allow to install on Joomla! 3.0.0 or later, but not in 2.5 branch
             Jerror::raiseWarning(null, "This version doesn't work in Joomla! 2.5 branch");
             return false;
         }
     }
     // Check if the 'mb_strlen' function is enabled
     if (!function_exists("mb_strlen")) {
         Jerror::raiseWarning(null, "The 'mb_strlen' function is not installed in your host. Please, ask your hosting provider about how to install it.");
         return false;
     }
 }
コード例 #27
0
 /**
  * Joomla! pre-flight event
  * 
  * @param string $type Installation type (install, update, discover_install)
  * @param JInstaller $parent Parent object
  */
 public function preflight($type, $parent)
 {
     // Only allow to install on PHP 5.3.0 or later
     if (!version_compare(PHP_VERSION, '5.3.0', 'ge')) {
         Jerror::raiseWarning(null, JText::_('COM_JOOMMARK_ERROR_INSTALLING_PHP_VERSION'));
         return false;
     } else {
         if (version_compare(JVERSION, '3.0.0', 'lt')) {
             // Only allow to install on Joomla! 3.0.0 or later, but not in 2.5 branch
             Jerror::raiseWarning(null, JText::_('COM_JOOMMARK_ERROR_INSTALLING_JOOMLA_VERSION'));
             return false;
         }
     }
     // Check if the 'mb_strlen' function is enabled
     if (!function_exists("mb_strlen")) {
         Jerror::raiseWarning(null, JText::_('COM_JOOMMARK_ERROR_INSTALLING_FUNCTION_MB_STRLEN'));
         return false;
     }
 }
コード例 #28
0
 function preflight($type, $parent)
 {
     ## this component does not work with Joomla releases prior to 1.6
     ## abort if the current Joomla release is older
     $jversion = new JVersion();
     if (version_compare($jversion->getShortVersion(), '1.6', 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install Ticketmaster in a Joomla release prior to 1.6');
         return false;
     }
     ## abort if the release being installed is not newer than the currently installed version
     if ($type == 'update') {
         $oldRelease = $this->getParam('version');
         $rel = $oldRelease . ' to ' . $this->release;
         if (version_compare($this->release, $oldRelease, 'le')) {
             Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
             return false;
         }
     } else {
         $rel = $this->release;
     }
     echo '<p>' . JText::_('' . $type . ' ' . $rel) . '</p>';
 }
コード例 #29
0
ファイル: script.php プロジェクト: hogeh/htraininglogs
 function preflight($type, $parent)
 {
     // this component does not work with Joomla releases prior to 1.6
     // abort if the current Joomla release is older
     $jversion = new JVersion();
     if (version_compare($jversion->getShortVersion(), '3.2', 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install COM_HTRAININGLOGSs in a Joomla release prior to 3.2');
         return false;
     }
     // abort if the release being installed is not newer than the currently installed version
     if ($type == 'update') {
         $oldRelease = $this->b('version');
         $rel = $oldRelease . ' to ' . $this->release;
         if (version_compare($this->release, $oldRelease, 'le')) {
             Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
             return false;
         }
     } else {
         $rel = $this->release;
     }
     echo '<p>' . JText::_('COM_HTRAININGLOGS_PREFLIGHT_' . $type . ' ' . $rel) . '</p>';
 }
コード例 #30
0
 /**
  * Method called before install/update the component. Note: This method won't be called during uninstall process.
  * @param string $type Type of process [install | update]
  * @param mixed $parent Object who called this method
  * @return boolean True if the process should continue, false otherwise
  */
 public function preflight($type, $parent)
 {
     $jversion = new JVersion();
     // Installing component manifest file version
     $manifest = $parent->get("manifest");
     $this->release = (string) $manifest['version'];
     $this->citybranding_version = $parent->get("manifest")->version;
     // abort if the component wasn't build for the current Joomla version
     if (!$jversion->isCompatible($this->release)) {
         JFactory::getApplication()->enqueueMessage(JText::_('This component is not compatible with installed Joomla version'), 'error');
         return false;
     }
     // abort if the component being installed is older than the currently installed version
     if ($type == 'update') {
         $oldRelease = $this->getParam('version');
         $rel = $oldRelease . ' to ' . $this->citybranding_version;
         if (version_compare($this->citybranding_version, $oldRelease, 'lt')) {
             Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
             return false;
         }
     }
 }