Beispiel #1
0
 public function loadClass($className, $classPath, $classFile = null, $loadAs = null)
 {
     // Clean variables are good variables, make sure to give your variables a wash at least once every time uncertain content is fed to it.
     $className = TextMan::cleanAlNum($className);
     $classPath = TextMan::cleanFilePath($classPath);
     $classFile = $classFile === null ? $className . '.php' : TextMan::cleanFilePath($classFile) . '.php';
     // Does the file exist? If not, return false
     if (file_exists(KERNEL_PATH . '/' . $classPath . '/' . $classFile) === false) {
         return false;
     }
     // Grab the file!
     include KERNEL_PATH . '/' . $classPath . '/' . $classFile;
     // Does the class exist? If not, return false
     if (class_exists($className) === false) {
         return false;
     }
     $loadAs = $loadAs === null ? $className : $loadAs;
     // Load the class and run it then get out of here
     $this->_loadedClasses[$loadAs] = new $className($this);
     return true;
 }
Beispiel #2
0
 static function cleanFileName($incoming)
 {
     return TextMan::cleanFilePath($incoming);
 }