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();
 }
 public function init()
 {
     if (!yii::$app->user->isGuest) {
         $this->_userId = yii::$app->user->id;
     }
     return parent::init();
 }
示例#5
0
 public function init()
 {
     parent::init();
     if (!isset($this->key)) {
         throw new InvalidConfigException('JWPlayer: License key missing!');
     }
 }
示例#6
0
 public function init()
 {
     parent::init();
     $configFile = Yii::getAlias($this->configFileName);
     $this->config = (require $configFile);
     $this->instance = new \OneLogin_Saml2_Auth($this->config);
 }
 /**
  *
  */
 public function init()
 {
     parent::init();
     if ($this->placeholder) {
         $this->placeholder = Yii::createObject($this->placeholder);
     }
 }
 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
 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
 /**
  * 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
 public function init()
 {
     parent::init();
     if ($this->identifier == null) {
         $this->identifier = uniqid();
     }
 }
示例#14
0
 /**
  * @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
 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
 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     if ($this->name === null) {
         throw new InvalidConfigException("'name' cannot be null.");
     }
     parent::init();
 }
示例#22
0
 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.'));
     }
 }
 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
 /**
  * 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
 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
 /**
  * Class init.
  */
 public function init()
 {
     parent::init();
     static::registerTagHandlers();
     if (!$this->reflection instanceof \Reflector) {
         throw new InvalidConfigException("Reflection property must be set");
     }
 }
 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-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();
 }