/** * Execute the command. * * @return void */ public function handle() { $lang = $this->getNameArgument(); // $target = new Dir("/resources/lang/" . $lang); if ($target->exists()) { $hide_dir = new Dir("/storage/app/hidden_langs"); if (!$hide_dir->exists()) { $this->info("Hidden languages storage dir created."); $hide_dir->touch(); } $target->moveTo($hide_dir); $this->info("Language " . $lang . " hidden succesfully."); } else { $this->error("Language " . $lang . " not found."); } }
function testDeleteRealEmpty() { $d = new Dir("/test/delete_test_dir_empty/real_empty_dir/"); $this->assertFalse($d->exists(), "La cartella dal eliminare non esiste!!"); $d->touch(); $this->assertTrue($d->exists(), "La cartella da eliminare non è stata creata!!"); $d->delete(); $this->assertFalse($d->exists(), "La cartella da eliminare non è stata eliminata!!"); }
/** * Returns the folder to use for saving generated classes. * * @return \Mbcraft\Piol\Dir The dir instance pointing to the * generated classes folder. */ public static function getGeneratedClassFolder() { $d = new Dir(self::DEFAULT_GENERATED_CLASS_FOLDER); $d->touch(); return $d; }
function testNewTempFileNonWritableDir() { $d = new Dir("/test/tmp_dir_no_w/"); $d->touch(); $d->setPermissions("r--------"); try { File::setTmpFileDir($d); $this->fail("Using a non-writable directory as temporary dir should throw an Exception."); } catch (IOException $ex) { } $d->delete(); }