Ejemplo n.º 1
0
 public function getTemplateName()
 {
     $templatesPath = Config::getDir(CONFIG::VIEW);
     $fullPath = $templatesPath . DIRECTORY_SEPARATOR . self::PAGES_DIR . DIRECTORY_SEPARATOR . $this->pageName;
     if (!file_exists($fullPath)) {
         $this->app->notFound();
     }
     return self::PAGES_DIR . DIRECTORY_SEPARATOR . $this->pageName;
 }
Ejemplo n.º 2
0
 /**
  * Logger constructor.
  * @param $logName
  */
 public function __construct($logName)
 {
     try {
         $logDir = Config::getDir(Config::LOG);
         if (!file_exists($logDir)) {
             mkdir($logDir);
         }
         $this->logger = new Logger($logName);
         $this->logger->pushHandler(new StreamHandler($logDir, Logger::ERROR));
     } catch (\Exception $e) {
         exit($e);
     }
 }
Ejemplo n.º 3
0
 /**
  * @param $path
  * @return string
  * @throws AppException
  */
 protected function getFullPath($path)
 {
     $settingsPath = Config::getDir(Config::PAGE_SETTINGS);
     return $settingsPath . DIRECTORY_SEPARATOR . $path;
 }
Ejemplo n.º 4
0
 /**
  * @covers Config::getDir
  * @expectedException Model\AppException
  */
 public function testGetDirThrowsException()
 {
     Config::getDir('foo');
 }