From 39ca68b8ad30cd5b5d7dcc8fe80ffcce9fb44746 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 14 Apr 2015 05:16:41 +0000 Subject: [PATCH] added check for ZipArchive availability --- codepot/etc/codepot.ini.in | 1 - codepot/src/codepot/helpers/codepot_helper.php | 5 +++-- codepot/src/codepot/models/subversionmodel.php | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/codepot/etc/codepot.ini.in b/codepot/etc/codepot.ini.in index f55a0a13..793d5f88 100644 --- a/codepot/etc/codepot.ini.in +++ b/codepot/etc/codepot.ini.in @@ -199,7 +199,6 @@ allow_set_time_limit = "no" ;------------------------------------------------------------------------------ signin_for_code_search = "yes" - ;------------------------------------------------------------------------------ ; customized footer ;------------------------------------------------------------------------------ diff --git a/codepot/src/codepot/helpers/codepot_helper.php b/codepot/src/codepot/helpers/codepot_helper.php index 1add5b24..4e6c65d0 100644 --- a/codepot/src/codepot/helpers/codepot_helper.php +++ b/codepot/src/codepot/helpers/codepot_helper.php @@ -151,9 +151,10 @@ if ( !function_exists ('codepot_zip_dir')) // $exclude: file names to exclude. string or array of strings function codepot_zip_dir ($output_file, $path, $local_path = NULL, $exclude = NULL) { - $stack = array (); - if (!is_dir($path)) return FALSE; + if (!class_exists('ZipArchive')) return FALSE; + + $stack = array (); array_push ($stack, $path); $prefix = strlen($path); diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index fa88254e..c959079f 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -1042,7 +1042,6 @@ class SubversionModel extends Model return FALSE; } - //exec ("zip {$tfname}.zip -r {$actual_tfname}"); if (codepot_zip_dir ("{$tfname}.zip", $actual_tfname, $topdir, array('.svn')) === FALSE) { codepot_delete_files ($actual_tfname, TRUE);