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


PHP CApplicationComponent::init方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: init

 public function init()
 {
     parent::init();
     if (!$this->isComponentActive()) {
         return;
     }
     try {
         $this->userInfo = call_user_func($this->userInfoCallable);
         $this->setUser($this->userInfo);
         $memcacheServerName = $this->cacheServer['host'];
         $memcacheServerPort = $this->cacheServer['port'];
         if ($memcacheServerName && $memcacheServerPort) {
             $memcached = new \Memcached();
             $memcached->addServer($memcacheServerName, $memcacheServerPort);
             $cacheDriver = new \Doctrine\Common\Cache\MemcachedCache();
             $cacheDriver->setMemcached($memcached);
             $cacheStorage = new \Kevinrob\GuzzleCache\Storage\DoctrineCacheStorage($cacheDriver);
         } else {
             $cacheStorage = new \Kevinrob\GuzzleCache\Storage\DoctrineCacheStorage(new \Doctrine\Common\Cache\FilesystemCache('/tmp/'));
         }
         $this->client = new \LaunchDarkly\LDClient($this->apiKey, array("cache" => $cacheStorage));
         $this->featureToggleUser = (new \LaunchDarkly\LDUserBuilder($this->user->key))->secondary($this->user->secondary)->ip($this->user->ip)->country($this->user->country)->email($this->user->email)->name($this->user->name)->avatar($this->user->avatar)->firstName($this->user->firstName)->lastName($this->user->lastName)->anonymous($this->user->anonymous)->custom(array('type' => $this->user->type, 'parentCompanyId' => $this->user->parentId, 'referredAccountId' => $this->user->referredAccountId, 'channel' => $this->user->channel, 'payoutMethod' => isset($this->user->payoutMethod) ? $this->user->payoutMethod : null))->build();
     } catch (\Exception $ex) {
         $this->componentActive = false;
         \Yii::log("Cannot initiate Feature Toggles: {$ex->getMessage()}", \CLogger::LEVEL_WARNING, 'system.featureToggle');
     }
 }
开发者ID:BehalfFE,项目名称:featureToggle,代码行数:27,代码来源:FeatureToggle.php

示例5: init

 /**
  * Initializes the component.
  * This method is required by {@link IApplicationComponent} and is invoked by application
  * when the EFtpComponent is used as an application component.
  * If you override this method, make sure to call the parent implementation
  * so that the component can be marked as initialized.
  */
 public function init()
 {
     parent::init();
     if ($this->autoConnect) {
         $this->setActive(true);
     }
 }
开发者ID:mudiman,项目名称:yiirestintegrated,代码行数:14,代码来源:EFtpComponent.php

示例6: init

 /**
  * Registers Analytics.js and initializes the tracking code
  */
 public function init()
 {
     $sapi = php_sapi_name();
     if ($sapi == 'cli') {
         return;
     }
     // Set the alias path
     if (Yii::getPathOfAlias('analytics') === false) {
         Yii::setPathOfAlias('analytics', realpath(dirname(__FILE__) . '/..'));
     }
     parent::init();
     // Don't load up the analytics.js if we don't have any data
     $providers = $this->getProviders();
     if (empty($providers)) {
         return;
     }
     // Conver options into json
     $json = CJSON::encode($providers);
     // Load up the asset manager
     $asset = Yii::app()->assetManager->publish(__DIR__ . DS . 'assets' . DS . 'js', true, -1, YII_DEBUG);
     $cs = Yii::app()->getClientScript();
     // Register the appropriate script file
     $cs->registerScriptFile($asset . (YII_DEBUG ? '/analytics.js' : '/analytics.min.js'));
     // Initialize
     $cs->registerScript('analytics.js', "analytics.initialize({$json}); analytics.page();");
     if ($this->lowerBounceRate) {
         $cs->registerScript('analytics.js-bounce-rate-15', 'setTimeout(function() { analytics.track("_trackEvent", "15 Seconds"); }, 15000 );');
         $cs->registerScript('analytics.js-bounce-rate-30', 'setTimeout(function() { analytics.track("_trackEvent", "30 Seconds"); }, 30000 );');
         $cs->registerScript('analytics.js-bounce-rate-60', 'setTimeout(function() { analytics.track("_trackEvent", "60 Seconds"); }, 60000 );');
     }
 }
开发者ID:charlesportwoodii,项目名称:eanalytics,代码行数:34,代码来源:EAnalytics.php

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: init

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

示例13: 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

示例14: 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

示例15: init

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


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