init() public method

This method is invoked at the end of the constructor after the object is initialized with the given configuration.
public init ( )
コード例 #1
0
ファイル: Pubu.php プロジェクト: lxpgw/logger
 /**
  * {@inheritdoc}
  */
 public function init()
 {
     parent::init();
     if (is_null($this->remote)) {
         throw new InvalidConfigException('$remote must be set.');
     }
 }
コード例 #2
0
 /**
  * @inheritdoc
  * @throws \BadMethodCallException
  */
 public function init()
 {
     parent::init();
     if (exec('command -v java >/dev/null && echo "yes" || echo "no"') == 'no') {
         throw new \BadMethodCallException('Java Not Installed');
     }
 }
コード例 #3
0
 public function init()
 {
     $this->_error = true;
     $this->_message = [];
     $this->_format = \yii\web\Response::FORMAT_JSON;
     return parent::init();
 }
コード例 #4
0
 public function init()
 {
     if (!yii::$app->user->isGuest) {
         $this->_userId = yii::$app->user->id;
     }
     return parent::init();
 }
コード例 #5
0
ファイル: JWConfig.php プロジェクト: wadeshuler/yii2-jwplayer
 public function init()
 {
     parent::init();
     if (!isset($this->key)) {
         throw new InvalidConfigException('JWPlayer: License key missing!');
     }
 }
コード例 #6
0
ファイル: Saml.php プロジェクト: asasmoyo/yii2-saml
 public function init()
 {
     parent::init();
     $configFile = Yii::getAlias($this->configFileName);
     $this->config = (require $configFile);
     $this->instance = new \OneLogin_Saml2_Auth($this->config);
 }
コード例 #7
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     if ($this->placeholder) {
         $this->placeholder = Yii::createObject($this->placeholder);
     }
 }
コード例 #8
0
 public function init()
 {
     parent::init();
     $this->isGlobal = $this->name === 'global';
     $this->isCustomization = $this->name === 'custom';
     $this->isInternal = $this->name === 'internal';
 }
コード例 #9
0
 public function init()
 {
     parent::init();
     if (!$this->_localFormatPhp) {
         $this->_localFormatPhp = FormatConverter::convertDateIcuToPhp($this->localFormat[1], $this->localFormat[0]);
     }
 }
コード例 #10
0
ファイル: Outlook.php プロジェクト: jarekkozak/yii2-libs
 public function init()
 {
     parent::init();
     if ($this->properties === TRUE && \Yii::$container->has('jarekkozak\\sys\\IProperties')) {
         $this->setProperties(\Yii::$container->get('jarekkozak\\sys\\IProperties'));
     }
 }
コード例 #11
0
ファイル: Client.php プロジェクト: dotzero/yii2-amocrm
 /**
  * Initializes the application component
  *
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (!class_exists('\\AmoCRM\\Client')) {
         throw new InvalidConfigException('AmoCRM not found. Try to install it via composer require dotzero/amocrm');
     }
 }
コード例 #12
0
 public function init()
 {
     parent::init();
     if (!empty($this->fileHash)) {
         $this->fileInfo = FileInfo::findOne(['hash' => $this->fileHash]);
     }
 }
コード例 #13
0
ファイル: KieFact.php プロジェクト: jarekkozak/yii2-libs
 public function init()
 {
     parent::init();
     if ($this->identifier == null) {
         $this->identifier = uniqid();
     }
 }
コード例 #14
0
ファイル: ExternalLink.php プロジェクト: luyadev/luya-core
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->href === null) {
         throw new InvalidConfigException('The href attribute can not be empty and must be set trough configuration array.');
     }
 }
コード例 #15
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->module === null) {
         throw new Exception('The ActiveWindow property \'module\' of ' . get_called_class() . ' can not be null. You have to defined the module in where the ActiveWindow is defined. For example `public $module = \'@admin\';`');
     }
 }
コード例 #16
0
 /**
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     foreach ($this->locators as $k => $config) {
         $this->locators[$k] = Instance::ensure($config, 'trntv\\bus\\interfaces\\HandlerLocator');
     }
     parent::init();
 }
コード例 #17
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->id) {
         $this->id = Inflector::slug($this->label);
     }
 }
コード例 #18
0
ファイル: Numerator.php プロジェクト: novikas/yii2-numerator
 public function init()
 {
     parent::init();
     if (!$this->masker instanceof NumeratorMasker || !$this->template instanceof NumeratorTemplate || !($this->template->mask === $this->masker->mask)) {
         throw new InvalidConfigException("Properties masker and template need to be set and their properties mask must be equal.");
     }
 }
コード例 #19
0
 public function init()
 {
     parent::init();
     if ($this->childOf === null || $this->title === null || $this->alias === null) {
         throw new Exception("The properties childOf, title and alias must be defined to inject a new Item.");
     }
 }
コード例 #20
0
ファイル: Tab.php プロジェクト: itzj86/yii2-dwz
 public function init()
 {
     parent::init();
     if (!(!empty($this->url) xor !empty($this->content))) {
         throw new \yii\base\InvalidConfigException("Url or Content must be exsit one");
     }
 }
コード例 #21
0
ファイル: Bloodhound.php プロジェクト: awebc/web_xbf
 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     if ($this->name === null) {
         throw new InvalidConfigException("'name' cannot be null.");
     }
     parent::init();
 }
コード例 #22
0
ファイル: PlaceManager.php プロジェクト: baranov-nt/setyes
 public function init()
 {
     parent::init();
     if (\Yii::$app->session->get('browserError') == 1) {
         throw new UnsupportedMediaTypeHttpException(Yii::t('app', 'Your browser is too old! Open the app with something more modern -:) Thank you.'));
     }
 }
コード例 #23
0
 public function init()
 {
     if (yii::$app->user->isGuest) {
         throw new \yii\web\HttpException(500, sprintf('Not available to guest users'));
     }
     return parent::init();
 }
コード例 #24
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->config === null) {
         throw new InvalidConfigException('The "config" property must be set.');
     }
     $this->config = $this->normalizeConfig($this->config);
 }
コード例 #25
0
ファイル: EAuth.php プロジェクト: nekulin/yii2-eauth
 /**
  * Initialize the component.
  */
 public function init()
 {
     parent::init();
     // set default cache on production environments
     if (!isset($this->cache) && YII_ENV_PROD) {
         $this->cache = 'cache';
     }
 }
コード例 #26
0
ファイル: Robokassa.php プロジェクト: goncharovln/keywords
 public function init()
 {
     parent::init();
     //if set testMode we used special URL for send params
     if ($this->testMode) {
         $this->baseUrl = 'http://test.robokassa.ru/Index.aspx';
     }
 }
コード例 #27
0
ファイル: Parser.php プロジェクト: pahanini/yii2-rest-doc
 /**
  * Class init.
  */
 public function init()
 {
     parent::init();
     static::registerTagHandlers();
     if (!$this->reflection instanceof \Reflector) {
         throw new InvalidConfigException("Reflection property must be set");
     }
 }
コード例 #28
0
 public function init()
 {
     parent::init();
     if ($this->url === NULL) {
         throw new InvalidConfigException('url must be provided');
     }
     $this->url = Url::to($this->url, true);
 }
コード例 #29
0
ファイル: Item.php プロジェクト: krystian-thiede/luya
 /**
  * Item-Object initiliazer, verify if the itemArray property is empty.
  *
  * @throws Exception
  */
 public function init()
 {
     if ($this->itemArray === null) {
         throw new Exception('The itemArray property can not be null.');
     }
     // call parent object initializer
     parent::init();
 }
コード例 #30
0
 public function init()
 {
     require_once \yii::$app->basePath . "/../vendor/setasign/fpdf/fpdf.php";
     require_once \yii::$app->basePath . "/../vendor/setasign/fpdi/fpdi.php";
     require_once \yii::$app->basePath . "/../vendor/setasign/fpdi_pdf-parser/pdf_parser.php";
     require_once \yii::$app->basePath . "/../vendor/setasign/setapdf-signer/library/SetaPDF/Autoload.php";
     return parent::init();
 }