Example #1
0
 private static function shouldAdd($one, $two = false, $three = false, $four = false, $five = false)
 {
     //Controller not initiated yet.
     if (!Controller::getInit()) {
         return false;
     }
     //Some low level utilities only checks if the class exists, not if it is active
     if (!Component::isActive('BackendError')) {
         return false;
     }
     //Busy with something?
     if (self::$adding) {
         if (Controller::$debug) {
             var_dump($one, $two, $three, $four, $five);
             print_stacktrace();
             die('Recursive Backend Errors');
         }
         return false;
     }
     //Probably addBE
     if (!is_string($three) || !file_exists($three)) {
         return true;
     }
     if (Controller::$mode == Controller::MODE_EXECUTE) {
         //Check if the error originated in our realm
         if (stripos(BACKEND_FOLDER, $three) === false && stripos(APP_FOLDER, $three) === false && stripos(WEB_FOLDER, $three) === false && (!defined('SITE_FOLDER') || stripos(SITE_FOLDER, $three) === false)) {
             return false;
         }
     }
     return true;
 }