public function createDir($destination) { if (Filesystem::isDir($destination)) { $this->log('exists', $destination); } else { Filesystem::createDir($destination, 0777); $this->log('created', $destination); } }
/** * @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); }
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; }