Ejemplo n.º 1
0
 public function visit(Dir $dir)
 {
     $files = $dir->listFiles();
     foreach ($files as $f) {
         if ($f instanceof File && $f->getFullExtension() == "blade.php") {
             $content = $f->getContent();
             $broken_list = array();
             $matches = array();
             preg_match_all("/\\@require_local_js\\(['\"](?P<path>[^'\"]+)['\"]\\)/", $content, $matches, PREG_SET_ORDER);
             foreach ($matches as $m) {
                 if (!$this->check_path($m["path"])) {
                     $broken_list[] = $m[0];
                 }
             }
             preg_match_all("/\\@require_local_css\\(['\"](?P<path>[^'\"]+)['\"]\\)/", $content, $matches, PREG_SET_ORDER);
             foreach ($matches as $m) {
                 if (!$this->check_path($m["path"])) {
                     $broken_list[] = $m[0];
                 }
             }
             if (!empty($broken_list)) {
                 $this->has_broken_paths = true;
                 $this->info("");
                 $this->error("Broken paths inside file " . $f->getPath() . " : ");
                 foreach ($broken_list as $bk) {
                     $this->info($bk . " is broken.");
                 }
             }
         }
     }
     return true;
 }
Ejemplo n.º 2
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);
     }
 }
Ejemplo n.º 3
0
 function testListFiles()
 {
     $d = new Dir("/test/properties_dir/");
     $results = $d->listFiles();
     $this->assertEquals(3, count($results), "Il numero dei risultati non corrisponde!!");
 }