Ejemplo n.º 1
0
 /**
  *
  * @return FileSystem
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         switch (String::asNative(\blaze\lang\System::getProperty('host.fs'))) {
             case 'UNIX':
                 self::$instance = new UnixFileSystem();
                 break;
             case 'WIN32':
                 self::$instance = new Win32FileSystem();
                 break;
             case 'WINNT':
                 self::$instance = new WinNTFileSystem();
                 break;
             default:
                 throw new \blaze\lang\Exception('Host uses unsupported filesystem, unable to proceed');
         }
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 /**
  * Returns the path to the temp directory.
  */
 public function getTempDir()
 {
     return System::getProperty('php.tmpdir');
 }
Ejemplo n.º 3
0
 private function _getUserPath()
 {
     //For both compatibility and security, we must look this up every time
     return (string) $this->normalize(\blaze\lang\System::getProperty("user.dir"));
 }
Ejemplo n.º 4
0
 /**
  * the file resolver
  */
 public function resolveFile(File $f)
 {
     // resolve if parent is a file oject only
     if ($this->isAbsolute($f)) {
         return $f->getPath()->toNative();
     } else {
         return $this->resolve(\blaze\lang\System::getProperty("user.dir"), $f->getPath()->toNative());
     }
 }