public function __construct($config = array()) { // Call the parent constructor parent::__construct($config); // Get the Joomla! version from the configuration or the session if (array_key_exists('jversion', $config)) { $jVersion = $config['jversion']; } else { $jVersion = ASession::getInstance()->get('jversion', '2.5.0'); } // Load the configuration variables from the session or the default configuration shipped with ANGIE $this->configvars = ASession::getInstance()->get('configuration.variables'); if (empty($this->configvars)) { // Get default configuration based on the Joomla! version if (version_compare($jVersion, '2.5.0', 'ge') && version_compare($jVersion, '3.0.0', 'lt')) { $v = '25'; } else { $v = '30'; } $className = 'J' . $v . 'Config'; $filename = APATH_INSTALLATION . '/platform/models/jconfig/j' . $v . '.php'; $this->configvars = $this->loadFromFile($filename, $className); if (!empty($this->configvars)) { $this->saveToSession(); } } }
/** * Overridden constructor * * @param array $config Configuration array */ public function __construct($config = array()) { parent::__construct($config); $this->configModel = AModel::getAnInstance('Configuration', 'AngieModel'); }
/** * Overridden constructor * * @param array $config Configuration array * @param \AContainer $container */ public function __construct($config = array(), AContainer $container = null) { parent::__construct($config, $container); $this->configModel = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container); }