コード例 #1
0
ファイル: ComposerLintTask.php プロジェクト: Ryu0621/SaNaVi
 protected function findFiles()
 {
     $ds = new DirectoryScanner();
     $ds->setBasedir($this->dir);
     $ds->setIncludes(array('**/composer.json'));
     $ds->scan();
     return $ds->getIncludedFiles();
 }
コード例 #2
0
ファイル: GuzzleSubSplitTask.php プロジェクト: Ryu0621/SaNaVi
 protected function findSplits()
 {
     $this->log("checking heads for subsplits");
     $repo = $this->getRepository();
     $base = $this->getBase();
     $splits = array();
     $heads = $this->getHeads();
     if (!empty($base)) {
         $base = '/' . ltrim($base, '/');
     } else {
         $base = '/';
     }
     chdir($repo . '/.subsplit');
     foreach ($heads as $head) {
         $splits[$head] = array();
         passthru("git checkout '{$head}'");
         $ds = new DirectoryScanner();
         $ds->setBasedir($repo . '/.subsplit' . $base);
         $ds->setIncludes(array('**/' . $this->subIndicatorFile));
         $ds->scan();
         $files = $ds->getIncludedFiles();
         foreach ($files as $file) {
             $pkg = file_get_contents($repo . '/.subsplit' . $base . '/' . $file);
             $pkg_json = json_decode($pkg, true);
             $name = $pkg_json['name'];
             $component = str_replace('/composer.json', '', $file);
             $tmpreponame = explode('/', $name);
             $reponame = $tmpreponame[1];
             $splits[$head][$component]['repo'] = $reponame;
             $nscomponent = str_replace('/', '\\', $component);
             $splits[$head][$component]['desc'] = "[READ ONLY] Subtree split of {$nscomponent}: " . $pkg_json['description'];
         }
     }
     passthru("git checkout master");
     chdir($repo);
     $this->splits = $splits;
 }
コード例 #3
0
ファイル: AbstractFileSet.php プロジェクト: cuongnv540/jobeet
 /** feed dirscanner with infos defined by this fileset */
 protected function setupDirectoryScanner(DirectoryScanner $ds, Project $p)
 {
     if ($ds === null) {
         throw new Exception("DirectoryScanner cannot be null");
     }
     // FIXME - pass dir directly wehn dirscanner supports File
     $ds->setBasedir($this->dir->getPath());
     foreach ($this->additionalPatterns as $addPattern) {
         $this->defaultPatterns->append($addPattern, $p);
     }
     $ds->setIncludes($this->defaultPatterns->getIncludePatterns($p));
     $ds->setExcludes($this->defaultPatterns->getExcludePatterns($p));
     $p->log("FileSet: Setup file scanner in dir " . $this->dir->__toString() . " with " . $this->defaultPatterns->toString(), Project::MSG_DEBUG);
     if ($ds instanceof SelectorScanner) {
         $ds->setSelectors($this->getSelectors($p));
     }
     if ($this->useDefaultExcludes) {
         $ds->addDefaultExcludes();
     }
     $ds->setCaseSensitive($this->isCaseSensitive);
 }
コード例 #4
0
ファイル: Excludes.php プロジェクト: xxspartan16/BMS-Market
 /**
  * @param Project $project
  */
 public function __construct(Project $project)
 {
     $this->directoryScanner = new DirectoryScanner();
     $this->directoryScanner->setBasedir($project->getBasedir());
 }
コード例 #5
0
 private function makeEntityNames($dirnames, PhingFile $rootDir)
 {
     if (empty($dirnames)) {
         return;
     }
     foreach ($dirnames as $dirname) {
         $this->output .= "<!-- dir: {$dirname} -->\n";
         $ds = new DirectoryScanner();
         $ds->setIncludes(array("**/*.xml"));
         $futil = new FileUtils();
         $baseDir = $futil->resolveFile($rootDir, $dirname);
         $ds->setBasedir($baseDir->getPath());
         $ds->scan();
         $xmlFiles = $ds->getIncludedFiles();
         $allEntities = '';
         foreach ($xmlFiles as $xmlFilename) {
             $xmlFile = $futil->resolveFile($baseDir, $xmlFilename);
             $entityName = $this->fileToEntity($xmlFile, $rootDir);
             $this->output .= "<!-- {$dirname}/{$xmlFilename}-->\n";
             $this->output .= "<!ENTITY {$entityName} SYSTEM \"{$dirname}/{$xmlFilename}\">\n";
             $allEntities .= "&{$entityName};";
         }
         $this->output .= "<!-- {$dirname} -->\n";
         $this->output .= "<!ENTITY {$dirname}.all \"{$allEntities}\">\n";
     }
 }
コード例 #6
0
 public function findComponents()
 {
     $ds = new DirectoryScanner();
     $ds->setBasedir((string) $this->basedir . '/.subsplit/src');
     $ds->setIncludes(array('**/composer.json'));
     $ds->scan();
     $files = $ds->getIncludedFiles();
     $this->subpackages = $files;
 }
コード例 #7
0
 /**
  * Inspired by http://www.phing.info/trac/ticket/137
  */
 public function testMultipleExcludes()
 {
     $this->executeTarget("multiple-setup");
     $ds = new DirectoryScanner();
     $ds->setBasedir($this->_basedir . "/echo");
     $ds->setIncludes(array("**"));
     $ds->setExcludes(array("**/.gitignore", ".svn/", ".git/", "cache/", "build.xml", "a/a.xml"));
     $ds->scan();
     $this->compareFiles($ds, array("b/b.xml"), array("", "a", "b"));
 }