public function packageByDir($dir)
 {
     $dirObj = dir($dir);
     //Enumerate each dir.
     global $_CALEM_conf;
     $list = $_CALEM_conf['calem_cutsom_set'];
     $subsets = array();
     foreach ($list as $idx) {
         $subsets[$idx] = '';
     }
     while (false !== ($file = $dirObj->read())) {
         if (strpos($file, '.') !== false) {
             continue;
         }
         //Special files
         $fullName = $dir . $file . '/';
         if (!is_dir($fullName)) {
             continue;
         }
         $dirHandler = new CalemZipDirectoryJs($fullName, $dir, $subsets, $file, false);
         $dirHandler->package();
     }
 }
Esempio n. 2
0
 /**
  * Update affected pkg file
  */
 public function updateJsPkg($param)
 {
     //Processing each row by iterating the param object.
     foreach ($param as $key => $customObj) {
         $path = $this->getPath($customObj);
         //repackage the file
         $srcDir = $path . $customObj->target . '/';
         $subsets = array($this->getPattern() => '');
         $dirHandler = new CalemZipDirectoryJs($srcDir, $path, $subsets, $customObj->target, false);
         $dirHandler->package();
     }
 }