/** * Initializes the component. * @throws CException if initialization fails. */ public function init() { if (!in_array($this->env, array(self::ENV_DEVELOPMENT, self::ENV_PRODUCTION))) { throw new CException('Failed to initialize LESS compiler. Property env must be either "development" or "production".'); } if (isset($this->dumpLineNumbers) && !in_array($this->dumpLineNumbers, array(self::DLN_COMMENTS, self::DLN_MEDIAQUERY, self::DLN_ALL))) { throw new CException('Failed to initialize LESS compiler. Property dumpLineNumber must be "comments", "mediaQuery" or "all".'); } parent::init(); }
/** * Initializes the component. * @throws CException if initialization fails. */ public function init() { parent::init(); if ($this->compression !== false && !in_array($this->compression, array(self::COMPRESSION_WHITESPACE, self::COMPRESSION_YUI))) { throw new CException('Failed to initialize LESS compiler. Property compression must be either "whitespace" or "yui".'); } if ($this->optimizationLevel !== false && !in_array($this->optimizationLevel, array(0, 1, 2))) { throw new CException('Failed to initialize LESS compiler. Property optimizationLevel must be 0, 1 or 2.'); } }