/** * Checks everything is good with our project before we run it * * @throws ProjectException */ protected function checkEnv() { parent::checkEnv(); if (!isset($this->templateDir)) { if ($this->getOption('synergy:webproject:template_dir')) { try { $this->setTemplateDir($this->getOption('synergy:webproject:template_dir')); Logger::debug('Template Dir: ' . $this->templateDir); } catch (InvalidArgumentException $ex) { throw new ProjectException('Unable to find or use your template directory: ' . $this->getOption('synergy:webproject:template_dir')); } } else { // try and locate a template directory if (is_dir($this->app_dir . DIRECTORY_SEPARATOR . 'templates')) { $this->setTemplateDir($this->app_dir . DIRECTORY_SEPARATOR . 'templates'); } elseif (defined('SYNERGY_ROOT_DIR') && is_dir(SYNERGY_ROOT_DIR . DIRECTORY_SEPARATOR . 'templates')) { $this->setTemplateDir(SYNERGY_ROOT_DIR . DIRECTORY_SEPARATOR . 'templates'); } } } }