/**
  * @param $xmlFileName
  * @return \SimpleXMLElement
  */
 private function importFile($xmlFileName)
 {
     $config = [];
     if (File::fileExists($xmlFileName)) {
         $config = simplexml_load_file($xmlFileName);
         return $config;
     }
     return $config;
 }
Exemple #2
0
 /**
  * @param $controller
  * @param Directory $directory
  * @return mixed
  */
 private static function findControllerFilename($controller, Directory $directory)
 {
     $fileName = '';
     foreach ($directory->getArray() as $_file) {
         if (File::fileExists($_file) && preg_match('/^.*' . $controller . 'Controller.php$/', $_file)) {
             $fileName = $_file;
             break;
         }
     }
     return $fileName;
 }
Exemple #3
0
 /**
  * @param $file
  * @throws FileNotFoundException
  */
 private function checkViewExists($file)
 {
     if (!File::fileExists($file)) {
         throw new FileNotFoundException();
     }
 }
Exemple #4
0
 /**
  *
  */
 public function testCloseHandle()
 {
     $file = new File(__DIR__ . '/../resources/file.txt');
     $this->assertTrue($file->__destruct());
 }