当前位置: 首页>>代码示例>>PHP>>正文


PHP CApplicationComponent类代码示例

本文整理汇总了PHP中CApplicationComponent的典型用法代码示例。如果您正苦于以下问题:PHP CApplicationComponent类的具体用法?PHP CApplicationComponent怎么用?PHP CApplicationComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CApplicationComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $path = dirname(__FILE__) . '/lib/google-api-php-client/src';
     set_include_path(get_include_path() . PATH_SEPARATOR . $path);
     require_once 'Google_Client.php';
     parent::init();
 }
开发者ID:balrok,项目名称:aiajaya,代码行数:7,代码来源:GoogleApis.php

示例2: __call

 public function __call($name, $parameters)
 {
     if (method_exists($this->_api, $name)) {
         return call_user_func_array(array($this->_api, $name), $parameters);
     }
     return parent::__call($name, $parameters);
 }
开发者ID:newga,项目名称:newga,代码行数:7,代码来源:MailgunYii.php

示例3: init

 /**
  * Panel initialization.
  * Generate unique tag for page. Attach panels, log watcher. Register scripts for printing debug panel.
  */
 public function init()
 {
     parent::init();
     if (!$this->enabled) {
         return;
     }
     Yii::setPathOfAlias('yii2-debug', dirname(__FILE__));
     Yii::app()->setImport(array('yii2-debug.*', 'yii2-debug.panels.*'));
     if ($this->logPath === null) {
         $this->logPath = Yii::app()->getRuntimePath() . '/debug';
     }
     $panels = array();
     foreach (CMap::mergeArray($this->corePanels(), $this->panels) as $id => $config) {
         if (!isset($config['highlightCode'])) {
             $config['highlightCode'] = $this->highlightCode;
         }
         $panels[$id] = Yii::createComponent($config, $this, $id);
     }
     $this->panels = $panels;
     Yii::app()->setModules(array($this->moduleId => array('class' => 'Yii2DebugModule', 'owner' => $this)));
     if ($this->internalUrls && Yii::app()->getUrlManager()->urlFormat == 'path') {
         $rules = array();
         foreach ($this->coreUrlRules() as $key => $value) {
             $rules[$this->moduleId . '/' . $key] = $this->moduleId . '/' . $value;
         }
         Yii::app()->getUrlManager()->addRules($rules, false);
     }
     Yii::app()->attachEventHandler('onEndRequest', array($this, 'onEndRequest'));
     $this->initToolbar();
 }
开发者ID:Orlac,项目名称:yii2-debug,代码行数:34,代码来源:Yii2Debug.php

示例4: init

 /**
  * Init
  * 
  * @throws CException
  */
 public function init()
 {
     if (!function_exists('curl_init')) {
         throw new CException('Для работы расширения требуется cURL');
     }
     parent::init();
 }
开发者ID:postfx,项目名称:fermion,代码行数:12,代码来源:Sms.php

示例5: init

 public function init()
 {
     if (!function_exists("imagecreatetruecolor")) {
         throw new Exception("使用这个类,需要启用GD库", 500);
     }
     parent::init();
 }
开发者ID:majinliang123,项目名称:myblog,代码行数:7,代码来源:CThumb.php

示例6: init

 /**
  * Set default gateway from config
  */
 public function init()
 {
     if ($this->activeGateway === null && $this->defaultGateway !== null) {
         $this->setGateway($this->defaultGateway);
     }
     parent::init();
 }
开发者ID:yii-ext,项目名称:payment,代码行数:10,代码来源:PaymentComponent.php

示例7: init

 /**
  * Initializes the application component.
  *
  * @throws CException
  */
 public function init()
 {
     parent::init();
     // adding LessPhp library directory to include path
     Yii::import($this->lessphpDir . '.*');
     // including LessPhp class
     require_once 'lessc.inc.php';
     if ($this->basePath === null) {
         $this->basePath = Yii::getPathOfAlias('webroot');
     }
     if (!is_array($this->files)) {
         throw new CException('Failed to compile LESS. Property files must be an array.');
     }
     foreach ($this->files as $fileLess => $fileCss) {
         $pathLess = $this->basePath . '/' . $fileLess;
         $pathCss = $this->basePath . '/' . $fileCss;
         try {
             if (file_exists($pathLess)) {
                 if ($this->forceCompile === true) {
                     $this->getLessphp()->compileFile($pathLess, $pathCss);
                 } else {
                     $this->getLessphp()->checkedCompile($pathLess, $pathCss);
                 }
             }
         } catch (Exception $e) {
             throw new CException(__CLASS__ . ': ' . Yii::t('less', 'Failed to compile less file with message: `{message}`.', array('{message}' => $e->getMessage())));
         }
     }
 }
开发者ID:dotzero,项目名称:yii-less,代码行数:34,代码来源:ELessCompiler.php

示例8: init

 /**
  * Initializes this component.
  */
 public function init()
 {
     parent::init();
     if ($this->bootstrapPath === null) {
         $this->bootstrapPath = Yii::getPathOfAlias('bootstrap');
     }
 }
开发者ID:phongsathon-jk,项目名称:wil_webapp,代码行数:10,代码来源:TbApi.php

示例9: init

 public function init()
 {
     parent::init();
     Yii::import('ext.imageapi.Toolkit');
     Yii::import('ext.imageapi.GDToolkit');
     $this->toolkit = new GDToolkit();
 }
开发者ID:CHILMEX,项目名称:amocasion,代码行数:7,代码来源:CImage.php

示例10: __get

 /**
  * Magic accessor for image collections.
  */
 public function __get($name)
 {
     if (!isset($this->collections[$name])) {
         return parent::__get($name);
     }
     return $this->getCollection($name);
 }
开发者ID:purnachandra,项目名称:yii-blogdemo-extended,代码行数:10,代码来源:CImageManager.php

示例11: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->preInit();
     Yii::import('bootstrap.widgets.*');
     parent::init();
     $this->setScriptMap();
 }
开发者ID:fourteenmeister,项目名称:yii-bootstrap,代码行数:10,代码来源:Bootstrap.php

示例12: init

 /**
  * Initialize the component
  */
 public function init()
 {
     $this->initAutoloader($this->swiftBasePath);
     $this->transport = Swift_SmtpTransport::newInstance($this->host, $this->port, $this->security);
     $this->transport->setUsername($this->username)->setPassword($this->password);
     parent::init();
 }
开发者ID:sobit,项目名称:swiftmailer-component,代码行数:10,代码来源:SwiftMailerComponent.php

示例13: __call

 public function __call($name, $parameters)
 {
     if (\method_exists($this->_imageHandler, $name)) {
         return \call_user_func_array(array($this->_imageHandler, $name), $parameters);
     }
     return parent::__call($name, $parameters);
 }
开发者ID:metalguardian,项目名称:yii-file-processor,代码行数:7,代码来源:MImageHandler.php

示例14: init

 public function init()
 {
     parent::init();
     require Yii::getPathOfAlias('ext.PHPMailer') . '/PHPMailerAutoload.php';
     $this->PHPMailer = new PHPMailer();
     $this->settings();
 }
开发者ID:mmorpg2015,项目名称:ghtweb5,代码行数:7,代码来源:Notify.php

示例15: init

 /**
  * Initializes the application component.
  * This method overrides the parent implementation by preprocessing
  * the user request data.
  */
 public function init()
 {
     parent::init();
     if ($this->sanitizePost && count($_POST) > 0 || $this->sanitizeGet && count($_GET) > 0 || $this->sanitizePost && count($_COOKIE) > 0) {
         $this->sanitizeRequest();
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:12,代码来源:ESanitizer.php


注:本文中的CApplicationComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。