lajax\translatemanager\services\Generator::__construct PHP Method

__construct() public method

public __construct ( Module $module, string $language_id )
$module lajax\translatemanager\Module
$language_id string Language of the file to be generated.
    public function __construct($module, $language_id)
    {
        $this->_languageId = $language_id;
        $this->_basePath = Yii::getAlias($module->tmpDir);
        if (!is_dir($this->_basePath)) {
            throw new InvalidConfigException("The directory does not exist: {$this->_basePath}");
        } elseif (!is_writable($this->_basePath)) {
            throw new InvalidConfigException("The directory is not writable by the Web process: {$this->_basePath}");
        }
        $this->_basePath = $module->getLanguageItemsDirPath();
        if (!is_dir($this->_basePath)) {
            mkdir($this->_basePath);
        }
        if (!is_writable($this->_basePath)) {
            throw new InvalidConfigException("The directory is not writable by the Web process: {$this->_basePath}");
        }
    }