public function __construct($config = null)
 {
     parent::__construct($config);
     // Load email settings.
     $email = (require Yii::app()->basePath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'email.php');
     $this->config = array_merge($this->config, $email);
 }
 public function __construct($config = null)
 {
     parent::__construct($config);
     // Set webroot alias.
     Yii::setPathOfAlias('webroot', realpath(Yii::getPathOfAlias('application') . '/../'));
     // Load email settings.
     $email = (require Yii::app()->basePath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'email.php');
     $this->config = array_merge($this->config, $email);
     // Now initialize the plugin manager
 }
Beispiel #3
0
	protected function registerCoreComponents(){
		parent::registerCoreComponents();

		$components = array(
			'image'=>array(
				'class'=>'eyii.extensions.image.CImageComponent',
				'driver'=>'GD'
			),
		);

		$this->setComponents(EYii::arrayCoreComponents('console'));
	}
Beispiel #4
0
 /**
  *
  */
 public function init()
 {
     // Set default timezone to UTC
     date_default_timezone_set('UTC');
     foreach ($this->componentAliases as $alias) {
         Craft::import($alias);
     }
     craft()->getComponent('log');
     // Set our own custom runtime path.
     $this->setRuntimePath(craft()->path->getRuntimePath());
     // No need for these.
     craft()->log->removeRoute('WebLogRoute');
     craft()->log->removeRoute('ProfileLogRoute');
     // Load the plugins
     craft()->plugins->loadPlugins();
     parent::init();
 }
 /**
  * Registers the core application components.
  * This method overrides the parent implementation by registering additional core components.
  * @see setComponents
  */
 protected function registerCoreComponents()
 {
     parent::registerCoreComponents();
     $components = array('widgetFactory' => array('class' => 'CWidgetFactory'), 'themeManager' => array('class' => 'CThemeManager'));
     $this->setComponents($components);
 }
 public function saveGlobalState()
 {
     parent::saveGlobalState();
 }
Beispiel #7
0
 /**
  * @todo Remove for Craft 3.
  *
  * @param int    $code    The level of the error raised.
  * @param string $message The error message.
  * @param string $file    The filename that the error was raised in.
  * @param int    $line    The line number the error was raised at.
  */
 public function handleError($code, $message, $file, $line)
 {
     // PHP 7 turned some E_STRICT messages to E_WARNINGs. Code 2 is for all warnings
     // and since there are no messages specific codes we have to parse the string for what
     // we're looking for. Lame, but it works since all PHP error messages are always in English.
     // https://stackoverflow.com/questions/11556375/is-there-a-way-to-localize-phps-error-output
     if (version_compare(PHP_VERSION, '7', '>=') && $code === 2 && strpos($message, 'should be compatible with') !== false) {
         return;
     }
     parent::handleError($code, $message, $file, $line);
 }
 protected function registerCoreComponents()
 {
     parent::registerCoreComponents();
     $components = array('session' => array('class' => 'CHttpSession'), 'themeManager' => array('class' => 'CThemeManager'));
     $this->setComponents($components);
 }
Beispiel #9
0
 public function __construct($config = null)
 {
     parent::__construct($config);
     register_shutdown_function(array($this, 'onShutdownHandler'));
 }
Beispiel #10
0
 /**
  * Override getComponent() so we can attach any pending events if the component is getting initialized as well as
  * do some special logic around creating the `craft()->db` application component.
  *
  * @param string $id
  * @param bool   $createIfNull
  *
  * @return mixed
  */
 public function getComponent($id, $createIfNull = true)
 {
     $component = parent::getComponent($id, false);
     if (!$component && $createIfNull) {
         if ($id === 'db') {
             $dbConnection = $this->asa('AppBehavior')->createDbConnection();
             $this->setComponent('db', $dbConnection);
         }
         $component = parent::getComponent($id, true);
         $this->_attachEventListeners($id);
     }
     return $component;
 }
 /**
  * {@inheritDoc}
  * @see CApplication::registerCoreComponents()
  */
 protected function registerCoreComponents()
 {
     parent::registerCoreComponents();
     $components = array('console' => array('class' => 'CConsole'));
     $this->setComponents($components);
 }
 /**
  * Sets the application components.
  *
  * @param      $components
  * @param bool $merge
  *
  * @return null
  */
 public function setComponents($components, $merge = true)
 {
     if (isset($components['editionComponents'])) {
         $this->_editionComponents = $components['editionComponents'];
         unset($components['editionComponents']);
     }
     parent::setComponents($components, $merge);
 }
 protected function registerCoreComponents()
 {
     parent::registerCoreComponents();
     $components = array('user' => array('class' => 'ConsoleUser'), 'themeManager' => array('class' => 'CThemeManager'));
     $this->setComponents($components);
 }