Skip to content

Commit e8e9ebc

Browse files
Merge pull request #15 from klimslim/BR-8634
[BR-8634] – update basedir for PHP 8.0
2 parents 748f983 + 8c562e1 commit e8e9ebc

File tree

5 files changed

+56
-12
lines changed

5 files changed

+56
-12
lines changed

.travis.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
language: php
22
sudo: yes
3-
dist: trusty
3+
dist: bionic
44

55
env:
6-
- PHPVER="5.4.29"
7-
- PHPVER="5.6.26"
8-
- PHPVER="7.0.14"
9-
- PHPVER="7.1.0"
6+
- PHPVER="7.3.14"
7+
- PHPVER="7.4.2"
8+
- PHPVER="8.0.0"
109

1110
# This replaces the travis supplied phpbuild which defaults to ZTS enabled
1211
# builds. Since we are replacing using the same config, we don't have to add
@@ -15,10 +14,9 @@ install:
1514
- rm -rf ~/.phpenv
1615
- sudo apt-get clean
1716
- sudo apt-get update
18-
- sudo apt-get purge --auto-remove mysql-client-5.6 mysql-client-core-5.6 mysql-server-5.6 mysql-server-core-5.6
17+
- sudo apt-get purge --auto-remove mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7
1918
- sudo rm -rf /var/lib/mysql
20-
- sudo apt-get build-dep php5
21-
- sudo apt-get install git libmcrypt-dev libreadline-dev
19+
- sudo apt-get install libzip-dev libonig-dev
2220
- curl -L http://git.io/phpenv-installer | bash
2321
- travis_wait phpenv install "${PHPVER}"
2422
- phpenv global "${PHPVER}"

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM amazonlinux:2
2+
3+
ARG PHP_BUILD_DIR=/var/task
4+
ARG PHP_CONF_DIR=/etc/php.d
5+
ARG PHP_EXT_DIR=/usr/lib64/php/modules
6+
7+
RUN yum clean all && \
8+
yum -y upgrade && \
9+
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
10+
https://rpms.remirepo.net/enterprise/remi-release-7.rpm \
11+
re2c \
12+
yum-utils && \
13+
yum-config-manager --disable remi-safe && \
14+
yum-config-manager --enable remi-php80 && \
15+
yum-config-manager --setopt=remi-php80.priority=10 --save && \
16+
yum -y install php-cli php-common php-devel && \
17+
yum clean all
18+
19+
#Extension install
20+
RUN mkdir -p ${PHP_EXT_DIR} && mkdir -p ${PHP_CONF_DIR}
21+
22+
#basedir
23+
RUN mkdir -p ${PHP_BUILD_DIR}
24+
RUN cd ${PHP_BUILD_DIR} && \
25+
mkdir basedir
26+
COPY basedir.c basedir/
27+
COPY cache.php basedir/
28+
COPY config.m4 basedir/
29+
COPY php_basedir.h basedir/
30+
COPY tests basedir/
31+
RUN cd basedir && \
32+
phpize && \
33+
./configure && \
34+
make && \
35+
make install && \
36+
make test && \
37+
echo "extension=${PHP_EXT_DIR}/basedir.so" > ${PHP_CONF_DIR}/basedir.ini
38+
39+
ENTRYPOINT ["/usr/bin/php", "--ri", "basedir"]

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SugarCRM Basedir
2-
2+
Build Status
3+
------------
4+
[![Build Status](https://app.travis-ci.com/sugarcrm/basedir.svg?branch=master)](https://app.travis-ci.com/sugarcrm/basedir)
35
## Description
46

57
The SugarCRM Basedir extension allows you to take take advantage of
@@ -17,6 +19,11 @@ The basedir module also keeps realpath cache enabled. Realpath cache is normall
1719
make
1820
make install
1921

22+
## Building in docker
23+
24+
docker build -t basedir .
25+
docker run basedir:latest
26+
2027
## Configuration Documentation
2128

2229
| Parameter | Description |

basedir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ PHP_RINIT_FUNCTION(basedir)
211211

212212
strcpy(new_basedir, SG(request_info).path_translated);
213213

214-
char *path_info = sapi_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC);
214+
char *path_info = sapi_getenv("PATH_INFO", sizeof("PATH_INFO")-1);
215215

216216
calculate_basedir(SG(request_info).path_translated, SG(request_info).request_uri, path_info, BASEDIR_G(basedir_uri_component), new_basedir);
217217

@@ -254,7 +254,7 @@ static PHP_FUNCTION(basedir_calculate)
254254
size_t path_len, uri_len, path_info_len, component_len;
255255
#endif
256256

257-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &path, &path_len, &uri, &uri_len, &path_info, &path_info_len, &component, &component_len) == FAILURE) {
257+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssss", &path, &path_len, &uri, &uri_len, &path_info, &path_info_len, &component, &component_len) == FAILURE) {
258258
return;
259259
}
260260

php_basedir.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
extern zend_module_entry basedir_module_entry;
1212
#define phpext_basedir_ptr &basedir_module_entry
1313

14-
#define PHP_BASEDIR_VERSION "0.1.0"
14+
#define PHP_BASEDIR_VERSION "1.0.0"
1515

1616
#ifdef PHP_WIN32
1717
# define PHP_BASEDIR_API __declspec(dllexport)

0 commit comments

Comments
 (0)