예제 #1
0
 /**
  * @return string path to the error message file
  */
 protected function getErrorMessageFile()
 {
     $lang = Prado::getPreferredLanguage();
     $msgFile = Prado::getFrameworkPath() . '/Exceptions/messages/messages-' . $lang . '.txt';
     if (!is_file($msgFile)) {
         $msgFile = Prado::getFrameworkPath() . '/Exceptions/messages/messages.txt';
     }
     return $msgFile;
 }
예제 #2
0
 /**
  * @return string path to the error message file
  */
 protected function getErrorMessageFile()
 {
     $lang = Prado::getPreferredLanguage();
     $path = dirname(__FILE__);
     $msgFile = $path . '/messages-' . $lang . '.txt';
     if (!is_file($msgFile)) {
         $msgFile = $path . '/messages.txt';
     }
     return $msgFile;
 }
예제 #3
0
 protected function getErrorTemplate($statusCode, $exception)
 {
     $base = $this->getErrorTemplatePath() . DIRECTORY_SEPARATOR . self::ERROR_FILE_NAME;
     $lang = Prado::getPreferredLanguage();
     if (is_file("{$base}{$statusCode}-{$lang}.html")) {
         $errorFile = "{$base}{$statusCode}-{$lang}.html";
     } else {
         if (is_file("{$base}{$statusCode}.html")) {
             $errorFile = "{$base}{$statusCode}.html";
         } else {
             if (is_file("{$base}-{$lang}.html")) {
                 $errorFile = "{$base}-{$lang}.html";
             } else {
                 $errorFile = "{$base}.html";
             }
         }
     }
     if (($content = @file_get_contents($errorFile)) === false) {
         die("Unable to open error template file '{$errorFile}'.");
     }
     return $content;
 }