public function testCheckIfFilePutWorks() { $path = __DIR__ . '/dummy/foo'; File::put($path, 'bar'); $this->assertTrue(File::exists($path), "Couldn't write files"); }
/** * creates folder recursively if there's none * must have a prefix, by default /public. * * @param string $path Path to be created */ public function directorize($path) { $folders = explode('/', $path); $pathbuild = $this->prefix; foreach ($folders as $folder) { $pathbuild .= "{$folder}/"; $cond = File::exists($pathbuild) && File::isDirectory($pathbuild); if (!$cond) { File::makeDirectory($pathbuild); File::put("{$pathbuild}.gitkeep", 'Generated by `anekdotes/manager`'); } } }