예제 #1
0
 /**
  * Scans the project.
  *
  * @return void
  */
 private function scan()
 {
     foreach ($this->project->copies as $copy) {
         if (is_dir($copy)) {
             //-- Process known extensions
             foreach ($this->fileExtensions as $ext) {
                 $data = $this->getCodeLines($copy, $ext);
                 $this->addData($data, $ext);
             }
             //foreach
             //-- Process images
             $files = JFolder::files($copy, $this->imgExtensions, true, true);
             $this->projectData['images']['files'] += count($files);
             foreach ($files as $file) {
                 $this->projectData['images']['size'] += filesize($file);
             }
             //foreach
             $this->totalFiles += $this->projectData['images']['files'];
             $this->totalSize += $this->projectData['images']['size'];
         } else {
             //-- It's a file
             //... @todo ?
             //-- Process known extensions
             foreach ($this->fileExtensions as $ext) {
                 $data = $this->getCodeLines($copy, $ext);
                 $this->addData($data, $ext);
             }
             //foreach
         }
     }
     //foreach
     /*
      * Language files
      */
     $langPaths = $this->project->getLanguagePaths();
     $languages = EcrLanguageHelper::discoverLanguages($this->project);
     foreach ($languages as $tag => $scopes) {
         foreach ($scopes as $scope) {
             $fileName = $langPaths[$scope] . DS . 'language' . DS . $tag . DS . $tag . '.' . $this->project->getLanguageFileName($scope);
             $data = $this->getCodeLines($fileName, 'ini');
             $this->addData($data, 'languages');
         }
         //foreach
     }
     //foreach
     return $this;
 }
예제 #2
0
 /**
  * Constructor.
  *
  * @param string $name Project name.
  */
 public function __construct($name = '')
 {
     if (!$name || !$this->readProjectXml($name)) {
         return;
     }
     $this->findCopies();
     $this->langs = EcrLanguageHelper::discoverLanguages($this);
     if ($this->type == 'component') {
         $this->readMenu();
     }
     $this->readJoomlaXml();
     $this->dbId = $this->getId();
     $this->readDeployFile();
 }