瀏覽代碼

Merge pull request #1582 from bestlong/php5-fpm-aerospike-build-faile

php-fpm aerospike support php5
Shao Yu-Lung (Allen) 6 年之前
父節點
當前提交
ba1a83b40b
共有 1 個文件被更改,包括 21 次插入7 次删除
  1. 21 7
      php-fpm/Dockerfile

+ 21 - 7
php-fpm/Dockerfile

@@ -267,15 +267,29 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \
     # Fix dependencies for PHPUnit within aerospike extension
     apt-get -y install sudo wget && \
     # Install the php aerospike extension
-    curl -L -o /tmp/aerospike-client-php.tar.gz ${AEROSPIKE_PHP_REPOSITORY} \
+    if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
+      curl -L -o /tmp/aerospike-client-php.tar.gz https://github.com/aerospike/aerospike-client-php5/archive/master.tar.gz; \
+    else \
+      curl -L -o /tmp/aerospike-client-php.tar.gz ${AEROSPIKE_PHP_REPOSITORY}; \
+    fi \
     && mkdir -p aerospike-client-php \
     && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
-    && ( \
-        cd aerospike-client-php/src \
-        && phpize \
-        && ./build.sh \
-        && make install \
-    ) \
+    && \
+    if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
+      ( \
+          cd aerospike-client-php/src/aerospike \
+          && phpize \
+          && ./build.sh \
+          && make install \
+      ) \
+    else \
+      ( \
+          cd aerospike-client-php/src \
+          && phpize \
+          && ./build.sh \
+          && make install \
+      ) \
+    fi \
     && rm /tmp/aerospike-client-php.tar.gz \
     && docker-php-ext-enable aerospike \
 ;fi