Exemplo n.º 1
0
 static function loadFileContents($path, $mode = 'nano')
 {
     //		echo "(loading $path in mode $mode)";
     $contents = "";
     switch ($mode) {
         case 'ini':
             $contents = self::loadIni($path);
             if ($contents !== false) {
                 return array(false, $contents, $path);
             }
         case 'nano':
         default:
             $contents = file_get_contents($path);
             if ($contents !== false) {
                 $contents .= "\n";
                 // TR20100407 Appending a newline on fetching the file contents takes care of THE nano-bug
                 return array(false, $contents, $path);
             } else {
                 die($path);
                 self::$error = "One_Script_Factory error : could not open '{$path}'";
                 return false;
             }
     }
 }