當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。