Skip to content

Starting new V2 and making it compile on PHP8.1 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ARG VARIANT="8.1-apache-bullseye"

FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT}

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php && php -r "unlink('composer-setup.php');" \
mv composer.phar /bin/composer

ARG CASSANDRA_LIB_VERSION="2.16.2"
RUN apt update -y && apt upgrade -y \
&& apt install python3 pip cmake unzip mlocate build-essential git libuv1-dev libssl-dev libgmp-dev openssl zlib1g-dev libpcre3-dev -y \
&& git clone --recursive https://github.com/datastax/cpp-driver /cpp-driver \
&& cd /cpp-driver \
&& git fetch --tags \
&& git checkout "tags/${CASSANDRA_LIB_VERSION}" -b "v${CASSANDRA_LIB_VERSION}" \
&& mkdir -p /cpp-driver/build \
&& cd build \
&& cmake \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCASS_BUILD_STATIC=OFF \
-DCASS_BUILD_SHARED=ON \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_LIBDIR:PATH=lib \
-DCASS_USE_ZLIB=ON .. \
&& make -j8 && make install \
&& install-php-extensions intl zip pcntl gmp ast xdebug \
&& pip install ccm

RUN apt update -y && apt install clang clang-format libclang-dev -y

# RUN
57 changes: 33 additions & 24 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/docker-existing-dockerfile
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.5/containers/php
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile",
"name": "PHP",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "8.1-bullseye",
"NODE_VERSION": "16",
"CASSANDRA_LIB_VERSION": "2.16.2"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {},

"settings": {
"php.validate.executablePath": "/usr/local/bin/php"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": []
"extensions": [
"felixfbecker.php-debug",
"bmewburn.vscode-intelephense-client",
"mrmlnc.vscode-apache"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
"forwardPorts": [
8080
],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "root",
"features": {
"docker-from-docker": "latest",
"sshd": "latest",
"rust": "latest"
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
/tmp/*
*.ac
.phpunit.result.cache

*.dep
110 changes: 0 additions & 110 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"files.associations": {
"php_driver.h": "c",
"php.h": "c"
}
},
"cmake.configureOnOpen": false
}
8 changes: 7 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": {
"env": {
"LIBS": "-lssl -lz -luv -lm -lgmp -lstdc++",
"LDFLAGS": "-L/usr/local/lib"
}
},
"tasks": [
{
"label": "build",
Expand All @@ -10,7 +16,7 @@
"group": {
"kind": "build",
"isDefault": true
}
},
},
{
"label": "composer install",
Expand Down
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
:warning: **The PHP driver is in maintenance mode. We are still accepting pull-requests and we will occasionally release critical bug fixes, but no ongoing active development is being done currently.**

# DataStax PHP Driver for Apache Cassandra

[![Build Status: Linux](https://travis-ci.org/datastax/php-driver.svg)](https://travis-ci.org/datastax/php-driver)
Expand All @@ -21,7 +19,7 @@ multiple versions of PHP, can be obtained from [DataStax download server]. The
source code is made available via [GitHub]. __If you're using [DataStax Enterprise]
use the [DSE PHP driver] instead__.

__Note__: The driver extension is a wrapper around the
__Note__: The driver extension is a wrapper around the
[DataStax C/C++ Driver for Apache Cassandra] and is a requirement for proper
installation of the PHP extension binaries. Ensure these dependencies are met before proceeding.

Expand All @@ -43,8 +41,8 @@ This driver works exclusively with the Cassandra Query Language v3 (CQL3) and
Cassandra's native protocol. The current version works with:

* Apache Cassandra versions 2.1, 2.2 and 3.0+
* PHP 5.6, PHP 7.0, and PHP 7.1
* 32-bit (x86) and 64-bit (x64)
* PHP >= 8.0
* 64-bit (x64)
* Thread safe (TS) and non-thread safe (NTS)
* Compilers: GCC 4.1.2+, Clang 3.4+, and MSVC 2010/2012/2013/2015

Expand Down Expand Up @@ -109,9 +107,8 @@ For your convenience a `Vagrantfile` with configuration ready for testing is
available. To execute tests, run the following:

```bash
git clone https://github.com/datastax/php-driver.git
git clone --recursive https://github.com/datastax/php-driver.git
cd php-driver
git submodule update --init
vagrant up
vagrant ssh
```
Expand Down
Loading