/**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     $available_lang_dir = new Dir("/resources/lang/");
     if ($available_lang_dir->exists()) {
         $this->info("Available languages :");
         $this->info("");
         $folds = $available_lang_dir->listFolders();
         foreach ($folds as $f) {
             $this->info("[" . $f->getName() . "]");
         }
     } else {
         $this->warn("Localization directory " . $available_lang_dir->getPath() . " does not exists!!");
     }
     $hidden_lang_dir = new Dir("/storage/app/hidden_lang/");
     $this->info("");
     if ($hidden_lang_dir->exists()) {
         $this->info("Hidden languages :");
         $this->info("");
         $folds = $hidden_lang_dir->listFolders();
         foreach ($folds as $f) {
             $this->info("[" . $f->getName() . "]");
         }
     } else {
         $this->info("No hidden localizations found.");
     }
 }
Exemple #2
0
 function __construct(Dir $d)
 {
     $folders = $d->listFolders();
     foreach ($folders as $fld) {
         $lang_folder = new AvailableLocale($fld);
         $this->locales[$lang_folder->getName()] = $lang_folder;
     }
 }
Exemple #3
0
 public function __construct(Dir $d)
 {
     $this->name = $d->getFullName();
     $folders = $d->listFolders();
     foreach ($folders as $fld) {
         $this->folders[$fld->getName()] = new LangFolder($fld);
     }
     $files = $d->listFiles();
     foreach ($files as $fl) {
         $this->files[$fl->getName()] = new LangFile($fl);
     }
 }
Exemple #4
0
 function testDirectoryContent3()
 {
     $d1 = new Dir("/test/test_dir/");
     $folders = array();
     foreach ($d1->listFolders(array("/\\A\\..*\\Z/", "/\\Acontent.*\\Z/")) as $d) {
         $folders[] = $d->getName();
     }
     $this->assertEquals(2, count($folders), "Il numero delle cartelle non corrisponde!!");
     $this->assertTrue(array_search("single_subdir", $folders) !== FALSE, "La cartella single_subdir non è presente!!");
     $this->assertTrue(array_search("empty_dir", $folders) !== FALSE, "La cartella empty_dir non è presente!!");
 }