• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CApplicationComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init

 /**
  *
  */
 public function init()
 {
     parent::init();
     $this->setHasher(Yii::createComponent($this->hasher));
     $this->setTokenStorage(Yii::createComponent($this->tokenStorage));
     $this->userModule = Yii::app()->getModule('user');
 }
开发者ID:yupe,项目名称:yupe,代码行数:10,代码来源:UserManager.php


示例17: init

 public function init()
 {
     parent::init();
     Yii::setPathOfAlias('PhpAmqpLib', Yii::getPathOfAlias('vendor.yiiext.AMQP.PhpAmqpLib'));
     $this->_connect = new PhpAmqpLib\Connection\AMQPConnection($this->host, $this->port, $this->login, $this->password, $this->vhost);
     $this->_channel = $this->_connect->channel();
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:7,代码来源:AutosearchAMQP.php


示例18: init

 /**
  * handles the initialization parameters of the components
  */
 function init()
 {
     if (!count($this->acceptedLanguages)) {
         $this->getAcceptedLanguages();
     }
     return parent::init();
 }
开发者ID:Kostiantin,项目名称:floors,代码行数:10,代码来源:MPTranslate.php


示例19: init

 /**
  * CmsInput::init()
  * 
  * @return
  */
 public function init()
 {
     $this->originalPost = $_POST;
     $this->originalGet = $_GET;
     parent::init();
     Yii::app()->attachEventHandler('onBeginRequest', array($this, 'cleanGlobals'));
 }
开发者ID:janym,项目名称:angular-yii,代码行数:12,代码来源:CmsInput.php


示例20: init

 /**
  *
  */
 public function init()
 {
     parent::init();
     Yii::app()->getModule('email');
     $this->registerSwiftMailerAutoloader();
     $this->registerMustacheAutoloader();
 }
开发者ID:fourteenmeister,项目名称:yii-email-module,代码行数:10,代码来源:EEmailManager.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CArrayHelper类代码示例发布时间:2022-05-23
下一篇:
PHP CApplication类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap