createDir() public static method

public static createDir ( $dir, $mode = 420 )
Esempio n. 1
0
 public function createDir($destination)
 {
     if (Filesystem::isDir($destination)) {
         $this->log('exists', $destination);
     } else {
         Filesystem::createDir($destination, 0777);
         $this->log('created', $destination);
     }
 }
Esempio n. 2
0
 /**
  * @testdox dispatch should render output when only view exists
  */
 public function testDispatchShouldRenderOutputWhenViewExists()
 {
     // create a test view
     Filesystem::createDir('app/views/missing', 0777);
     Filesystem::write('app/views/missing/test.htm.php', 'working');
     $output = Dispatcher::dispatch(array('controller' => 'missing', 'action' => 'test') + self::$defaults);
     // destroy the test view
     Filesystem::delete('app/views/missing');
     $this->assertNotEquals('', $output);
 }
Esempio n. 3
0
 public function upload($file, $name = null, $path = '')
 {
     $path = Filesystem::path('public/' . $path);
     if (is_null($name)) {
         $name = $file['name'];
     }
     if ($this->validates($file)) {
         if (!is_dir($path)) {
             Filesystem::createDir($path, 0777);
         }
         if (move_uploaded_file($file['tmp_name'], $path . '/' . $name)) {
             return true;
         } else {
             return $this->error('CantMoveFile');
         }
     }
     return false;
 }