Browse Source

speed up error handling

gjerokrsteski 11 years ago
parent
commit
b6b8fb18f9

+ 1 - 1
php-pimf/app/Vanilla/Controller/Hello.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 namespace Vanilla\Controller;
 namespace Vanilla\Controller;
 
 
-use Pimf\Controller\Base, Pimf\View, Pimf\Registry, Pimf\Param;
+use Pimf\Controller\Base, Pimf\View, Pimf\Registry;
 
 
 class Hello extends Base
 class Hello extends Base
 {
 {

+ 0 - 11
php-pimf/pimf-framework/bootstrap.core.php

@@ -1,11 +0,0 @@
-<?php
-/*
-|--------------------------------------------------------------------------
-| PIMF bootstrap
-|--------------------------------------------------------------------------
-*/
-if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR, true);
-if(!defined('BASE_PATH')) define('BASE_PATH', realpath(__DIR__) . DS, true);
-
-require_once 'autoload.core.php';
-require_once 'utils.php';

+ 1 - 1
php-pimf/pimf-framework/core/Pimf/Param.php

@@ -37,7 +37,7 @@ class Param
 
 
   /**
   /**
    * @param string $index
    * @param string $index
-   * @param mixed  $defaultValue
+   * @param null|string $defaultValue
    * @param bool   $filtered If you trust foreign input introduced to your PHP code - set to FALSE!
    * @param bool   $filtered If you trust foreign input introduced to your PHP code - set to FALSE!
    *
    *
    * @return string
    * @return string

+ 1 - 1
php-pimf/pimf-framework/core/Pimf/Util/File.php

@@ -77,7 +77,7 @@ class File extends \SplFileInfo
    */
    */
   protected function getTargetFile($dir, $name = null)
   protected function getTargetFile($dir, $name = null)
   {
   {
-    if (!is_dir($dir) || false === @mkdir($dir, 0777, true)) {
+    if (!is_dir($dir)) {
         throw new \RuntimeException("The destination folder $dir");
         throw new \RuntimeException("The destination folder $dir");
     }
     }
 
 

+ 1 - 0
php-pimf/pimf-framework/core/Pimf/Util/Header.php

@@ -60,6 +60,7 @@ class Header extends Header\ContentType
     $conf    = Registry::get('conf');
     $conf    = Registry::get('conf');
     $appTpl  = str_replace('/', DS, BASE_PATH . 'app/' . $conf['app']['name'] . '/_error/' . $code . '.php');
     $appTpl  = str_replace('/', DS, BASE_PATH . 'app/' . $conf['app']['name'] . '/_error/' . $code . '.php');
     $coreTpl = str_replace('/', DS, BASE_PATH . 'pimf-framework/core/Pimf/_error/' . $code . '.php');
     $coreTpl = str_replace('/', DS, BASE_PATH . 'pimf-framework/core/Pimf/_error/' . $code . '.php');
+    $coreTpl = str_replace(DS.'pimf-framework'.DS.'pimf-framework'.DS, DS.'pimf-framework'.DS, $coreTpl);
 
 
     if (file_exists($appTpl) && is_readable($appTpl)) {
     if (file_exists($appTpl) && is_readable($appTpl)) {
       include $appTpl;
       include $appTpl;

+ 2 - 1
php-pimf/pimf-framework/core/Pimf/Util/Uploaded/Factory.php

@@ -114,4 +114,5 @@ abstract class Factory
 
 
     return $files;
     return $files;
   }
   }
-}
+
+}