2 /*********************************************************************************
3 * SugarCRM Community Edition is a customer relationship management program developed by
4 * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Affero General Public License version 3 as published by the
8 * Free Software Foundation with the addition of the following permission added
9 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
18 * You should have received a copy of the GNU Affero General Public License along with
19 * this program; if not, see http://www.gnu.org/licenses or write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26 * The interactive user interfaces in modified source and object code versions
27 * of this program must display Appropriate Legal Notices, as required under
28 * Section 5 of the GNU Affero General Public License version 3.
30 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31 * these Appropriate Legal Notices must retain the display of the "Powered by
32 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33 * technical reasons, the Appropriate Legal Notices must display the words
34 * "Powered by SugarCRM".
35 ********************************************************************************/
37 require_once('modules/ModuleBuilder/MB/MBModule.php');
41 var $is_uninstallable = true;
42 var $description = '';
43 var $has_images = true;
44 var $modules = array();
45 var $date_modified = '';
49 function MBPackage($name){
54 function loadModules($force=false){
55 if(!file_exists(MB_PACKAGE_PATH . '/' . $this->name .'/modules'))return;
56 $d = dir(MB_PACKAGE_PATH . '/' . $this->name .'/modules');
57 while($e = $d->read()){
58 if(substr($e, 0, 1) != '.' && is_dir(MB_PACKAGE_PATH . '/'. $this->name. '/modules/' . $e)){
59 $this->getModule($e, $force);
65 * Loads the translated module titles from the selected language into.
66 * Will override currently loaded string to reflect undeployed label changes.
69 * @param $languge String language identifyer
71 function loadModuleTitles($languge = '')
75 $language = $GLOBALS['current_language'];
77 global $app_list_strings;
78 $packLangFilePath = $this->getPackageDir() . "/language/application/" . $language . ".lang.php";
79 if (file_exists($packLangFilePath))
82 require($packLangFilePath);
86 function getModule($name, $force=true){
87 if(!$force && !empty($this->modules[$name]))return;
88 $path = $this->getPackageDir();
90 $this->modules[$name] = new MBModule($name, $path, $this->name, $this->key);
93 function deleteModule($name){
94 $this->modules[$name]->delete();
95 unset($this->modules[$name]);
98 function getManifest($version_specific = false, $for_export = false){
99 //If we are exporting the package, we must ensure a different install key
100 $pre = $for_export ? MB_EXPORTPREPEND : "";
101 $date = TimeDate::getInstance()->nowDb();
103 $this->description = to_html($this->description);
104 $is_uninstallable = ($this->is_uninstallable ? true : false);
105 if($GLOBALS['sugar_flavor'] == 'CE') {
106 $flavors = array('CE','PRO','ENT');
108 $flavors = array($GLOBALS['sugar_flavor']);
110 $version = (!empty($version_specific))?$GLOBALS['sugar_version']:'';
112 // Build an array and use var_export to build this file
114 array('acceptable_sugar_versions' => array($version)),
115 array('acceptable_sugar_flavors' => $flavors),
116 'readme' => $this->readme,
118 'author' => $this->author,
119 'description' => $this->description,
121 'is_uninstallable' => $is_uninstallable,
122 'name' => $pre.$this->name,
123 'published_date' => $date,
126 'remove_tables' => 'prompt',
131 $header = file_get_contents('modules/ModuleBuilder/MB/header.php');
133 return $header."\n// THIS CONTENT IS GENERATED BY MBPackage.php\n".'$manifest = '.var_export_helper($manifest).";\n\n";
138 'acceptable_sugar_versions' =>
142 'acceptable_sugar_flavors' =>
146 'readme'=>'$this->readme',
148 'author' => '$this->author',
149 'description' => '$this->description',
151 'is_uninstallable' => $is_uninstallable,
152 'name' => '$pre$this->name',
153 'published_date' => '$date',
155 'version' => '$time',
156 'remove_tables' => 'prompt',
162 function buildInstall($path){
163 $installdefs = array ('id' => $this->name,
165 'layoutdefs'=>array(),
166 'relationships'=>array(),
168 if($this->has_images){
169 $installdefs['image_dir'] = '<basepath>/icons';
171 foreach(array_keys($this->modules) as $module){
172 $this->modules[$module]->build($path);
173 $this->modules[$module]->addInstallDefs($installdefs);
175 $this->path = $this->getPackageDir();
176 if(file_exists($this->path . '/language')){
177 $d= dir($this->path . '/language');
178 while($e = $d->read()){
179 $lang_path = $this->path .'/language/' . $e;
180 if(substr($e, 0, 1) != '.' && is_dir($lang_path)){
181 $f = dir($lang_path);
182 while($g = $f->read()){
183 if(substr($g, 0, 1) != '.' && is_file($lang_path.'/'. $g)){
184 $lang = substr($g, 0, strpos($g, '.'));
185 $installdefs['language'][] = array(
186 'from'=> '<basepath>/SugarModules/language/'.$e . '/'. $g,
195 copy_recursive( $this->path . '/language/', $path . '/language/');
196 $icon_path = $path . '/../icons/default/images/';
197 mkdir_recursive($icon_path);
198 copy_recursive($this->path . '/icons/', $icon_path);
200 return "\n".'$installdefs = ' . var_export_helper($installdefs). ';';
204 function getPackageDir(){
205 return MB_PACKAGE_PATH . '/' . $this->name;
208 function getBuildDir(){
209 return MB_PACKAGE_BUILD . '/' . $this->name;
212 function getZipDir(){
213 return $this->getPackageDir() . '/zips';
218 $path = $this->getPackageDir();
219 if(file_exists($path .'/manifest.php')){
220 require($path . '/manifest.php');
221 if(!empty($manifest)){
222 $this->date_modified = $manifest['published_date'];
223 $this->is_uninstallable = $manifest['is_uninstallable'];
224 $this->author = $manifest['author'];
225 $this->key = $manifest['key'];
226 $this->description = $manifest['description'];
227 if(!empty($manifest['readme']))
228 $this->readme = $manifest['readme'];
231 $this->loadModules(true);
235 $path = $this->getPackageDir();
236 if(mkdir_recursive($path)){
237 //Save all the modules when we save a package
238 $this->updateModulesMetaData(true);
239 sugar_file_put_contents_atomic($path .'/manifest.php', $this->getManifest());
243 function build($export=true, $clean = false){
244 $this->loadModules();
245 require_once('include/utils/zip_utils.php');
246 $package_path = $this->getPackageDir();
247 $path = $this->getBuildDir() . '/SugarModules';
248 if($clean && file_exists($path))rmdir_recursive($path);
249 if(mkdir_recursive($path)){
251 $manifest = $this->getManifest().$this->buildInstall($path);
252 $fp = sugar_fopen($this->getBuildDir() .'/manifest.php', 'w');
253 fwrite($fp, $manifest);
257 if(file_exists('modules/ModuleBuilder/MB/LICENSE.txt')){
258 copy('modules/ModuleBuilder/MB/LICENSE.txt', $this->getBuildDir() . '/LICENSE.txt');
259 }else if(file_exists('LICENSE.txt')){
260 copy('LICENSE.txt', $this->getBuildDir() . '/LICENSE.txt');
262 $package_dir = $this->getPackageDir();
263 $date = date('Y_m_d_His');
264 $zipDir = $this->getZipDir();
265 if(!file_exists($zipDir))mkdir_recursive($zipDir);
267 chdir($this->getBuildDir());
268 zip_dir('.',$cwd . '/'. $zipDir. '/'. $this->name. $date. '.zip');
271 header('Location:' . $zipDir. '/'. $this->name. $date. '.zip');
274 'zip'=>$zipDir. '/'. $this->name. $date. '.zip',
275 'manifest'=>$this->getBuildDir(). '/manifest.php',
276 'name'=>$this->name. $date,
282 $this->loadModules();
283 $node = array('name'=>$this->name, 'action'=>'module=ModuleBuilder&action=package&package=' . $this->name, 'children'=>array());
284 foreach(array_keys($this->modules) as $module){
285 $node['children'][] = $this->modules[$module]->getNodes();
290 function populateFromPost(){
291 $this->description = trim($_REQUEST['description']);
292 $this->author = trim($_REQUEST['author']);
293 $this->key = trim($_REQUEST['key']);
294 $this->readme = trim($_REQUEST['readme']);
297 function rename($new_name){
298 $old= $this->getPackageDir();
299 $this->name = $new_name;
300 $new = $this->getPackageDir();
301 if(file_exists($new)){
304 if(rename($old, $new)){
311 function updateModulesMetaData($save=false){
312 foreach(array_keys($this->modules) as $module){
313 $old_name = $this->modules[$module]->key_name;
314 $this->modules[$module]->key_name = $this->key . '_' . $this->modules[$module]->name;
315 $this->modules[$module]->renameMetaData($this->modules[$module]->getModuleDir(), $old_name);
316 $this->modules[$module]->renameLanguageFiles($this->modules[$module]->getModuleDir());
317 if($save)$this->modules[$module]->save();
322 function copy($new_name){
323 $old= $this->getPackageDir();
326 $this->name = $new_name;
327 $new= $this->getPackageDir();
328 while(file_exists($new)){
330 $this->name = $new_name . $count;
331 $new= $this->getPackageDir();
334 $new = $this->getPackageDir();
335 if(copy_recursive($old, $new)){
336 $this->updateModulesMetaData();
344 return rmdir_recursive($this->getPackageDir());
348 //creation of the installdefs[] array for the manifest when exporting customizations
349 function customBuildInstall($modules, $path, $extensions = array()){
350 $columns=$this->getColumnsName();
351 $installdefs = array ('id' => $this->name);
352 $include_path="$path/SugarModules/include/language";
353 if(file_exists($include_path) && is_dir($include_path)){
354 $dd= dir($include_path);
355 while($gg = $dd->read()){
356 if(substr($gg, 0, 1) != '.' && is_file($include_path . '/' . $gg)){
357 $lang = substr($gg, 0, strpos($gg, '.'));
358 $installdefs['language'][] = array(
359 'from'=> '<basepath>/SugarModules/include/language/'. $gg,
360 'to_module'=> 'application',
367 foreach($modules as $value){
368 $custom_module = $this->getCustomModules($value);
369 foreach($custom_module as $va){
370 if ($va == 'language'){
371 $this->getLanguageManifestForModule($value, $installdefs);
372 $this->getCustomFieldsManifestForModule($value, $installdefs);
374 if($va == 'metadata'){
375 $this->getCustomMetadataManifestForModule($value, $installdefs);
379 if (is_dir("$path/Extension"))
381 $this->getExtensionsManifestForPackage($path, $installdefs);
383 return "\n".'$installdefs = ' . var_export_helper($installdefs). ';';
386 private function getLanguageManifestForModule($module, &$installdefs)
388 $lang_path = 'custom/modules/' . $module . '/language';
389 foreach(scandir($lang_path) as $langFile)
391 if(substr($langFile, 0, 1) != '.' && is_file($lang_path . '/' . $langFile)){
392 $lang = substr($langFile, 0, strpos($langFile, '.'));
393 $installdefs['language'][] = array(
394 'from'=> '<basepath>/SugarModules/modules/' . $module . '/language/'. $langFile,
395 'to_module'=> $module,
402 private function getCustomFieldsManifestForModule($module, &$installdefs)
404 $db = DBManagerFactory::getInstance();
405 $result=$db->query("SELECT * FROM fields_meta_data where custom_module='$module'");
406 while($row = $db->fetchByAssoc($result)){
408 foreach($row as $col=>$res){
410 case 'custom_module':
411 $installdefs['custom_fields'][$name]['module'] = $res;
414 $installdefs['custom_fields'][$name]['require_option'] = $res;
417 $installdefs['custom_fields'][$name]['label'] = $res;
420 $installdefs['custom_fields'][$name]['require_option'] = $res;
423 $installdefs['custom_fields'][$name]['mass_update'] = $res;
426 $installdefs['custom_fields'][$name]['comments'] = $res;
429 $installdefs['custom_fields'][$name]['help'] = $res;
432 $installdefs['custom_fields'][$name]['max_size'] = $res;
435 $installdefs['custom_fields'][$name][$col] = $res;
441 private function getCustomMetadataManifestForModule($module, &$installdefs)
443 $meta_path = 'custom/modules/' . $module . '/metadata';
444 foreach(scandir($meta_path) as $meta_file)
446 if(substr($meta_file, 0, 1) != '.' && is_file($meta_path . '/' . $meta_file)){
447 if($meta_file == 'listviewdefs.php'){
448 $installdefs['copy'][] = array(
449 'from'=> '<basepath>/SugarModules/modules/'. $module . '/metadata/'. $meta_file,
450 'to'=> 'custom/modules/'. $module . '/metadata/' . $meta_file,
454 $installdefs['copy'][] = array(
455 'from'=> '<basepath>/SugarModules/modules/'. $module . '/metadata/'. $meta_file,
456 'to'=> 'custom/modules/'. $module . '/metadata/' . $meta_file,
458 $installdefs['copy'][] = array(
459 'from'=> '<basepath>/SugarModules/modules/'. $module . '/metadata/'. $meta_file,
460 'to'=> 'custom/working/modules/'. $module . '/metadata/' . $meta_file,
467 private function getExtensionsManifestForPackage($path, &$installdefs)
469 $extPath = "$path/Extension/modules";
470 foreach(scandir($extPath) as $moduleDir)
472 if(substr($moduleDir, 0, 1) != '.' && is_dir("$extPath/$moduleDir/Ext")){
473 foreach(scandir("$extPath/$moduleDir/Ext") as $type)
475 if(substr($type, 0, 1) != '.' && is_dir("$extPath/$moduleDir/Ext/$type")){
476 foreach(scandir("$extPath/$moduleDir/Ext/$type") as $file)
478 if(substr($file, 0, 1) != '.' && strtolower(substr($file, -4)) == ".php")
480 $installdefs['copy'][] = array(
481 'from'=> "<basepath>/Extension/modules/$moduleDir/Ext/$type/$file",
482 'to'=> "custom/Extension/modules/$moduleDir/Ext/$type/$file",
493 //return an array which contain the name of fields_meta_data table's columns
494 function getColumnsName(){
496 $meta = new FieldsMetaData();
498 foreach($meta->getFieldDefinitions() as $key=>$value) {
505 //creation of the custom fields ZIP file (use getmanifest() and customBuildInstall() )
506 function exportCustom($modules, $export=true, $clean = true){
507 $path=$this->getBuildDir();
508 if($clean && file_exists($path))rmdir_recursive($path);
509 //Copy the custom files to the build dir
510 foreach($modules as $mod){
511 $extensions = $this->getExtensionsList($mod);
512 $pathmod="$path/SugarModules/modules/$mod";
513 if(mkdir_recursive($pathmod)){
514 if(file_exists("custom/modules/$mod")){
515 copy_recursive("custom/modules/$mod", "$pathmod");
516 //Don't include cached extension files
517 if (is_dir("$pathmod/Ext"))
518 rmdir_recursive("$pathmod/Ext");
520 //Convert modstring files to extension compatible arrays
521 $this->convertLangFilesToExtensions("$pathmod/language");
523 $pathext="$path/Extension/modules/$mod/Ext";
524 if (!empty($extensions) && mkdir_recursive($pathext))
526 foreach($extensions as $type => $files)
528 sugar_mkdir("$pathext/$type");
529 foreach($files as $file => $filePath)
531 copy ($filePath, "$pathext/$type/$file");
537 $this->copyCustomDropdownValuesForModules($modules,$path);
538 if(file_exists($path)){
539 $manifest = $this->getManifest(true).$this->customBuildInstall($modules,$path);
540 sugar_file_put_contents($path .'/manifest.php', $manifest);;
542 if(file_exists('modules/ModuleBuilder/MB/LICENSE.txt')){
543 copy('modules/ModuleBuilder/MB/LICENSE.txt', $path . '/LICENSE.txt');
545 else if(file_exists('LICENSE.txt')){
546 copy('LICENSE.txt', $path . '/LICENSE.txt');
548 require_once('include/utils/zip_utils.php');
549 $date = date('Y_m_d_His');
550 $zipDir = $this->getZipDir();
551 if(!file_exists($zipDir))mkdir_recursive($zipDir);
553 chdir($this->getBuildDir());
554 zip_dir('.',$cwd . '/'. $zipDir. '/'. $this->name. $date. '.zip');
556 if($clean && file_exists($this->getBuildDir()))rmdir_recursive($this->getBuildDir());
558 header('Location:' . $zipDir. '/'. $this->name. $date. '.zip');
560 return $zipDir. '/'. $this->name. $date. '.zip';
563 private function convertLangFilesToExtensions($langDir)
565 if (is_dir($langDir))
567 foreach(scandir($langDir) as $langFile)
569 $mod_strings = array();
570 if (strcasecmp(substr($langFile, -4), ".php") != 0)
572 include("$langDir/$langFile");
573 $out = "<?php \n // created: " . date('Y-m-d H:i:s') . "\n";
574 foreach($mod_strings as $lbl_key => $lbl_val )
576 $out .= override_value_to_string("mod_strings", $lbl_key, $lbl_val) . "\n";
579 sugar_file_put_contents("$langDir/$langFile", $out);
583 private function copyCustomDropdownValuesForModules($modules, $path)
585 if(file_exists("custom/include/language")){
586 if(mkdir_recursive("$path/SugarModules/include")){
587 global $app_list_strings;
588 $backStrings = $app_list_strings;
589 foreach(scandir("custom/include/language") as $langFile)
591 $app_list_strings = array();
592 if (strcasecmp(substr($langFile, -4), ".php") != 0)
594 include("custom/include/language/$langFile");
596 $lang = substr($langFile, 0, -9);
597 $options = $this->getCustomDropDownStringsForModules($modules, $app_list_strings);
598 foreach($options as $name => $arr) {
599 $out .= override_value_to_string('app_list_strings', $name, $arr);
601 mkdir_recursive("$path/SugarModules/include/language/");
602 sugar_file_put_contents("$path/SugarModules/include/language/$lang.$this->name.php", $out);
604 $app_list_strings = $backStrings;
609 function getCustomDropDownStringsForModules($modules, $list_strings) {
610 global $beanList, $beanFiles;
612 foreach($modules as $module)
614 if (!empty($beanList[$module]))
616 require_once($beanFiles[$beanList[$module]]);
617 $bean = new $beanList[$module]();
618 foreach($bean->field_defs as $field => $def)
620 if (isset($def['options']) && isset($list_strings[$def['options']]))
622 $options[$def['options']] = $list_strings[$def['options']];
632 //if $module=false : return an array with custom module and there customizations.
633 //if $module=!false : return an array with the directories of custom/module/$module.
634 function getCustomModules($module=false){
636 $path='custom/modules/';
637 $extPath = 'custom/Extension/modules/';
638 if(!file_exists($path) || !is_dir($path)){
639 return array($mod_strings['LBL_EC_NOCUSTOM'] => "");
642 if ($module != false ){
643 $path=$path . $module . '/';
645 $scanlisting = scandir($path);
646 $dirlisting = array();
647 foreach ($scanlisting as $value){
648 if(is_dir($path . $value) == true && $value != '.' && $value != '..') {
649 $dirlisting[] = $value;
652 if(empty($dirlisting)){
653 return array($mod_strings['LBL_EC_NOCUSTOM'] => "");
655 if ($module == false ){
656 foreach ($dirlisting as $value){
657 if(!file_exists('modules/' . $value . '/metadata/studio.php'))
659 $custommodules[$value]=$this->getCustomModules($value);
660 foreach ($custommodules[$value] as $va){
663 $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMFIELD'];
666 $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMLAYOUT'];
670 $return[$value][$va] = $mod_strings['LBL_EC_CUSTOMFIELD'];
673 $return[$value . " " . $mod_strings['LBL_EC_EMPTYCUSTOM']] = "";
676 $return[$value][$va] = $mod_strings['LBL_UNDEFINED'];
688 private function getExtensionsList($module, $excludeRelationships = true)
690 require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php' ;
691 $extPath = 'custom/Extension/modules/';
692 $modExtPath = $extPath . $module . '/Ext';
693 $rels = new DeployedRelationships($module);
694 $relList = $rels->getRelationshipList ();
697 if (is_dir($modExtPath))
699 $extFolders = scandir($modExtPath);
700 foreach($extFolders as $extFolder)
702 if (!is_dir("$modExtPath/$extFolder") || substr($extFolder, 0, 1) == ".")
705 foreach( scandir("$modExtPath/$extFolder") as $extFile)
708 if (substr($extFile, 0, 1) == "." || strtolower(substr($extFile, -4)) != ".php")
710 //Exclude relattionship extension files
711 if ($excludeRelationships && (
712 (substr($extFile, 0, 6) == "custom" && isset($relList[substr($extFile, 6, strlen($extFile) - 10)])) ||
713 (substr($extFile, 6, 6) == "custom" && isset($relList[substr($extFile, 12, strlen($extFile) - 16)]))
718 if (!isset($ret[$extFolder]))
719 $ret[$extFolder] = array();
721 $ret[$extFolder][$extFile ] = "$modExtPath/$extFolder/$extFile";
729 * Returns a set of field defs for fields that will exist when this package is deployed
730 * based on the relationships in all of its modules.
732 * @param $moduleName (module must be from whithin this package)
733 * @return array Field defs
735 function getRelationshipsForModule($moduleName) {
737 if (isset($this->modules[$moduleName])) {
738 $keyName = $this->modules[$moduleName]->key_name;
739 foreach($this->modules as $mName => $module) {
740 $rels = $module->getRelationships();
741 $relList = $rels->getRelationshipList();
742 foreach($relList as $rName ) {
743 $rel = $rels->get ( $rName ) ;
744 if ($rel->lhs_module == $keyName || $rel->rhs_module == $keyName) {
755 function exportProjectInstall($package, $for_export){
756 $pre = $for_export ? MB_EXPORTPREPEND : "";
757 $installdefs = array ('id' => $pre . $this->name);
758 $installdefs['copy'][] = array(
759 'from'=> '<basepath>/' . $this->name,
760 'to'=> 'custom/modulebuilder/packages/'. $this->name,
762 return "\n".'$installdefs = ' . var_export_helper($installdefs). ';';
768 function exportProject($package, $export=true, $clean = true){
769 $tmppath="custom/modulebuilder/projectTMP/";
770 if(file_exists($this->getPackageDir())){
771 if(mkdir_recursive($tmppath)){
772 copy_recursive($this->getPackageDir(), $tmppath ."/". $this->name);
773 $manifest = $this->getManifest(true, $export).$this->exportProjectInstall($package, $export);
774 $fp = sugar_fopen($tmppath .'/manifest.php', 'w');
775 fwrite($fp, $manifest);
777 if(file_exists('modules/ModuleBuilder/MB/LICENSE.txt')){
778 copy('modules/ModuleBuilder/MB/LICENSE.txt', $tmppath . '/LICENSE.txt');
780 else if(file_exists('LICENSE.txt')){
781 copy('LICENSE.txt', $tmppath . '/LICENSE.txt');
783 $readme_contents = $this->readme;
784 $readmefp = sugar_fopen($tmppath.'/README.txt','w');
785 fwrite($readmefp, $readme_contents);
789 require_once('include/utils/zip_utils.php');
790 $date = date('Y_m_d_His');
791 $zipDir = "custom/modulebuilder/packages/ExportProjectZips";
792 if(!file_exists($zipDir))mkdir_recursive($zipDir);
795 zip_dir('.',$cwd . '/'. $zipDir. '/project_'. $this->name. $date. '.zip');
797 if($clean && file_exists($tmppath))rmdir_recursive($tmppath);
799 header('Location:' . $zipDir. '/project_'. $this->name. $date. '.zip');
801 return $zipDir. '/project_'. $this->name. $date. '.zip';