From f6114a93844c45969903e818dedb5fc0f1df9503 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 30 Aug 2022 14:44:24 +0000 Subject: [PATCH] two updates for php7 behavioral change --- codepot/docker/Dockerfile.alpine | 4 ++-- codepot/src/codepot/helpers/codepot_helper.php | 6 +++--- codepot/src/codepot/models/codemodel.php | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/codepot/docker/Dockerfile.alpine b/codepot/docker/Dockerfile.alpine index 7a5fdf0a..04e4a819 100644 --- a/codepot/docker/Dockerfile.alpine +++ b/codepot/docker/Dockerfile.alpine @@ -56,8 +56,8 @@ COPY --from=installer /root/packages/x86_64/apache2-mod-perl-2.0.12-r1.apk /tmp RUN \ apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \ subversion apache2 libldap \ - php7-apache2 php7-gd php7-sqlite3 php7-ldap \ - php7-pdo php7-pdo_sqlite php7-pdo_mysql \ + php7-apache2 php7-gd php7-sqlite3 php7-ldap php7-ctype \ + php7-pdo php7-pdo_sqlite php7-pdo_mysql php7-zip \ apache2-webdav mod_dav_svn \ perl-switch perl-config-simple perl-digest-sha1 \ perl-dbd-sqlite perl-ldap perl-subversion perl-mail-sendmail sqlite bash && \ diff --git a/codepot/src/codepot/helpers/codepot_helper.php b/codepot/src/codepot/helpers/codepot_helper.php index fb80ae7c..299a15f8 100644 --- a/codepot/src/codepot/helpers/codepot_helper.php +++ b/codepot/src/codepot/helpers/codepot_helper.php @@ -221,19 +221,19 @@ if ( !function_exists ('codepot_zip_dir')) if (!is_dir($path)) return FALSE; if (!class_exists('ZipArchive')) return FALSE; - $stack = array (); + $stack = array(); array_push ($stack, $path); $prefix = strlen($path); $zip = new ZipArchive(); - if (@$zip->open ($output_file, ZipArchive::OVERWRITE) === FALSE) return FALSE; + if (@$zip->open($output_file, ZipArchive::OVERWRITE | ZipArchive::CREATE) === FALSE) return FALSE; while (!empty($stack)) { $dir = array_pop($stack); - $d = @opendir ($dir); + $d = @opendir($dir); if ($d === FALSE) continue; $new_path = empty($local_path)? $dir: substr_replace($dir, $local_path, 0, $prefix); diff --git a/codepot/src/codepot/models/codemodel.php b/codepot/src/codepot/models/codemodel.php index fbe71fe6..3fa87e7f 100644 --- a/codepot/src/codepot/models/codemodel.php +++ b/codepot/src/codepot/models/codemodel.php @@ -97,8 +97,7 @@ class CodeModel extends CI_Model } $result = $query->result(); - $num = empty($result)? 0: - isset($result[0]->COUNT)? $result[0]->COUNT: $result[0]->count; + $num = empty($result)? 0: (isset($result[0]->COUNT)? $result[0]->COUNT: $result[0]->count); $this->db->trans_commit(); return $num;