Example #1
0
 function __construct(JUpgradeproStep $step = null)
 {
     // Set the current step
     $this->_step = $step;
     jimport('legacy.component.helper');
     jimport('cms.version.version');
     JLoader::import('helpers.jupgradepro', JPATH_COMPONENT_ADMINISTRATOR);
     // Get the component parameters
     $this->params = JUpgradeproHelper::getParams();
     // Create the dabatase instance for this installation
     $this->_db = JFactory::getDBO();
     // Get the driver
     JLoader::register('JUpgradeproDriver', JPATH_LIBRARIES . '/matware/jupgrade/driver.php');
     if ($this->_step instanceof JUpgradeproStep) {
         $this->_step->table = $this->getSourceTable();
     }
     // Initialize the driver
     $this->_driver = JUpgradeproDriver::getInstance($step);
     // Get the total
     if (!empty($step->source)) {
         $this->_total = JUpgradeproHelper::getTotal($step);
     }
     // Set timelimit to 0
     if (!@ini_get('safe_mode')) {
         if (!empty($this->params->timelimit)) {
             set_time_limit(0);
         }
     }
     // Make sure we can see all errors.
     if (!empty($this->params->error_reporting)) {
         error_reporting(E_ALL);
         @ini_set('display_errors', 1);
     }
     // MySQL grants check
     $query = "SHOW GRANTS FOR CURRENT_USER";
     $this->_db->setQuery($query);
     $list = $this->_db->loadRowList();
     $grant = empty($list[1][0]) ? $list[0][0] : $list[1][0];
     if (strpos($grant, 'DROP') == true || strpos($grant, 'ALL') == true) {
         $this->canDrop = true;
     }
 }
Example #2
0
 function __construct(JUpgradeproStep $step = null)
 {
     parent::__construct($step);
     $class = !empty($step->class) ? $step->class : 'JUpgradepro';
     $name = !empty($step->name) ? $step->name : '';
     $xmlpath = !empty($step->xmlpath) ? $step->xmlpath : '';
     JLoader::import('helpers.jupgradepro', JPATH_COMPONENT_ADMINISTRATOR);
     JUpgradeproHelper::requireClass($name, $xmlpath, $class);
     // @@ Fix bug using PHP < 5.2.3 version
     if (version_compare(PHP_VERSION, '5.2.3', '<')) {
         $this->_conditions = call_user_func(array($class, 'getConditionsHook'));
     } else {
         $this->_conditions = $class::getConditionsHook();
     }
     $db_config = array();
     $db_config['driver'] = $this->params->old_dbtype;
     $db_config['host'] = $this->params->old_hostname;
     $db_config['user'] = $this->params->old_username;
     $db_config['password'] = $this->params->old_password;
     $db_config['database'] = $this->params->old_db;
     $db_config['prefix'] = $this->params->old_dbprefix;
     $this->_db_old = JDatabase::getInstance($db_config);
 }
Example #3
0
 function __construct(JUpgradeproStep $step = null)
 {
     parent::__construct($step);
 }