diff --git a/README.md b/README.md index 689f50d06..8c043f53b 100644 --- a/README.md +++ b/README.md @@ -1,161 +1,396 @@ -: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.** +# PHP Driver for Apache Cassandra (Fork) -# DataStax PHP Driver for Apache Cassandra +[![GitHub license](https://img.shields.io/github/license/maximeetundi/php-cassandra-driver)](https://github.com/maximeetundi/php-cassandra-driver/blob/main/LICENSE) +[![PHP Version](https://img.shields.io/badge/php-8.3%2B-blue.svg)](https://www.php.net/) -[![Build Status: Linux](https://travis-ci.org/datastax/php-driver.svg)](https://travis-ci.org/datastax/php-driver) -[![Build Status: Windows](https://ci.appveyor.com/api/projects/status/8vrxpkfl4xm2f3nm?svg=true)](https://ci.appveyor.com/project/DataStax/php-driver) +Fork maintenu du driver PHP pour Apache Cassandra avec support de PHP 8.3+. -A modern, [feature-rich][Features] and highly tunable PHP client library for -[Apache Cassandra] 2.1+ using exclusively Cassandra's binary protocol and -Cassandra Query Language v3. __Use the [DSE PHP driver] for better compatibility -and support for [DataStax Enterprise]__. +Ce fork est basé sur le driver officiel DataStax PHP Driver pour Apache Cassandra, avec des mises à jour de compatibilité pour PHP 8.3+. -This is a wrapper around the [DataStax C/C++ Driver for Apache Cassandra]. +## Fonctionnalités -__Note__: DataStax products do not support big-endian systems. +- Support complet de PHP 8.3+ +- Compatible avec Apache Cassandra 2.1+ +- Utilisation du protocole binaire natif de Cassandra +- Support complet de CQL v3 +- Haute performance et faible empreinte mémoire +- Support des types de données avancés de Cassandra +- Gestion des requêtes asynchrones +- Support de la pagination +- Gestion des transactions par lot (batch) +- Support SSL/TLS pour les connexions sécurisées -## Getting the Driver +## Prérequis -Binary versions of the driver, available for multiple operating systems and -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__. +- PHP 8.3+ (version Thread Safe recommandée) +- Extension PHP JSON +- Bibliothèque C/C++ DataStax pour Apache Cassandra (inclus dans le dépôt) +- Extensions PHP requises : + - SPL + - JSON + - OpenSSL (pour le support SSL/TLS) -__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. +## Installation + +### Depuis les sources + +```bash +git clone https://github.com/maximeetundi/php-cassandra-driver.git +cd php-cassandra-driver +``` + +### Compilation + +#### Sous Windows + +1. Installez les dépendances : + - Visual Studio 2019 ou supérieur avec les outils de développement C++ + - CMake 3.10 ou supérieur + - PHP 8.3+ (version TS - Thread Safe) + - Outils de développement PHP (SDK) + +2. Ouvrez une invite de commande développeur Visual Studio (x64 Native Tools Command Prompt) + +3. Compilez le projet : + ```bash + mkdir build + cd build + cmake -G "Visual Studio 17 2022" -A x64 .. + cmake --build . --config Release + ``` + +4. Installation : + - Copiez le fichier `build/Release/php_cassandra.dll` dans votre répertoire d'extensions PHP + - Ajoutez `extension=php_cassandra.dll` à votre fichier `php.ini` + - Redémarrez votre serveur web si nécessaire + +#### Sous Linux/macOS + +1. Installation des dépendances requises : + +```bash +# Sur Debian/Ubuntu : +sudo apt-get install php8.3-dev cmake g++ libssl-dev libuv1-dev zlib1g-dev -## What's new in v1.2.0/v1.3.0 +# Sur CentOS/RHEL : +sudo yum install php83-php-devel cmake gcc-c++ openssl-devel libuv-devel zlib-devel +``` + +2. Compilation et installation automatique avec le script : + +```bash +cd ext +./install.sh +``` -* Support for [`duration`] -* `Session::execute()` and `Session::executeAsync()` now support a - [simple string] for the query CQL and a simple array for the query execution - option -* Full support for Apache Cassandra 2.2 and 3.0+ -* Support for [`tinyint` and `smallint`] -* Support for [`date`] and [`time`] -* Support for [user-defined function and aggregate] metadata -* Support for [secondary index] and [materialized view] metadata +3. Vérifiez que l'extension est correctement installée : -## Compatibility +```bash +php -m | grep cassandra +``` -This driver works exclusively with the Cassandra Query Language v3 (CQL3) and -Cassandra's native protocol. The current version works with: +4. Si vous rencontrez des erreurs de compilation liées à PHP 8.3, vous devrez peut-être appliquer des correctifs de compatibilité : -* 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) - * Thread safe (TS) and non-thread safe (NTS) -* Compilers: GCC 4.1.2+, Clang 3.4+, and MSVC 2010/2012/2013/2015 +```bash +# Correction des problèmes de compatibilité avec PHP 8.3 +# Exemple pour le fichier Blob.c +sed -i 's/zend_std_get_properties(object TSRMLS_CC)/zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC)/g' ext/src/Blob.c +sed -i 's/zend_object_std_dtor(&self->zval TSRMLS_CC)/zend_object_std_dtor(object TSRMLS_CC)/g' ext/src/Blob.c + +# Puis relancez la compilation +./install.sh +``` + +### Installation manuelle des dépendances + +Si vous préférez compiler manuellement les dépendances : + +```bash +# Clonez le dépôt +git clone https://github.com/maximeetundi/php-cassandra-driver.git +cd php-cassandra-driver + +# Compilation de la bibliothèque C++ DataStax +mkdir -p lib/cpp-driver/build +cd lib/cpp-driver/build +cmake -DCMAKE_CXX_FLAGS="-fPIC" -DCASS_BUILD_STATIC=ON -DCASS_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCASS_USE_ZLIB=ON .. +make +cd ../../../ + +# Compilation de l'extension PHP +cd ext +phpize +LIBS="-lssl -lcrypto -lz -luv -lm -lstdc++" ./configure --with-cassandra=../lib/cpp-driver/build +make +sudo make install +``` -If using [DataStax Enterprise] the [DSE PHP driver] provides more features and -better compatibility. +### Installation binaire (une commande, sans compilation) -## Documentation +Des binaires précompilés peuvent être fournis via les Releases GitHub. Utilisez les scripts suivants pour installer automatiquement le bon binaire selon votre OS, architecture et version de PHP. -* [Home] -* [API] -* [Features] +- Linux/macOS: + ```bash + curl -fsSL https://raw.githubusercontent.com/maximeetundi/php-cassandra-driver/main/scripts/install-binary.sh | bash + # ou + wget -qO- https://raw.githubusercontent.com/maximeetundi/php-cassandra-driver/main/scripts/install-binary.sh | bash + ``` -## Getting Help +- Windows (PowerShell): + ```powershell + irm https://raw.githubusercontent.com/maximeetundi/php-cassandra-driver/main/scripts/install-binary.ps1 | iex + ``` -* JIRA: https://datastax-oss.atlassian.net/browse/PHP -* Mailing List: https://groups.google.com/a/lists.datastax.com/forum/#!forum/php-driver-user -* DataStax Academy via Slack: https://academy.datastax.com/slack +Ces scripts: -## Quick Start +- détectent `extension_dir` et `php.ini` +- téléchargent l’asset correspondant à votre plateforme depuis la dernière Release +- installent `cassandra.so` (Linux/macOS) ou `php_cassandra.dll` (Windows) +- ajoutent l’entrée `extension=` dans `php.ini` si nécessaire + +Schéma de nommage attendu des assets Release: + +- Linux: `cassandra-linux--php-.so` +- macOS: `cassandra-macos--php-.so` +- Windows: `php_cassandra-windows--php-.dll` + +Exemples: + +- `cassandra-linux-x86_64-php83-nts.so` +- `cassandra-macos-arm64-php83-nts.so` +- `php_cassandra-windows-x86_64-php83-ts.dll` + +Validation: + +```bash +php -m | grep -i cassandra +``` + +## Configuration + +Ajoutez la configuration suivante à votre `php.ini` : + +```ini +[cassandra] +; Chemin vers le fichier de certificat CA (optionnel) +; cassandra.certfile= + +; Chemin vers le fichier de clé privée (optionnel) +; cassandra.privatekeyfile= + +; Chemin vers le fichier de certificat (optionnel) +; cassandra.certfile= + +; Délai d'expiration par défaut en secondes (optionnel, défaut: 30) +; cassandra.default_timeout=30 +``` + +## Utilisation de base ```php build(); -$keyspace = 'system'; -$session = $cluster->connect($keyspace); // create session, optionally scoped to a keyspace -$statement = new Cassandra\SimpleStatement( // also supports prepared and batch statements - 'SELECT keyspace_name, columnfamily_name FROM schema_columnfamilies' -); -$future = $session->executeAsync($statement); // fully asynchronous and easy parallel execution -$result = $future->get(); // wait for the result, with an optional timeout - -foreach ($result as $row) { // results and rows implement Iterator, Countable and ArrayAccess - printf("The keyspace %s has a table called %s\n", $row['keyspace_name'], $row['columnfamily_name']); +// Construction via les classes Builder (API PHP 8.3+) +$builder = new Cassandra\Cluster\Builder(); +$builder->withContactPoints('127.0.0.1'); +$cluster = $builder->build(); + +$session = $cluster->connect('system_schema'); +$statement = new Cassandra\SimpleStatement('SELECT keyspace_name, replication FROM system_schema.keyspaces'); +$result = $session->execute($statement); + +foreach ($result as $row) { + printf("%-30s %s\n", $row['keyspace_name'], $row['replication']); } + +// Recommandé: fermer proprement la session en fin de script +if (method_exists($session, 'close')) { + $session->close(); +} +?> ``` -## Installation +## Connexion CloudClusters (SSL + Auth) + +Exemple minimal avec certificats client et authentification utilisateur/mot de passe. Les chemins pointent vers les fichiers du dossier `cloudclustersio/cassandra/` du dépôt. + +```php +$host = 'cassandra-XXXXXX-0.cloudclusters.net'; +$port = 10014; // adapté à votre instance + +$certPath = __DIR__ . '/cloudclustersio/cassandra/user.cer.pem'; +$keyPath = __DIR__ . '/cloudclustersio/cassandra/user.key.pem'; + +$username = getenv('CASSANDRA_USERNAME') ?: 'admin'; // ou définissez via votre CI/terminal +$password = getenv('CASSANDRA_PASSWORD') ?: ''; + +$sslBuilder = new Cassandra\SSLOptions\Builder(); +$sslBuilder->withClientCert($certPath); +$sslBuilder->withPrivateKey($keyPath); +// Si un CA dédié est fourni par le provider: +// $sslBuilder->withTrustedCerts(__DIR__ . '/cloudclustersio/cassandra/ca.pem'); +$ssl = $sslBuilder->build(); + +$builder = new Cassandra\Cluster\Builder(); +$builder->withContactPoints($host); +$builder->withPort($port); +$builder->withSSL($ssl); +$builder->withCredentials($username, $password); +$cluster = $builder->build(); + +$session = $cluster->connect(); +echo "OK connecté\n"; + +// ... vos requêtes ... + +if (method_exists($session, 'close')) { + $session->close(); +} +``` +# Installation de l’extension PHP Cassandra (build statique) + +Ce projet fournit un build **précompilé** de l’extension PHP Cassandra pour **PHP 8.3 (amd64, Linux/Ubuntu)**. +Vous n’avez donc **pas besoin de recompiler** le driver C/C++ DataStax ni l’extension. + +--- + +## 📦 Prérequis + +Assurez-vous d’avoir installé les dépendances système suivantes : + +```bash +sudo apt-get update +sudo apt-get install -y libuv1 libssl3 zlib1g libstdc++6 libgmp10 +``` + +--- + +## ⚡ Installation + +1. **Cloner le projet** : + +```bash +git clone https://github.com/maximeetundi/php-cassandra.git +cd php-cassandra/build-static/linux_amd64 +``` + +2. **Trouver le dossier des extensions PHP** (il varie selon la version de PHP installée, par exemple `/usr/lib/php/20230831/`) : ```bash -pecl install cassandra +php -i | grep ^extension_dir ``` -[Read detailed instructions on building and installing the -extension][installing-details] +Exemple de sortie : +``` +extension_dir => /usr/lib/php/20230831 => /usr/lib/php/20230831 +``` -## Contributing +3. **Copier le module compilé (`cassandra.so`) dans ce dossier** : -[Read our contribution policy][contribution-policy] for a detailed description -of the process. +```bash +EXT_DIR=$(php -i | grep ^extension_dir | awk '{print $3}') +sudo cp cassandra.so $EXT_DIR/ +``` -## Code examples +4. **Créer le fichier de configuration de l’extension** : -The DataStax PHP Driver uses the amazing [Behat Framework] for both end-to-end, -or acceptance testing and documentation. All of the features supported by the -driver have appropriate acceptance tests with [easy-to-copy code examples in -the `features/` directory][Features]. +```bash +echo "extension=cassandra.so" | sudo tee /etc/php/8.3/mods-available/cassandra.ini +``` + +5. **Activer l’extension** : -## Running tests +```bash +sudo phpenmod cassandra +``` -For your convenience a `Vagrantfile` with configuration ready for testing is -available. To execute tests, run the following: +6. **Redémarrer PHP (Apache ou PHP-FPM selon votre configuration)** : ```bash -git clone https://github.com/datastax/php-driver.git -cd php-driver -git submodule update --init -vagrant up -vagrant ssh +# Si vous utilisez Apache : +sudo systemctl restart apache2 + +# Si vous utilisez PHP-FPM : +sudo systemctl restart php8.3-fpm ``` -Once you've logged in to the vagrant VM, run: +--- + +## ✅ Vérification + +Exécutez la commande suivante pour vérifier que l’extension est bien installée : ```bash -cd /usr/local/src/php-driver -./bin/behat -./bin/phpunit +php -m | grep cassandra ``` -## Copyright +Vous devriez voir : + +``` +cassandra +``` + +--- + +## 🧪 Test rapide + +Créez un fichier `test.php` : + +```php +close(); }`. + - Utilisez la dernière version de ce fork (compatibilité PHP 8.3). + - Ouvrez une issue avec version PHP, version de l'extension et la sortie d'erreur si le problème persiste. + +## Documentation complète + +Consultez la [documentation officielle](https://docs.datastax.com/en/developer/php-driver/latest/) pour des exemples d'utilisation avancés et la référence complète de l'API. + +## Contribution + +Les contributions sont les bienvenues ! Voici comment contribuer : + +1. Forkez le dépôt +2. Créez une branche pour votre fonctionnalité (`git checkout -b feature/ma-nouvelle-fonctionnalite`) +3. Committez vos changements (`git commit -am 'Ajout d\'une nouvelle fonctionnalité'`) +4. Poussez vers la branche (`git push origin feature/ma-nouvelle-fonctionnalite`) +5. Créez une Pull Request + +## Licence -© DataStax, Inc. +Ce projet est sous licence Apache 2.0. Voir le fichier [LICENSE](LICENSE) pour plus de détails. -Licensed under the Apache License, Version 2.0 (the “License”); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at +## Remerciements -http://www.apache.org/licenses/LICENSE-2.0 +Ce fork est basé sur le travail de l'équipe DataStax et des contributeurs du projet original. Un grand merci à tous ceux qui ont contribué au développement et à l'amélioration de ce driver. -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. +## Support -[Apache Cassandra]: http://cassandra.apache.org -[DSE PHP driver]: http://docs.datastax.com/en/developer/php-driver-dse/latest -[DataStax Enterprise]: http://www.datastax.com/products/datastax-enterprise -[DataStax C/C++ Driver for Apache Cassandra]: http://docs.datastax.com/en/developer/cpp-driver/latest -[DataStax download server]: http://downloads.datastax.com/php-driver -[GitHub]: https://github.com/datastax/php-driver -[Home]: http://docs.datastax.com/en/developer/php-driver/latest -[API]: http://docs.datastax.com/en/developer/php-driver/latest/api -[installing-details]: https://github.com/datastax/php-driver/blob/master/ext/README.md -[contribution-policy]: https://github.com/datastax/php-driver/blob/master/CONTRIBUTING.md -[Behat Framework]: http://docs.behat.org -[Features]: /features -[`duration`]: /features/duration.feature -[simple string]: /features/simple_string_queries.feature -[`tinyint` and `smallint`]: /features/datatypes.feature#L92 -[`date`]: /features/datatypes.feature#L135 -[`time`]: /features/datatypes.feature#L170 -[user-defined function and aggregate]: /features/function_and_aggregate_metadata.feature -[secondary index]: /features/secondary_index_metadata.feature -[materialized view]: /features/materialized_view_metadata.feature +Pour les problèmes et les demandes de fonctionnalités, veuillez ouvrir un ticket sur [GitHub Issues](https://github.com/maximeetundi/php-cassandra-driver/issues). diff --git a/Rakefile b/Rakefile old mode 100755 new mode 100644 diff --git a/build-static/linux_amd64/cassandra.so b/build-static/linux_amd64/cassandra.so new file mode 100755 index 000000000..24314eec1 Binary files /dev/null and b/build-static/linux_amd64/cassandra.so differ diff --git a/cloudclustersio/cassandra/user.cer.pem b/cloudclustersio/cassandra/user.cer.pem new file mode 100644 index 000000000..89389c9ed --- /dev/null +++ b/cloudclustersio/cassandra/user.cer.pem @@ -0,0 +1,48 @@ +Bag Attributes + friendlyName: node02 + localKeyID: 54 69 6D 65 20 31 37 35 36 35 36 31 35 33 35 30 36 38 +subject=/C=US/O=CCS/OU=CassandraCluster/CN=US +issuer=/CN=US/OU=CassandraCluster/O=CCS/C=US +-----BEGIN CERTIFICATE----- +MIIDAjCCAeoCCQDc+8X/xR8VOTANBgkqhkiG9w0BAQsFADBDMQswCQYDVQQDDAJV +UzEZMBcGA1UECwwQQ2Fzc2FuZHJhQ2x1c3RlcjEMMAoGA1UECgwDQ0NTMQswCQYD +VQQGEwJVUzAeFw0yNTA4Mz4MzA5MDdaFw0zNTA4MjgxMzA5MDdaMEMxCzAJBgNV +BAYTAlVTMQwwCgYDVQQKEwNDQ1MxGTAXBgNVBAsTEENhc3NhbmRyYUNsdXN0ZXIx +CzAJBgNVBAMTAlVTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsD4p +aToO3XvGQEjpUpt12f82AwsYHaz9q71mmPyA/7EWxY4ybHVdaNKpYUwtCqTl8wRu +X9klNgI4qbU8rEyG+rWaZG3dJ56f4uvkOJQExHYjPlDApR8xF18CDevUM9YjcBH7 +UxufkhkNHIPrFiwLvHnvmUOfsDhBhWy6WaWHsSTCO2WW0hnEWAJjL+MUkwJo6NTW +hkWgM19HwBTadZS1FtL6cNFZeRRMGclp2mZ46iTJlF1n7eD2IXrcCWoPKPvJrS2a +chtKE14KlLep5F+p+vNSTX0s5a0uuPRvIFoIYPl1/I4W27JBzprr+hK/26nZrSZl +JUj9OFMYvdgMipiojwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAgXR+hO8t4yCl5 +wNlTkSzrGf7SgNmkdwIIfSte3qkt7rnkCeP24KkhoIKO3w6vx8wztxCD/jD5CQDw +PMhEcIXfkOZisPSw3iulK/BLCDdPjQOcjiHai9X2BzaWTJpIkykotxUjGcoBso55 +wI6g/CjXhyk9TAWZBmf8ZJETO8ZbcTONBYrubojXLZsGWBK+KY26sVE9KuRntcyQ +eJK8Yl1Ga0TeAwr0vOfAuHKRONk4yZFDev0valAz5owus8uRJiVrq8R49QqmI/o0 +9AV5oCvRvLyiT+1XuoKS7MrJfISnUNHOLZMTVvTvebxvfUB0q9RJ+7y03lHGp8Qx +ZD8xdM11 +-----END CERTIFICATE----- +Bag Attributes + friendlyName: C=US,O=CCS,OU=CassandraCluster,CN=US +subject=/CN=US/OU=CassandraCluster/O=CCS/C=US +issuer=/CN=US/OU=CassandraCluster/O=CCS/C=US +-----BEGIN CERTIFICATE----- +MIIDWTCCAkGgAwIBAgIJAOg4rJcMC8RjMA0GCSqGSIb3DQEBCwUAMEMxCzAJBgNV +BAMMAlVTMRkwFwYDVQQLDBBDYXNzYW5kcmFDbHVzdGVyMQwwCgYDVQQKDANDQ1Mx +CzAJBgNVBAYTAlVTMB4XDTI1MDgzMDEzMDkwN1oXDTM1MDgyODEzMDkwN1owQzEL +MAkGA1UEAwwCVVMxGTAXBgNVBAsMEENhc3NhbmRyYUNsdXN0ZXIxDDAKBgNVBAoM +A0NDUzELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCjLhkPd43OMTJTTE/ZnKWEH9K4GnY7/3UCfo0yRCIY6DJv/fCNVQLSRRmH2NGh +s5WYYHT9WowunPiXaHaU/OF3MdeFia8bl6ndj9SCxLihRUilLy4skC5unOpY55c1 +6Nxn3fVmQhVhNu/0Sak+4xMUtSBOiUyXpfAkPeFskpwMzq5f06v3GC+jKpd2hlKY +bKo2SCOoD4oLSnlBQ2d+0oH0/C0ngJAKpkx3WBNfSidY21PKTTt/D4r7dLJIPds8 +yKXmundxj9+tsp5EbY6IZcA+ghuFfFc/aFRGt8+hnbjCLx0JOoZUDUu5a6t0OL/p +2QHy9nitRw9xV2NBq9AoVgWtAgMBAAGjUDBOMB0GA1UdDgQWBBSm87Z4zM8a6IY2 +C2uKhu31Mxz5ETAfBgNVHSMEGDAWgBSm87Z4zM8a6IY2C2uKhu31Mxz5ETAMBgNV +HRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQB/JVwfsXYfLhEQC5v3jgp0KyPv +AuoQcMfs8YnGlFY3c+ILYLkcDaLhBE8rAxEf01kS3W38t3GktRafntYgfy2ya3kB +y5LwtahhxqM2nAgKh5ZIlAzmCW4nwpSd6HoB7jsI3CfTLjHFYVQHa/IIEAtGvRP8 +Zke+qJWSg38jCr4OBSPcVlkHrWC3cAHdfJoG2mi6L3qAr7qBSJtPhSIZsWjmMxg1 +/jV9LYMt/Cv9FESKQh/bPyCI1jRXOGlCv/SapST5aAkjGN0YsaF4YV1YUrK2/aIV +469LPnbw6ZFuQ4WM8YCdf5G+RNGpnywuWRGjcmTSdFij/bbrsLjgvKYxlyv2 +-----END CERTIFICATE----- diff --git a/cloudclustersio/cassandra/user.key.pem b/cloudclustersio/cassandra/user.key.pem new file mode 100644 index 000000000..98b7ef9f0 --- /dev/null +++ b/cloudclustersio/cassandra/user.key.pem @@ -0,0 +1,32 @@ +Bag Attributes + friendlyName: node01 + localKeyID: 54 69 6D 65 20 31 37 35 36 35 36 31 35 34 32 31 38 38 +Key Attributes: +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwPilpOg7de8ZA +SOlSm3XZ/zYDCxgdrP2rvWaY/ID/sRbFjjJsdV1o0qlhTC0KpOXzBG5f2SU2Ajip +tTysTIb6tZpkbd0nnp/n6+Q4lATEdiM+UMClHzEXXwIN69Qz1iNwEftTG5+SGQ0c +g+sWLAu8ee+ZQ5+wOEGFbLpZpYexJMI7ZZbSGcRYAmMv4xSTAmjo1NaGRaAzX0fA +FNp1lLUW0vpw0Vl5FEwZyWnaZnjqJMmUXWft4PYhetwJag8o+8mtLZpyG0oTXgqU +t6nkX6n681JNfSzlrS649G8gWghg+XX8jhbbskHOmuv6Er/bqdmtJmUlSP04Uxi9 +2AyKmKiPAgMBAAEjggEAP9r15BNOCX9sECSarPx4kbh/GFEvtqjT7CKehrWOA5Zl +GsTvjg5j/rO8/Oy9sQqX6hnj58RkUBIz94Eb7412pmWf/90ycMVvRqeTM9ClfY0U +LeLSOcF4ZvBcbTDR3MosYtGRDsaGZUfAUWGWjpz8z5gacJxowk9PpgkD57Eq3cpJ +/pXqXedFwbWJqcM6bgOKidYD2vGJCgnTmTopxnZdhxUzd4+Z9O5ZmnulvKRNljn8 +Eri+D52ay4PJ05Dn7S3oxqydj8pn9eqxF81/URIiDg825BH57mAfyAIoIV0bM1vB +amfHSPzJC0sdDhI/D1ruD6xAB6Mcwnl8euoPCDgdGQKBgQDrVZclXkydzuxI3G4a +fi68/OPcntpeLuk6Z0G3Fx8EQgRPKCjI97aiLBvtjgN9lTmkXIAPH6O+94WZFtsL +B3xt0ldWxwnQl1DcnFNS4Bd5Dd+IJwJBSn5rfXR1ORbk4bkEd4yhw3OVOrBTl58H +0QBm2kL+49Lw601a/mUJl7sN+wKBgQC/uCultfr5cBehN6R/l+T4LxStFpfnMLVt +lFx4IowHj7PfL+ox57rv5nvg+GPG8KhoCxpe9TS/b+v/LEX9WTo1ZFYdwdElTSVq +Z4o5TC1VcKM5NyC2wLupITHEiqCjWLWYNivc/u4E/mPWSdBOfK8ltcPNin3Wrfmq +sXBLlClvfQKBgAnRQkLu0idrMHRBrd4xEWYU7rSPc/Cl6FjlYdpvfn3A+0kKFdl8 +bAQL7wZT/FVK2mK+8SCwYzZeQRaH2490On6iXb5jA0fOaDMr2lYEvzXvnDmj1vY+ +U1PMogUZ4pidyggjrJw6+SFql1yFYL8Euw2PYWgcvPoL9ugq4LArwkPtAoGBAKDo +1ZFenIeQgfSou+LvPJjlAwiHRvUeV5fiBn46GKccAE7Za0l5gddp7h0SvMOzJtU0 +RGzghuYJ7Nwdb5zEr+syDGkrS/tvtXCJ+GRAwGfOguA5mbZpKtg36QpZg5u1j6xy +AvyX5nPAg1DOYQwO7/3Jgc5YZ2ewWzTdei+k6eYNAoGBAM2ZAzU/aSMXzmmaYEls +ATzbAWzz4TiyQYGcRpngZh9DKboNP80/kdj/fOsjV4FTj1NuDVhdxYw3QZpfVKtW +Oa6qHVta20GY//SWXPNoXD3Lrw8biUUjnre28/dovu5uoSf1/oIFLvHRLF7mgOgo +JxKfpPtH4vaQEuf3b/+lOn6A +-----END PRIVATE KEY----- diff --git a/composer.json b/composer.json index 8091d3ec4..43b493e73 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ } ], "require": { - "php": ">=5.6.0" + "php": ">=8.3.0" }, "require-dev": { "behat/behat": "~3.0.6", diff --git a/doxygen.rb b/doxygen.rb old mode 100755 new mode 100644 diff --git a/ext/config.m4 b/ext/config.m4 index d479d9044..281239574 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -16,10 +16,12 @@ if test -z "$PHP_CASSANDRA_FOUND_PHP_VERSION_NUMBER"; then AC_MSG_ERROR([failed to detect PHP version, please report]) fi -if test "$PHP_CASSANDRA_FOUND_PHP_VERSION_NUMBER" -lt "50600"; then - AC_MSG_ERROR([not supported. PHP version 5.6.0+ required (found $PHP_CASSANDRA_FOUND_PHP_VERSION)]) +if test "$PHP_CASSANDRA_FOUND_PHP_VERSION_NUMBER" -lt "80300"; then + AC_MSG_ERROR([not supported. PHP version 8.3.0 or higher is required (found $PHP_CASSANDRA_FOUND_PHP_VERSION)]) else AC_MSG_RESULT([supported ($PHP_CASSANDRA_FOUND_PHP_VERSION)]) + AC_MSG_CHECKING([for PHP 8.3+ compatibility]) + AC_MSG_RESULT([PHP 8.3+ compatibility will be checked during compilation]) fi if test -z "$PHP_UV"; then @@ -302,7 +304,7 @@ if test "$PHP_CASSANDRA" != "no"; then AC_MSG_ERROR([Unable to load libcassandra]) ], [ - $ac_extra + $ac_extra -lssl -lcrypto -lz -luv -lm -lstdc++ ] ) diff --git a/ext/configure.ac b/ext/configure.ac new file mode 100644 index 000000000..f73a0de21 --- /dev/null +++ b/ext/configure.ac @@ -0,0 +1,228 @@ +dnl This file becomes configure.ac for self-contained extensions. + +dnl Include external macro definitions before the AC_INIT to also remove +dnl comments starting with # and empty newlines from the included files. +m4_include([build/ax_check_compile_flag.m4]) +m4_include([build/ax_gcc_func_attribute.m4]) +m4_include([build/libtool.m4]) +m4_include([build/ltoptions.m4]) +m4_include([build/ltsugar.m4]) +m4_include([build/ltversion.m4]) +m4_include([build/lt~obsolete.m4]) +m4_include([build/php_cxx_compile_stdcxx.m4]) +m4_include([build/php.m4]) +m4_include([build/pkg.m4]) + +AC_PREREQ([2.68]) +AC_INIT +AC_CONFIG_SRCDIR([config.m4]) +AC_CONFIG_AUX_DIR([build]) +AC_PRESERVE_HELP_ORDER + +PHP_CONFIG_NICE(config.nice) + +AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl +AC_DEFUN([PHP_EXT_DIR],[""])dnl +AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl +AC_DEFUN([PHP_ALWAYS_SHARED],[ + ext_output="yes, shared" + ext_shared=yes + test "[$]$1" = "no" && $1=yes +])dnl + +test -z "$CFLAGS" && auto_cflags=1 + +abs_srcdir=`(cd $srcdir && pwd)` +abs_builddir=`pwd` + +PKG_PROG_PKG_CONFIG +AC_PROG_CC([cc gcc]) +PHP_DETECT_ICC +PHP_DETECT_SUNCC + +dnl Support systems with system libraries in e.g. /usr/lib64. +PHP_ARG_WITH([libdir], + [for system library directory], + [AS_HELP_STRING([--with-libdir=NAME], + [Look for libraries in .../NAME rather than .../lib])], + [lib], + [no]) + +PHP_RUNPATH_SWITCH +PHP_SHLIB_SUFFIX_NAMES + +dnl Find php-config script. +PHP_ARG_WITH([php-config],, + [AS_HELP_STRING([--with-php-config=PATH], + [Path to php-config [php-config]])], + [php-config], + [no]) + +dnl For BC. +PHP_CONFIG=$PHP_PHP_CONFIG +prefix=`$PHP_CONFIG --prefix 2>/dev/null` +phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null` +INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` +EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null` +PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null` + +if test -z "$prefix"; then + AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH]) +fi + +php_shtool=$srcdir/build/shtool +PHP_INIT_BUILD_SYSTEM + +AC_MSG_CHECKING([for PHP prefix]) +AC_MSG_RESULT([$prefix]) +AC_MSG_CHECKING([for PHP includes]) +AC_MSG_RESULT([$INCLUDES]) +AC_MSG_CHECKING([for PHP extension directory]) +AC_MSG_RESULT([$EXTENSION_DIR]) +AC_MSG_CHECKING([for PHP installed headers prefix]) +AC_MSG_RESULT([$phpincludedir]) + +dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS. +AC_MSG_CHECKING([if debug is enabled]) +old_CPPFLAGS=$CPPFLAGS +CPPFLAGS="-I$phpincludedir" +AC_EGREP_CPP(php_debug_is_enabled,[ +#include
+#if ZEND_DEBUG +php_debug_is_enabled +#endif +],[ + PHP_DEBUG=yes +],[ + PHP_DEBUG=no +]) +CPPFLAGS=$old_CPPFLAGS +AC_MSG_RESULT([$PHP_DEBUG]) + +AC_MSG_CHECKING([if zts is enabled]) +old_CPPFLAGS=$CPPFLAGS +CPPFLAGS="-I$phpincludedir" +AC_EGREP_CPP(php_zts_is_enabled,[ +#include
+#if ZTS +php_zts_is_enabled +#endif +],[ + PHP_THREAD_SAFETY=yes +],[ + PHP_THREAD_SAFETY=no +]) +CPPFLAGS=$old_CPPFLAGS +AC_MSG_RESULT([$PHP_THREAD_SAFETY]) + +dnl Discard optimization flags when debugging is enabled. +if test "$PHP_DEBUG" = "yes"; then + PHP_DEBUG=1 + ZEND_DEBUG=yes + changequote({,}) + CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` + CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` + changequote([,]) + dnl Add -O0 only if GCC or ICC is used. + if test "$GCC" = "yes" || test "$ICC" = "yes"; then + CFLAGS="$CFLAGS -O0" + CXXFLAGS="$CXXFLAGS -g -O0" + fi + if test "$SUNCC" = "yes"; then + if test -n "$auto_cflags"; then + CFLAGS="-g" + CXXFLAGS="-g" + else + CFLAGS="$CFLAGS -g" + CXXFLAGS="$CFLAGS -g" + fi + fi +else + PHP_DEBUG=0 + ZEND_DEBUG=no +fi + +dnl Always shared. +PHP_BUILD_SHARED + +dnl Required programs. +PHP_PROG_AWK + +sinclude(config.m4) + +enable_static=no +enable_shared=yes + +dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by +dnl PHP_REQUIRE_CXX). Otherwise AC_PROG_LIBTOOL fails if there is no working C++ +dnl compiler. +AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [ + undefine([AC_PROG_CXX]) + AC_DEFUN([AC_PROG_CXX], []) + undefine([AC_PROG_CXXCPP]) + AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled]) +]) +AC_PROG_LIBTOOL + +all_targets='$(PHP_MODULES) $(PHP_ZEND_EX)' +install_targets="install-modules install-headers" +phplibdir="`pwd`/modules" +CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" +CFLAGS_CLEAN='$(CFLAGS) -D_GNU_SOURCE' +CXXFLAGS_CLEAN='$(CXXFLAGS)' + +test "$prefix" = "NONE" && prefix="/usr/local" +test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' + +if test "$cross_compiling" = yes ; then + AC_MSG_CHECKING(for native build C compiler) + AC_CHECK_PROGS(BUILD_CC, [gcc clang c99 c89 cc cl],none) + AC_MSG_RESULT($BUILD_CC) +else + BUILD_CC=$CC +fi + +PHP_SUBST(PHP_MODULES) +PHP_SUBST(PHP_ZEND_EX) + +PHP_SUBST(all_targets) +PHP_SUBST(install_targets) + +PHP_SUBST(prefix) +PHP_SUBST(exec_prefix) +PHP_SUBST(libdir) +PHP_SUBST(prefix) +PHP_SUBST(phplibdir) +PHP_SUBST(phpincludedir) + +PHP_SUBST(CC) +PHP_SUBST(CFLAGS) +PHP_SUBST(CFLAGS_CLEAN) +PHP_SUBST(CPP) +PHP_SUBST(CPPFLAGS) +PHP_SUBST(CXX) +PHP_SUBST(CXXFLAGS) +PHP_SUBST(CXXFLAGS_CLEAN) +PHP_SUBST(EXTENSION_DIR) +PHP_SUBST(PHP_EXECUTABLE) +PHP_SUBST(EXTRA_LDFLAGS) +PHP_SUBST(EXTRA_LIBS) +PHP_SUBST(INCLUDES) +PHP_SUBST(LFLAGS) +PHP_SUBST(LDFLAGS) +PHP_SUBST(SHARED_LIBTOOL) +PHP_SUBST(LIBTOOL) +PHP_SUBST(SHELL) +PHP_SUBST(INSTALL_HEADERS) +PHP_SUBST(BUILD_CC) + +PHP_GEN_BUILD_DIRS +PHP_GEN_GLOBAL_MAKEFILE + +test -d modules || $php_shtool mkdir modules + +AC_CONFIG_HEADERS([config.h]) + +AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([config.h.in])]) + +AC_OUTPUT diff --git a/ext/doc/generate_doc.sh b/ext/doc/generate_doc.sh old mode 100755 new mode 100644 diff --git a/ext/doc/generate_doc_yaml.sh b/ext/doc/generate_doc_yaml.sh old mode 100755 new mode 100644 diff --git a/ext/install.sh b/ext/install.sh index 3895fd7b9..1dd67834f 100755 --- a/ext/install.sh +++ b/ext/install.sh @@ -38,11 +38,12 @@ mv build/lib/libcassandra_static.a build/lib/libcassandra.a popd echo "Compiling and installing the extension..." +pushd $basedir phpize - echo ./configure --with-cassandra=$builddir --with-libdir=lib -LIBS="-lssl -lz -luv -lm -lstdc++" LDFLAGS="-L$builddir/lib" ./configure --with-cassandra=$builddir --with-libdir=lib +LIBS="-lssl -lcrypto -lz -luv -lm -lstdc++" LDFLAGS="-L$builddir/lib" ./configure --with-cassandra=$builddir --with-libdir=lib make make install +popd rm -Rf /tmp/php-driver-installation diff --git a/ext/packaging/build_deb.sh b/ext/packaging/build_deb.sh old mode 100755 new mode 100644 diff --git a/ext/packaging/build_rpm.sh b/ext/packaging/build_rpm.sh old mode 100755 new mode 100644 diff --git a/ext/packaging/debian-php5.6/rules b/ext/packaging/debian-php5.6/rules old mode 100755 new mode 100644 diff --git a/ext/packaging/debian-php7.0/rules b/ext/packaging/debian-php7.0/rules old mode 100755 new mode 100644 diff --git a/ext/packaging/debian-php7.1/rules b/ext/packaging/debian-php7.1/rules old mode 100755 new mode 100644 diff --git a/ext/php_driver.c b/ext/php_driver.c index 14b7a31dc..b7cb3b1ac 100644 --- a/ext/php_driver.c +++ b/ext/php_driver.c @@ -50,8 +50,7 @@ static uv_rwlock_t log_lock; ZEND_DECLARE_MODULE_GLOBALS(php_driver) -static PHP_GINIT_FUNCTION(php_driver); -static PHP_GSHUTDOWN_FUNCTION(php_driver); + const zend_function_entry php_driver_functions[] = { PHP_FE_END /* Must be the last line in php_driver_functions[] */ @@ -65,24 +64,17 @@ static zend_module_dep php_driver_deps[] = { #endif zend_module_entry php_driver_module_entry = { -#if ZEND_MODULE_API_NO >= 20050617 - STANDARD_MODULE_HEADER_EX, NULL, php_driver_deps, -#elif ZEND_MODULE_API_NO >= 20010901 - STANDARD_MODULE_HEADER, -#endif + STANDARD_MODULE_HEADER_EX, NULL, + php_driver_deps, PHP_DRIVER_NAME, - php_driver_functions, /* Functions */ - PHP_MINIT(php_driver), /* MINIT */ - PHP_MSHUTDOWN(php_driver), /* MSHUTDOWN */ - PHP_RINIT(php_driver), /* RINIT */ - PHP_RSHUTDOWN(php_driver), /* RSHUTDOWN */ - PHP_MINFO(php_driver), /* MINFO */ -#if ZEND_MODULE_API_NO >= 20010901 + php_driver_functions, + PHP_MINIT(php_driver), + PHP_MSHUTDOWN(php_driver), + PHP_RINIT(php_driver), + PHP_RSHUTDOWN(php_driver), + PHP_MINFO(php_driver), PHP_DRIVER_VERSION, -#endif - PHP_MODULE_GLOBALS(php_driver), - PHP_GINIT(php_driver), - PHP_GSHUTDOWN(php_driver), + NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX }; @@ -103,7 +95,7 @@ php_le_php_driver_cluster() return le_php_driver_cluster_res; } static void -php_driver_cluster_dtor(php5to7_zend_resource rsrc TSRMLS_DC) +php_driver_cluster_dtor(zend_resource *rsrc) { CassCluster *cluster = (CassCluster*) rsrc->ptr; @@ -121,7 +113,7 @@ php_le_php_driver_session() return le_php_driver_session_res; } static void -php_driver_session_dtor(php5to7_zend_resource rsrc TSRMLS_DC) +php_driver_session_dtor(zend_resource *rsrc) { php_driver_psession *psession = (php_driver_psession*) rsrc->ptr; @@ -300,7 +292,7 @@ exception_class(CassError rc) void throw_invalid_argument(zval *object, const char *object_name, - const char *expected_type TSRMLS_DC) + const char *expected_type) { if (Z_TYPE_P(object) == IS_OBJECT) { #if ZEND_MODULE_API_NO >= 20100525 @@ -316,14 +308,14 @@ throw_invalid_argument(zval *object, #endif #if PHP_MAJOR_VERSION >= 7 - zend_string* str = Z_OBJ_HANDLER_P(object, get_class_name)(Z_OBJ_P(object) TSRMLS_CC); + zend_string* str = Z_OBJ_HANDLER_P(object, get_class_name)(Z_OBJ_P(object)); cls_name = str->val; cls_len = str->len; #else Z_OBJ_HANDLER_P(object, get_class_name)(object, &cls_name, &cls_len, 0 TSRMLS_CC); #endif if (cls_name) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "%s must be %s, an instance of %.*s given", object_name, expected_type, (int)cls_len, cls_name); #if PHP_MAJOR_VERSION >= 7 @@ -332,18 +324,22 @@ throw_invalid_argument(zval *object, efree((void*) cls_name); #endif } else { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "%s must be %s, an instance of Unknown Class given", object_name, expected_type); } } else if (Z_TYPE_P(object) == IS_STRING) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, - "%s must be %s, '%Z' given", - object_name, expected_type, object); + zend_string *str = zval_get_string(object); + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, + "%s must be %s, %s given", + object_name, expected_type, ZSTR_VAL(str)); + zend_string_release(str); } else { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, - "%s must be %s, %Z given", - object_name, expected_type, object); + zend_string *str = zval_get_string(object); + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, + "%s must be %s, %s given", + object_name, expected_type, ZSTR_VAL(str)); + zend_string_release(str); } } @@ -352,26 +348,22 @@ PHP_INI_MH(OnUpdateLogLevel) /* If TSRM is enabled then the last thread to update this wins */ if (new_value) { - if (PHP5TO7_STRCMP(new_value, "CRITICAL") == 0) { + if (strncmp(ZSTR_VAL(new_value), "CRITICAL", ZSTR_LEN(new_value)) == 0) { cass_log_set_level(CASS_LOG_DISABLED); - } else if (PHP5TO7_STRCMP(new_value, "ERROR") == 0) { + } else if (strncmp(ZSTR_VAL(new_value), "ERROR", ZSTR_LEN(new_value)) == 0) { cass_log_set_level(CASS_LOG_ERROR); - } else if (PHP5TO7_STRCMP(new_value, "WARN") == 0) { + } else if (strncmp(ZSTR_VAL(new_value), "WARN", ZSTR_LEN(new_value)) == 0) { cass_log_set_level(CASS_LOG_WARN); - } else if (PHP5TO7_STRCMP(new_value, "INFO") == 0) { + } else if (strncmp(ZSTR_VAL(new_value), "INFO", ZSTR_LEN(new_value)) == 0) { cass_log_set_level(CASS_LOG_INFO); - } else if (PHP5TO7_STRCMP(new_value, "DEBUG") == 0) { + } else if (strncmp(ZSTR_VAL(new_value), "DEBUG", ZSTR_LEN(new_value)) == 0) { cass_log_set_level(CASS_LOG_DEBUG); - } else if (PHP5TO7_STRCMP(new_value, "TRACE") == 0) { + } else if (strncmp(ZSTR_VAL(new_value), "TRACE", ZSTR_LEN(new_value)) == 0) { cass_log_set_level(CASS_LOG_TRACE); } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, + php_error_docref(NULL, E_NOTICE, PHP_DRIVER_NAME " | Unknown log level '%s', using 'ERROR'", -#if PHP_MAJOR_VERSION >= 7 ZSTR_VAL(new_value)); -#else - new_value); -#endif cass_log_set_level(CASS_LOG_ERROR); } } @@ -389,15 +381,15 @@ PHP_INI_MH(OnUpdateLog) log_location = NULL; } if (new_value) { - if (PHP5TO7_STRCMP(new_value, "syslog") != 0) { + if (strncmp(ZSTR_VAL(new_value), "syslog", ZSTR_LEN(new_value)) != 0) { char realpath[MAXPATHLEN + 1]; - if (VCWD_REALPATH(PHP5TO7_STRVAL(new_value), realpath)) { + if (VCWD_REALPATH(ZSTR_VAL(new_value), realpath)) { log_location = strdup(realpath); } else { - log_location = strdup(PHP5TO7_STRVAL(new_value)); + log_location = strdup(ZSTR_VAL(new_value)); } } else { - log_location = strdup(PHP5TO7_STRVAL(new_value)); + log_location = strdup(ZSTR_VAL(new_value)); } } uv_rwlock_wrunlock(&log_lock); @@ -406,7 +398,7 @@ PHP_INI_MH(OnUpdateLog) } -static PHP_GINIT_FUNCTION(php_driver) +static ZEND_GINIT_FUNCTION(php_driver) { uv_once(&log_once, php_driver_log_initialize); @@ -433,7 +425,7 @@ static PHP_GINIT_FUNCTION(php_driver) PHP5TO7_ZVAL_UNDEF(php_driver_globals->type_timeuuid); } -static PHP_GSHUTDOWN_FUNCTION(php_driver) +static ZEND_GSHUTDOWN_FUNCTION(php_driver) { if (php_driver_globals->uuid_gen) { cass_uuid_gen_free(php_driver_globals->uuid_gen); @@ -454,113 +446,113 @@ PHP_MINIT_FUNCTION(php_driver) PHP_DRIVER_SESSION_RES_NAME, module_number); - php_driver_define_Exception(TSRMLS_C); - php_driver_define_InvalidArgumentException(TSRMLS_C); - php_driver_define_DomainException(TSRMLS_C); - php_driver_define_RuntimeException(TSRMLS_C); - php_driver_define_TimeoutException(TSRMLS_C); - php_driver_define_LogicException(TSRMLS_C); - php_driver_define_ExecutionException(TSRMLS_C); - php_driver_define_ReadTimeoutException(TSRMLS_C); - php_driver_define_WriteTimeoutException(TSRMLS_C); - php_driver_define_UnavailableException(TSRMLS_C); - php_driver_define_TruncateException(TSRMLS_C); - php_driver_define_ValidationException(TSRMLS_C); - php_driver_define_InvalidQueryException(TSRMLS_C); - php_driver_define_InvalidSyntaxException(TSRMLS_C); - php_driver_define_UnauthorizedException(TSRMLS_C); - php_driver_define_UnpreparedException(TSRMLS_C); - php_driver_define_ConfigurationException(TSRMLS_C); - php_driver_define_AlreadyExistsException(TSRMLS_C); - php_driver_define_AuthenticationException(TSRMLS_C); - php_driver_define_ProtocolException(TSRMLS_C); - php_driver_define_ServerException(TSRMLS_C); - php_driver_define_IsBootstrappingException(TSRMLS_C); - php_driver_define_OverloadedException(TSRMLS_C); - php_driver_define_RangeException(TSRMLS_C); - php_driver_define_DivideByZeroException(TSRMLS_C); - - php_driver_define_Value(TSRMLS_C); - php_driver_define_Numeric(TSRMLS_C); - php_driver_define_Bigint(TSRMLS_C); - php_driver_define_Smallint(TSRMLS_C); - php_driver_define_Tinyint(TSRMLS_C); - php_driver_define_Blob(TSRMLS_C); - php_driver_define_Decimal(TSRMLS_C); - php_driver_define_Float(TSRMLS_C); - php_driver_define_Inet(TSRMLS_C); - php_driver_define_Timestamp(TSRMLS_C); - php_driver_define_Date(TSRMLS_C); - php_driver_define_Time(TSRMLS_C); - php_driver_define_UuidInterface(TSRMLS_C); - php_driver_define_Timeuuid(TSRMLS_C); - php_driver_define_Uuid(TSRMLS_C); - php_driver_define_Varint(TSRMLS_C); - php_driver_define_Custom(TSRMLS_C); - php_driver_define_Duration(TSRMLS_C); - - php_driver_define_Set(TSRMLS_C); - php_driver_define_Map(TSRMLS_C); - php_driver_define_Collection(TSRMLS_C); - php_driver_define_Tuple(TSRMLS_C); - php_driver_define_UserTypeValue(TSRMLS_C); - - php_driver_define_Core(TSRMLS_C); - php_driver_define_Cluster(TSRMLS_C); - php_driver_define_DefaultCluster(TSRMLS_C); - php_driver_define_ClusterBuilder(TSRMLS_C); - php_driver_define_Future(TSRMLS_C); - php_driver_define_FuturePreparedStatement(TSRMLS_C); - php_driver_define_FutureRows(TSRMLS_C); - php_driver_define_FutureSession(TSRMLS_C); - php_driver_define_FutureValue(TSRMLS_C); - php_driver_define_FutureClose(TSRMLS_C); - php_driver_define_Session(TSRMLS_C); - php_driver_define_DefaultSession(TSRMLS_C); - php_driver_define_SSLOptions(TSRMLS_C); - php_driver_define_SSLOptionsBuilder(TSRMLS_C); - php_driver_define_Statement(TSRMLS_C); - php_driver_define_SimpleStatement(TSRMLS_C); - php_driver_define_PreparedStatement(TSRMLS_C); - php_driver_define_BatchStatement(TSRMLS_C); - php_driver_define_ExecutionOptions(TSRMLS_C); - php_driver_define_Rows(TSRMLS_C); - - php_driver_define_Schema(TSRMLS_C); - php_driver_define_DefaultSchema(TSRMLS_C); - php_driver_define_Keyspace(TSRMLS_C); - php_driver_define_DefaultKeyspace(TSRMLS_C); - php_driver_define_Table(TSRMLS_C); - php_driver_define_DefaultTable(TSRMLS_C); - php_driver_define_Column(TSRMLS_C); - php_driver_define_DefaultColumn(TSRMLS_C); - php_driver_define_Index(TSRMLS_C); - php_driver_define_DefaultIndex(TSRMLS_C); - php_driver_define_MaterializedView(TSRMLS_C); - php_driver_define_DefaultMaterializedView(TSRMLS_C); - php_driver_define_Function(TSRMLS_C); - php_driver_define_DefaultFunction(TSRMLS_C); - php_driver_define_Aggregate(TSRMLS_C); - php_driver_define_DefaultAggregate(TSRMLS_C); - - php_driver_define_Type(TSRMLS_C); - php_driver_define_TypeScalar(TSRMLS_C); - php_driver_define_TypeCollection(TSRMLS_C); - php_driver_define_TypeSet(TSRMLS_C); - php_driver_define_TypeMap(TSRMLS_C); - php_driver_define_TypeTuple(TSRMLS_C); - php_driver_define_TypeUserType(TSRMLS_C); - php_driver_define_TypeCustom(TSRMLS_C); - - php_driver_define_RetryPolicy(TSRMLS_C); - php_driver_define_RetryPolicyDefault(TSRMLS_C); - php_driver_define_RetryPolicyDowngradingConsistency(TSRMLS_C); - php_driver_define_RetryPolicyFallthrough(TSRMLS_C); - php_driver_define_RetryPolicyLogging(TSRMLS_C); - - php_driver_define_TimestampGenerator(TSRMLS_C); - php_driver_define_TimestampGeneratorMonotonic(TSRMLS_C); - php_driver_define_TimestampGeneratorServerSide(TSRMLS_C); + php_driver_define_Exception(); + php_driver_define_InvalidArgumentException(); + php_driver_define_DomainException(); + php_driver_define_RuntimeException(); + php_driver_define_TimeoutException(); + php_driver_define_LogicException(); + php_driver_define_ExecutionException(); + php_driver_define_ReadTimeoutException(); + php_driver_define_WriteTimeoutException(); + php_driver_define_UnavailableException(); + php_driver_define_TruncateException(); + php_driver_define_ValidationException(); + php_driver_define_InvalidQueryException(); + php_driver_define_InvalidSyntaxException(); + php_driver_define_UnauthorizedException(); + php_driver_define_UnpreparedException(); + php_driver_define_ConfigurationException(); + php_driver_define_AlreadyExistsException(); + php_driver_define_AuthenticationException(); + php_driver_define_ProtocolException(); + php_driver_define_ServerException(); + php_driver_define_IsBootstrappingException(); + php_driver_define_OverloadedException(); + php_driver_define_RangeException(); + php_driver_define_DivideByZeroException(); + + php_driver_define_Value(); + php_driver_define_Numeric(); + php_driver_define_Bigint(); + php_driver_define_Smallint(); + php_driver_define_Tinyint(); + php_driver_define_Blob(); + php_driver_define_Decimal(); + php_driver_define_Float(); + php_driver_define_Inet(); + php_driver_define_Timestamp(); + php_driver_define_Date(); + php_driver_define_Time(); + php_driver_define_UuidInterface(); + php_driver_define_Timeuuid(); + php_driver_define_Uuid(); + php_driver_define_Varint(); + php_driver_define_Custom(); + php_driver_define_Duration(); + + php_driver_define_Set(); + php_driver_define_Map(); + php_driver_define_Collection(); + php_driver_define_Tuple(); + php_driver_define_UserTypeValue(); + + php_driver_define_Core(); + php_driver_define_Cluster(); + php_driver_define_DefaultCluster(); + php_driver_define_ClusterBuilder(); + php_driver_define_Future(); + php_driver_define_FuturePreparedStatement(); + php_driver_define_FutureRows(); + php_driver_define_FutureSession(); + php_driver_define_FutureValue(); + php_driver_define_FutureClose(); + php_driver_define_Session(); + php_driver_define_DefaultSession(); + php_driver_define_SSLOptions(); + php_driver_define_SSLOptionsBuilder(); + php_driver_define_Statement(); + php_driver_define_SimpleStatement(); + php_driver_define_PreparedStatement(); + php_driver_define_BatchStatement(); + php_driver_define_ExecutionOptions(); + php_driver_define_Rows(); + + php_driver_define_Schema(); + php_driver_define_DefaultSchema(); + php_driver_define_Keyspace(); + php_driver_define_DefaultKeyspace(); + php_driver_define_Table(); + php_driver_define_DefaultTable(); + php_driver_define_Column(); + php_driver_define_DefaultColumn(); + php_driver_define_Index(); + php_driver_define_DefaultIndex(); + php_driver_define_MaterializedView(); + php_driver_define_DefaultMaterializedView(); + php_driver_define_Function(); + php_driver_define_DefaultFunction(); + php_driver_define_Aggregate(); + php_driver_define_DefaultAggregate(); + + php_driver_define_Type(); + php_driver_define_TypeScalar(); + php_driver_define_TypeCollection(); + php_driver_define_TypeSet(); + php_driver_define_TypeMap(); + php_driver_define_TypeTuple(); + php_driver_define_TypeUserType(); + php_driver_define_TypeCustom(); + + php_driver_define_RetryPolicy(); + php_driver_define_RetryPolicyDefault(); + php_driver_define_RetryPolicyDowngradingConsistency(); + php_driver_define_RetryPolicyFallthrough(); + php_driver_define_RetryPolicyLogging(); + + php_driver_define_TimestampGenerator(); + php_driver_define_TimestampGeneratorMonotonic(); + php_driver_define_TimestampGeneratorServerSide(); return SUCCESS; } diff --git a/ext/php_driver.dep b/ext/php_driver.dep new file mode 100644 index 000000000..1ed00a232 --- /dev/null +++ b/ext/php_driver.dep @@ -0,0 +1,108 @@ +php_driver.lo: /home/agabadounir/php-cassandra/ext/php_driver.c \ + /home/agabadounir/php-cassandra/ext/php_driver.h \ + /home/agabadounir/php-cassandra/ext/config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h \ + /home/agabadounir/php-cassandra/ext/version.h \ + /home/agabadounir/php-cassandra/ext/php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h \ + /home/agabadounir/php-cassandra/ext/php_driver_types.h \ + /home/agabadounir/php-cassandra/ext/util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/util/ref.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/ext/standard/info.h \ + /usr/include/php/20230831/main/php_syslog.h diff --git a/ext/php_driver.h b/ext/php_driver.h index 3ed2ad15e..6c0b2f5cd 100644 --- a/ext/php_driver.h +++ b/ext/php_driver.h @@ -42,10 +42,41 @@ typedef int pid_t; # define LL_FORMAT "%lld" #endif -#if PHP_VERSION_ID < 50600 -# error PHP 5.6.0 or later is required in order to build the driver +#if PHP_VERSION_ID < 80300 +# error PHP 8.3.0 or later is required to build this extension #endif +/* PHP 8.3+ compatibility */ +#ifndef ZEND_ACC_NOT_SERIALIZABLE +# define ZEND_ACC_NOT_SERIALIZABLE 0 +#endif +#ifndef ZEND_ACC_NOT_CLONEABLE +# define ZEND_ACC_NOT_CLONEABLE 0 +#endif + +/* Define TSRMLS_* macros for PHP 8.0+ */ +#if PHP_VERSION_ID >= 80000 +# ifndef TSRMLS_D +# define TSRMLS_D +# define TSRMLS_DC +# define TSRMLS_C +# define TSRMLS_CC +# define TSRMLS_FETCH() +# define TSRMLS_SET_CTX(ctx) +# define TSRMLS_SET_CACHE(ptr) +# define TSRMLS_CACHE +# define TSRMLS_CACHE_DEFINE() +# define TSRMLS_CACHE_UPDATE() +# define TSRMLS_THREAD_SAFE_CACHE +# define TSRMLS_FETCH_FROM_CTX(ctx) +# define TSRMLS_CC_CC , +# define TSRMLS_CACHE_UPDATE_IF_CHANGED() +# define TSRMLS_CACHE_DEFINE_INI_BOOL(name, default_value, on_modify, displayer, doc_root, arg_extra) \ + REGISTER_INI_ENTRY_EX(name, default_value, on_modify, displayer, doc_root, arg_extra) +# endif +#endif + + #include #include @@ -101,8 +132,8 @@ typedef int pid_t; #define CURRENT_CPP_DRIVER_VERSION \ CPP_DRIVER_VERSION(CASS_VERSION_MAJOR, CASS_VERSION_MINOR, CASS_VERSION_PATCH) -#if PHP_MAJOR_VERSION >= 7 -#define php5to7_zend_register_internal_class_ex(ce, parent_ce) zend_register_internal_class_ex((ce), (parent_ce) TSRMLS_CC); +#if PHP_VERSION_ID >= 80000 +#define php5to7_zend_register_internal_class_ex(ce, parent_ce) zend_register_internal_class_ex((ce), (parent_ce)); typedef zval php5to7_zval; typedef zval *php5to7_zval_args; @@ -117,9 +148,6 @@ typedef zend_object php5to7_zend_object_free; typedef zval **php5to7_zval_gc; typedef zval *php5to7_dtor; typedef size_t php5to7_size; -#if ((PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 4) || PHP_MAJOR_VERSION > 7) - typedef unsigned long ulong; -#endif static inline int php5to7_string_compare(php5to7_string s1, php5to7_string s2) @@ -148,14 +176,11 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) #define PHP5TO7_ZEND_OBJECT_INIT(type_name, self, ce) \ PHP5TO7_ZEND_OBJECT_INIT_EX(type_name, type_name, self, ce) -#define PHP5TO7_ZEND_OBJECT_INIT_EX(type_name, name, self, ce) do { \ - zend_object_std_init(&self->zval, ce TSRMLS_CC); \ - ((zend_object_handlers *) &php_driver_##name##_handlers)->offset = \ - XtOffsetOf(php_driver_##type_name, zval); \ - ((zend_object_handlers *) &php_driver_##name##_handlers)->free_obj = \ - php_driver_##name##_free; \ - self->zval.handlers = (zend_object_handlers *) &php_driver_##name##_handlers; \ - return &self->zval; \ +#define PHP5TO7_ZEND_OBJECT_INIT_EX(type_name, name, self, ce) do { \ + zend_object_std_init(&self->std, ce); \ + object_properties_init(&self->std, ce); \ + self->std.handlers = &php_driver_##name##_handlers; \ + return &self->std; \ } while(0) #define PHP5TO7_MAYBE_EFREE(p) ((void)0) @@ -176,13 +201,7 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) ZEND_HASH_FOREACH_NUM_KEY_VAL(ht, _h, _val) #define PHP5TO7_ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \ - ZEND_HASH_FOREACH(ht, 0); \ - if (_p->key) { \ - (_key) = _p->key->val; \ - } else { \ - (_key) = NULL; \ - } \ - _val = _z; + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) #define PHP5TO7_ZEND_HASH_FOREACH_END(ht) ZEND_HASH_FOREACH_END() @@ -192,9 +211,6 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) #define PHP5TO7_ZEND_HASH_GET_CURRENT_DATA_EX(ht, res, pos) \ ((res = zend_hash_get_current_data_ex((ht), (pos))) != NULL) -#define PHP5TO7_ZEND_HASH_GET_CURRENT_DATA_EX(ht, res, pos) \ - ((res = zend_hash_get_current_data_ex((ht), (pos))) != NULL) - #define PHP5TO7_ZEND_HASH_GET_CURRENT_KEY(ht, str_index, num_index) \ zend_hash_get_current_key((ht), (str_index), (num_index)) @@ -229,7 +245,7 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) zend_hash_copy((dst), (src), (copy_ctor_func_t) zval_add_ref); #define PHP5TO7_ZEND_HASH_SORT(ht, compare_func, renumber) \ - zend_hash_sort(ht, compare_func, renumber TSRMLS_CC) + zend_hash_sort(ht, compare_func, renumber) #define PHP5TO7_ZEND_STRING_VAL(str) (str)->val #define PHP5TO7_ZEND_STRING_LEN(str) (str)->len @@ -317,7 +333,8 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) PHP5TO7_ZEND_OBJECT_INIT_EX(type_name, type_name, self, ce) #define PHP5TO7_ZEND_OBJECT_INIT_EX(type_name, name, self, ce) do { \ - zend_object_value retval; \ + zend_object_value retval; + \ zend_object_std_init(&self->zval, ce TSRMLS_CC); \ object_properties_init(&self->zval, ce); \ retval.handle = zend_objects_store_put(self, \ @@ -457,6 +474,7 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) #endif /* PHP_MAJOR_VERSION >= 7 */ + extern zend_module_entry php_driver_module_entry; #define phpext_cassandra_ptr &php_driver_module_entry @@ -471,18 +489,18 @@ zend_class_entry *exception_class(CassError rc); void throw_invalid_argument(zval *object, const char *object_name, - const char *expected_type TSRMLS_DC); + const char *expected_type); #define INVALID_ARGUMENT(object, expected) \ { \ - throw_invalid_argument(object, #object, expected TSRMLS_CC); \ + throw_invalid_argument(object, #object, expected); \ return; \ } #define INVALID_ARGUMENT_VALUE(object, expected, failed_value) \ -{ \ - throw_invalid_argument(object, #object, expected TSRMLS_CC); \ - return failed_value; \ +{\ + throw_invalid_argument(object, #object, expected);\ + return failed_value;\ } #define ASSERT_SUCCESS_BLOCK(rc, block) \ diff --git a/ext/php_driver_globals.h b/ext/php_driver_globals.h index dff58c3aa..2d319018c 100644 --- a/ext/php_driver_globals.h +++ b/ext/php_driver_globals.h @@ -1,11 +1,41 @@ #ifndef PHP_DRIVER_GLOBALS_H #define PHP_DRIVER_GLOBALS_H +#include "php.h" +#include "standard/php_smart_string.h" + ZEND_BEGIN_MODULE_GLOBALS(php_driver) CassUuidGen *uuid_gen; pid_t uuid_gen_pid; unsigned int persistent_clusters; unsigned int persistent_sessions; + + /* Type definitions for different PHP versions */ +#if PHP_VERSION_ID >= 80000 + /* PHP 8.0+ uses zval directly */ + zval type_varchar; + zval type_text; + zval type_blob; + zval type_ascii; + zval type_bigint; + zval type_counter; + zval type_int; + zval type_varint; + zval type_boolean; + zval type_decimal; + zval type_double; + zval type_float; + zval type_inet; + zval type_timestamp; + zval type_date; + zval type_time; + zval type_uuid; + zval type_timeuuid; + zval type_smallint; + zval type_tinyint; + zval type_duration; +#else + /* PHP 5.x and 7.x compatibility */ php5to7_zval type_varchar; php5to7_zval type_text; php5to7_zval type_blob; @@ -27,8 +57,27 @@ ZEND_BEGIN_MODULE_GLOBALS(php_driver) php5to7_zval type_smallint; php5to7_zval type_tinyint; php5to7_zval type_duration; +#endif + + /* Additional globals for PHP 8.3+ */ +#if PHP_VERSION_ID >= 80300 + zend_long log_level; + char *log_location; +#endif + ZEND_END_MODULE_GLOBALS(php_driver) ZEND_EXTERN_MODULE_GLOBALS(php_driver) +/* Helper macros for PHP 8.3+ compatibility */ +#if PHP_VERSION_ID >= 80300 +# define PHP_DRIVER_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(php_driver, v) +#else +# ifdef ZTS +# define PHP_DRIVER_G(v) TSRMG(php_driver_globals_id, zend_php_driver_globals *, v) +# else +# define PHP_DRIVER_G(v) (php_driver_globals.v) +# endif +#endif + #endif /* PHP_DRIVER_GLOBALS_H */ diff --git a/ext/php_driver_types.h b/ext/php_driver_types.h index cc7b751ea..789b13d04 100644 --- a/ext/php_driver_types.h +++ b/ext/php_driver_types.h @@ -17,15 +17,28 @@ #ifndef PHP_DRIVER_TYPES_H #define PHP_DRIVER_TYPES_H -#if PHP_MAJOR_VERSION >= 7 +#if PHP_VERSION_ID >= 80000 +/* PHP 8.0+ */ #define PHP_DRIVER_BEGIN_OBJECT_TYPE(type_name) \ - typedef struct php_driver_##type_name##_ { + typedef struct php_driver_##type_name##_ { \ + zend_object std; #define PHP_DRIVER_END_OBJECT_TYPE(type_name) \ - zend_object zval; \ - } php_driver_##type_name; \ + } php_driver_##type_name; \ static inline php_driver_##type_name *php_driver_##type_name##_object_fetch(zend_object *obj) { \ - return (php_driver_##type_name *)((char *)obj - XtOffsetOf(php_driver_##type_name, zval)); \ + return (php_driver_##type_name *)((char *)(obj) - XtOffsetOf(php_driver_##type_name, std)); \ + } + +#elif PHP_MAJOR_VERSION >= 7 +/* PHP 7.x */ +#define PHP_DRIVER_BEGIN_OBJECT_TYPE(type_name) \ + typedef struct php_driver_##type_name##_ { \ + zend_object zval; + +#define PHP_DRIVER_END_OBJECT_TYPE(type_name) \ + } php_driver_##type_name; \ + static inline php_driver_##type_name *php_driver_##type_name##_object_fetch(zend_object *obj) { \ + return (php_driver_##type_name *)((char *)obj - XtOffsetOf(php_driver_##type_name, zval)); \ } #else #define PHP_DRIVER_BEGIN_OBJECT_TYPE(type_name) \ @@ -36,7 +49,47 @@ } php_driver_##type_name; #endif -#if PHP_MAJOR_VERSION >= 7 +#if PHP_VERSION_ID >= 80000 +/* PHP 8.0+ */ + #define PHP_DRIVER_GET_NUMERIC(obj) php_driver_numeric_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_BLOB(obj) php_driver_blob_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_TIMESTAMP(obj) php_driver_timestamp_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_DATE(obj) php_driver_date_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_TIME(obj) php_driver_time_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_UUID(obj) php_driver_uuid_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_INET(obj) php_driver_inet_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_COLLECTION(obj) php_driver_collection_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_MAP(obj) php_driver_map_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_SET(obj) php_driver_set_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_TUPLE(obj) php_driver_tuple_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_USER_TYPE_VALUE(obj) php_driver_user_type_value_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_CLUSTER(obj) php_driver_cluster_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_STATEMENT(obj) php_driver_statement_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_EXECUTION_OPTIONS(obj) php_driver_execution_options_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_ROWS(obj) php_driver_rows_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_FUTURE_ROWS(obj) php_driver_future_rows_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_CLUSTER_BUILDER(obj) php_driver_cluster_builder_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_FUTURE_PREPARED_STATEMENT(obj) php_driver_future_prepared_statement_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_FUTURE_VALUE(obj) php_driver_future_value_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_FUTURE_CLOSE(obj) php_driver_future_close_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_FUTURE_SESSION(obj) php_driver_future_session_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_SESSION(obj) php_driver_session_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_SSL(obj) php_driver_ssl_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_SSL_BUILDER(obj) php_driver_ssl_builder_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_SCHEMA(obj) php_driver_schema_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_KEYSPACE(obj) php_driver_keyspace_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_TABLE(obj) php_driver_table_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_COLUMN(obj) php_driver_column_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_INDEX(obj) php_driver_index_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_MATERIALIZED_VIEW(obj) php_driver_materialized_view_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_FUNCTION(obj) php_driver_function_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_AGGREGATE(obj) php_driver_aggregate_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_TYPE(obj) php_driver_type_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_RETRY_POLICY(obj) php_driver_retry_policy_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_TIMESTAMP_GEN(obj) php_driver_timestamp_gen_object_fetch(Z_OBJ_P(obj)) + #define PHP_DRIVER_GET_DURATION(obj) php_driver_duration_object_fetch(Z_OBJ_P(obj)) +#elif PHP_MAJOR_VERSION >= 7 +/* PHP 7.x */ #define PHP_DRIVER_GET_NUMERIC(obj) php_driver_numeric_object_fetch(Z_OBJ_P(obj)) #define PHP_DRIVER_GET_BLOB(obj) php_driver_blob_object_fetch(Z_OBJ_P(obj)) #define PHP_DRIVER_GET_TIMESTAMP(obj) php_driver_timestamp_object_fetch(Z_OBJ_P(obj)) diff --git a/ext/src/Aggregate.dep b/ext/src/Aggregate.dep new file mode 100644 index 000000000..7a6c1b5fd --- /dev/null +++ b/ext/src/Aggregate.dep @@ -0,0 +1,96 @@ +src/Aggregate.lo: /home/agabadounir/php-cassandra/ext/src/Aggregate.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/BatchStatement.c b/ext/src/BatchStatement.c index 1a445490a..7c5185925 100644 --- a/ext/src/BatchStatement.c +++ b/ext/src/BatchStatement.c @@ -123,44 +123,50 @@ static zend_function_entry php_driver_batch_statement_methods[] = { static zend_object_handlers php_driver_batch_statement_handlers; static HashTable * -php_driver_batch_statement_properties(zval *object TSRMLS_DC) +php_driver_batch_statement_properties(zend_object *object) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object); return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_batch_statement_compare(zval *obj1, zval *obj2 TSRMLS_DC) { if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#endif static void -php_driver_batch_statement_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_batch_statement_free(zend_object *object) { - php_driver_statement *self = PHP5TO7_ZEND_OBJECT_GET(statement, object); + php_driver_statement *self = php_driver_statement_object_fetch(object); zend_hash_destroy(&self->data.batch.statements); - zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + zend_object_std_dtor(&self->std); } -static php5to7_zend_object -php_driver_batch_statement_new(zend_class_entry *ce TSRMLS_DC) +static zend_object* +php_driver_batch_statement_new(zend_class_entry *ce) { php_driver_statement *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(statement, ce); + (php_driver_statement *) zend_object_alloc(sizeof(php_driver_statement), ce); self->type = PHP_DRIVER_BATCH_STATEMENT; self->data.batch.type = CASS_BATCH_TYPE_LOGGED; zend_hash_init(&self->data.batch.statements, 0, NULL, (dtor_func_t) php_driver_batch_statement_entry_dtor, 0); - PHP5TO7_ZEND_OBJECT_INIT_EX(statement, batch_statement, self, ce); + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + + self->std.handlers = &php_driver_batch_statement_handlers; + + return &self->std; } void php_driver_define_BatchStatement(TSRMLS_D) @@ -174,7 +180,9 @@ void php_driver_define_BatchStatement(TSRMLS_D) php_driver_batch_statement_ce->create_object = php_driver_batch_statement_new; memcpy(&php_driver_batch_statement_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_batch_statement_handlers.get_properties = php_driver_batch_statement_properties; + php_driver_batch_statement_handlers.get_properties = php_driver_batch_statement_properties; +#if PHP_VERSION_ID < 80000 php_driver_batch_statement_handlers.compare_objects = php_driver_batch_statement_compare; +#endif php_driver_batch_statement_handlers.clone_obj = NULL; } diff --git a/ext/src/BatchStatement.dep b/ext/src/BatchStatement.dep new file mode 100644 index 000000000..a71b02e45 --- /dev/null +++ b/ext/src/BatchStatement.dep @@ -0,0 +1,97 @@ +src/BatchStatement.lo: \ + /home/agabadounir/php-cassandra/ext/src/BatchStatement.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Bigint.c b/ext/src/Bigint.c index bb542cd56..c830c3e6b 100644 --- a/ext/src/Bigint.c +++ b/ext/src/Bigint.c @@ -28,22 +28,22 @@ zend_class_entry *php_driver_bigint_ce = NULL; static int -to_double(zval *result, php_driver_numeric *bigint TSRMLS_DC) +to_double(zval *result, php_driver_numeric *bigint) { ZVAL_DOUBLE(result, (double) bigint->data.bigint.value); return SUCCESS; } static int -to_long(zval *result, php_driver_numeric *bigint TSRMLS_DC) +to_long(zval *result, php_driver_numeric *bigint) { if (bigint->data.bigint.value < (cass_int64_t) PHP5TO7_ZEND_LONG_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value is too small"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value is too small"); return FAILURE; } if (bigint->data.bigint.value > (cass_int64_t) PHP5TO7_ZEND_LONG_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value is too big"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value is too big"); return FAILURE; } @@ -52,7 +52,7 @@ to_long(zval *result, php_driver_numeric *bigint TSRMLS_DC) } static int -to_string(zval *result, php_driver_numeric *bigint TSRMLS_DC) +to_string(zval *result, php_driver_numeric *bigint) { char *string; spprintf(&string, 0, LL_FORMAT, (long long int) bigint->data.bigint.value); @@ -67,11 +67,11 @@ php_driver_bigint_init(INTERNAL_FUNCTION_PARAMETERS) php_driver_numeric *self; zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } - if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_bigint_ce TSRMLS_CC)) { + if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_bigint_ce)) { self = PHP_DRIVER_GET_NUMERIC(getThis()); } else { object_init_ex(return_value, php_driver_bigint_ce); @@ -84,25 +84,25 @@ php_driver_bigint_init(INTERNAL_FUNCTION_PARAMETERS) double double_value = Z_DVAL_P(value); if (double_value > INT64_MAX || double_value < INT64_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between " LL_FORMAT " and " LL_FORMAT ", %g given", - INT64_MIN, INT64_MAX, double_value); + (long long int) INT64_MIN, (long long int) INT64_MAX, double_value); return; } self->data.bigint.value = (cass_int64_t) Z_DVAL_P(value); } else if (Z_TYPE_P(value) == IS_STRING) { if (!php_driver_parse_bigint(Z_STRVAL_P(value), Z_STRLEN_P(value), - &self->data.bigint.value TSRMLS_CC)) { + &self->data.bigint.value)) { return; } } else if (Z_TYPE_P(value) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(value), php_driver_bigint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(value), php_driver_bigint_ce)) { php_driver_numeric *bigint = PHP_DRIVER_GET_NUMERIC(value); self->data.bigint.value = bigint->data.bigint.value; } else { INVALID_ARGUMENT(value, "a long, a double, a numeric string or a " \ - PHP_DRIVER_NAMESPACE "\\Bigint"); + PHP_DRIVER_NAMESPACE "\Bigint"); } } @@ -113,6 +113,9 @@ PHP_METHOD(Bigint, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Bigint::__toString() */ PHP_METHOD(Bigint, __toString) { @@ -161,7 +164,7 @@ PHP_METHOD(Bigint, add) result->data.bigint.value = self->data.bigint.value + bigint->data.bigint.value; } else { - INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\\Bigint"); + INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\Bigint"); } } /* }}} */ @@ -186,7 +189,7 @@ PHP_METHOD(Bigint, sub) result->data.bigint.value = self->data.bigint.value - bigint->data.bigint.value; } else { - INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\\Bigint"); + INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\Bigint"); } } /* }}} */ @@ -211,7 +214,7 @@ PHP_METHOD(Bigint, mul) result->data.bigint.value = self->data.bigint.value * bigint->data.bigint.value; } else { - INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\\Bigint"); + INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\Bigint"); } } /* }}} */ @@ -235,13 +238,13 @@ PHP_METHOD(Bigint, div) result = PHP_DRIVER_GET_NUMERIC(return_value); if (bigint->data.bigint.value == 0) { - zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0 TSRMLS_CC, "Cannot divide by zero"); + zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0, "Cannot divide by zero"); return; } result->data.bigint.value = self->data.bigint.value / bigint->data.bigint.value; } else { - INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\\Bigint"); + INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\Bigint"); } } /* }}} */ @@ -265,13 +268,13 @@ PHP_METHOD(Bigint, mod) result = PHP_DRIVER_GET_NUMERIC(return_value); if (bigint->data.bigint.value == 0) { - zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0 TSRMLS_CC, "Cannot modulo by zero"); + zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0, "Cannot modulo by zero"); return; } result->data.bigint.value = self->data.bigint.value % bigint->data.bigint.value; } else { - INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\\Bigint"); + INVALID_ARGUMENT(num, "a " PHP_DRIVER_NAMESPACE "\Bigint"); } } /* }}} */ @@ -283,7 +286,7 @@ PHP_METHOD(Bigint, abs) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.bigint.value == INT64_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value doesn't exist"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value doesn't exist"); return; } @@ -312,7 +315,7 @@ PHP_METHOD(Bigint, sqrt) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.bigint.value < 0) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Cannot take a square root of a negative number"); } @@ -373,7 +376,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_bigint_methods[] = { PHP_ME(Bigint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Bigint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Bigint, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Bigint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Bigint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Bigint, add, arginfo_num, ZEND_ACC_PUBLIC) @@ -394,34 +397,34 @@ static zend_function_entry php_driver_bigint_methods[] = { static php_driver_value_handlers php_driver_bigint_handlers; static HashTable * -php_driver_bigint_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_bigint_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(object); } static HashTable * -php_driver_bigint_properties(zval *object TSRMLS_DC) +php_driver_bigint_properties(zend_object *object) { - php5to7_zval type; - php5to7_zval value; + zval type; + zval value; - php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + php_driver_numeric *self = php_driver_numeric_object_fetch(object); + HashTable *props = zend_std_get_properties(object); - type = php_driver_type_scalar(CASS_VALUE_TYPE_BIGINT TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + type = php_driver_type_scalar(CASS_VALUE_TYPE_BIGINT); + zend_hash_str_update(props, "type", sizeof("type") - 1, &type); - PHP5TO7_ZVAL_MAYBE_MAKE(value); - to_string(PHP5TO7_ZVAL_MAYBE_P(value), self TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "value", sizeof("value"), PHP5TO7_ZVAL_MAYBE_P(value), sizeof(zval)); + + to_string(&value, self); + zend_hash_str_update(props, "value", sizeof("value") - 1, &value); return props; } static int -php_driver_bigint_compare(zval *obj1, zval *obj2 TSRMLS_DC) +php_driver_bigint_compare(zval *obj1, zval *obj2) { php_driver_numeric *bigint1 = NULL; php_driver_numeric *bigint2 = NULL; @@ -441,24 +444,24 @@ php_driver_bigint_compare(zval *obj1, zval *obj2 TSRMLS_DC) } static unsigned -php_driver_bigint_hash_value(zval *obj TSRMLS_DC) +php_driver_bigint_hash_value(zval *obj) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(obj); return (unsigned)(self->data.bigint.value ^ (self->data.bigint.value >> 32)); } static int -php_driver_bigint_cast(zval *object, zval *retval, int type TSRMLS_DC) +php_driver_bigint_cast(zend_object *object, zval *retval, int type) { - php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); + php_driver_numeric *self = php_driver_numeric_object_fetch(object); switch (type) { case IS_LONG: - return to_long(retval, self TSRMLS_CC); + return to_long(retval, self); case IS_DOUBLE: - return to_double(retval, self TSRMLS_CC); + return to_double(retval, self); case IS_STRING: - return to_string(retval, self TSRMLS_CC); + return to_string(retval, self); default: return FAILURE; } @@ -467,43 +470,50 @@ php_driver_bigint_cast(zval *object, zval *retval, int type TSRMLS_DC) } static void -php_driver_bigint_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_bigint_free(zend_object *object) { - php_driver_numeric *self = PHP5TO7_ZEND_OBJECT_GET(numeric, object); + php_driver_numeric *self = php_driver_numeric_object_fetch(object); - zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + zend_object_std_dtor(&self->std); } -static php5to7_zend_object -php_driver_bigint_new(zend_class_entry *ce TSRMLS_DC) +static zend_object* +php_driver_bigint_new(zend_class_entry *ce) { php_driver_numeric *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(numeric, ce); + (php_driver_numeric *) zend_object_alloc(sizeof(php_driver_numeric), ce); self->type = PHP_DRIVER_BIGINT; - PHP5TO7_ZEND_OBJECT_INIT_EX(numeric, bigint, self, ce); + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + + self->std.handlers = &php_driver_bigint_handlers.std; + + return &self->std; } -void php_driver_define_Bigint(TSRMLS_D) +void php_driver_define_Bigint(void) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Bigint", php_driver_bigint_methods); - php_driver_bigint_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_bigint_ce TSRMLS_CC, 2, php_driver_value_ce, php_driver_numeric_ce); + php_driver_bigint_ce = zend_register_internal_class(&ce); + zend_class_implements(php_driver_bigint_ce, 2, php_driver_value_ce, php_driver_numeric_ce); php_driver_bigint_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_bigint_ce->create_object = php_driver_bigint_new; memcpy(&php_driver_bigint_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_bigint_handlers.std.get_properties = php_driver_bigint_properties; + php_driver_bigint_handlers.std.get_properties = (zend_object_get_properties_t)php_driver_bigint_properties; #if PHP_VERSION_ID >= 50400 - php_driver_bigint_handlers.std.get_gc = php_driver_bigint_gc; + php_driver_bigint_handlers.std.get_gc = (zend_object_get_gc_t)php_driver_bigint_gc; #endif - php_driver_bigint_handlers.std.compare_objects = php_driver_bigint_compare; - php_driver_bigint_handlers.std.cast_object = php_driver_bigint_cast; + php_driver_bigint_handlers.std.compare = php_driver_bigint_compare; + php_driver_bigint_handlers.std.cast_object = (zend_object_cast_t)php_driver_bigint_cast; + php_driver_bigint_handlers.std.free_obj = php_driver_bigint_free; +#if PHP_VERSION_ID < 80000 php_driver_bigint_handlers.hash_value = php_driver_bigint_hash_value; +#endif php_driver_bigint_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Bigint.dep b/ext/src/Bigint.dep new file mode 100644 index 000000000..5fc653918 --- /dev/null +++ b/ext/src/Bigint.dep @@ -0,0 +1,98 @@ +src/Bigint.lo: /home/agabadounir/php-cassandra/ext/src/Bigint.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Blob.c b/ext/src/Blob.c index 17a24300d..f20b35e73 100644 --- a/ext/src/Blob.c +++ b/ext/src/Blob.c @@ -51,6 +51,9 @@ PHP_METHOD(Blob, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Blob::__toString() */ PHP_METHOD(Blob, __toString) { @@ -103,7 +106,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_blob_methods[] = { PHP_ME(Blob, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Blob, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Blob, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Blob, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Blob, bytes, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Blob, toBinaryString, arginfo_none, ZEND_ACC_PUBLIC) @@ -113,13 +116,44 @@ static zend_function_entry php_driver_blob_methods[] = { static php_driver_value_handlers php_driver_blob_handlers; static HashTable * -php_driver_blob_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_blob_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); +#if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else + php_driver_date *self = PHP_DRIVER_GET_DATE(object); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_blob_properties(zend_object *object) +{ + char *hex; + int hex_len; + php5to7_zval type; + php5to7_zval bytes; + + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_blob *self = PHP_DRIVER_GET_BLOB(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_BLOB TSRMLS_CC); + PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + + php_driver_bytes_to_hex((const char *) self->data, self->size, &hex, &hex_len); + PHP5TO7_ZVAL_MAYBE_MAKE(bytes); + PHP5TO7_ZVAL_STRINGL(PHP5TO7_ZVAL_MAYBE_P(bytes), hex, hex_len); + efree(hex); + PHP5TO7_ZEND_HASH_UPDATE(props, "bytes", sizeof("bytes"), PHP5TO7_ZVAL_MAYBE_P(bytes), sizeof(zval)); + + return props; +} +#else static HashTable * php_driver_blob_properties(zval *object TSRMLS_DC) { @@ -129,7 +163,7 @@ php_driver_blob_properties(zval *object TSRMLS_DC) php5to7_zval bytes; php_driver_blob *self = PHP_DRIVER_GET_BLOB(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC); type = php_driver_type_scalar(CASS_VALUE_TYPE_BLOB TSRMLS_CC); PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); @@ -142,7 +176,9 @@ php_driver_blob_properties(zval *object TSRMLS_DC) return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_blob_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -163,6 +199,7 @@ php_driver_blob_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 1; } } +#endif static unsigned php_driver_blob_hash_value(zval *obj TSRMLS_DC) @@ -180,7 +217,11 @@ php_driver_blob_free(php5to7_zend_object_free *object TSRMLS_DC) efree(self->data); } +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -190,7 +231,17 @@ php_driver_blob_new(zend_class_entry *ce TSRMLS_DC) php_driver_blob *self = PHP5TO7_ZEND_OBJECT_ECALLOC(blob, ce); - PHP5TO7_ZEND_OBJECT_INIT(blob, self, ce); +#if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_blob_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_blob_handlers; + return &self->zval; +#endif } void php_driver_define_Blob(TSRMLS_D) @@ -205,10 +256,13 @@ void php_driver_define_Blob(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_blob_handlers.std.get_gc = php_driver_blob_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_blob_handlers.std.compare_objects = php_driver_blob_compare; +#endif php_driver_blob_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_blob_ce->create_object = php_driver_blob_new; - +#if PHP_VERSION_ID < 80000 php_driver_blob_handlers.hash_value = php_driver_blob_hash_value; +#endif php_driver_blob_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Blob.dep b/ext/src/Blob.dep new file mode 100644 index 000000000..82ed43a18 --- /dev/null +++ b/ext/src/Blob.dep @@ -0,0 +1,97 @@ +src/Blob.lo: /home/agabadounir/php-cassandra/ext/src/Blob.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/bytes.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Cluster.dep b/ext/src/Cluster.dep new file mode 100644 index 000000000..a68652a4b --- /dev/null +++ b/ext/src/Cluster.dep @@ -0,0 +1,96 @@ +src/Cluster.lo: /home/agabadounir/php-cassandra/ext/src/Cluster.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Cluster/Builder.c b/ext/src/Cluster/Builder.c index 97ca0d870..8ada402e3 100644 --- a/ext/src/Cluster/Builder.c +++ b/ext/src/Cluster/Builder.c @@ -1063,15 +1063,25 @@ static zend_function_entry php_driver_cluster_builder_methods[] = { static zend_object_handlers php_driver_cluster_builder_handlers; static HashTable* -php_driver_cluster_builder_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_cluster_builder_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); +#if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else + php_driver_date *self = PHP_DRIVER_GET_DATE(object); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable* +php_driver_cluster_builder_properties(zend_object *object) +#else static HashTable* php_driver_cluster_builder_properties(zval *object TSRMLS_DC) +#endif { php5to7_zval contactPoints; php5to7_zval loadBalancingPolicy; @@ -1107,8 +1117,15 @@ php_driver_cluster_builder_properties(zval *object TSRMLS_DC) php5to7_zval randomizedContactPoints; php5to7_zval connectionHeartbeatInterval; - php_driver_cluster_builder *self = PHP_DRIVER_GET_CLUSTER_BUILDER(object); +#if PHP_VERSION_ID >= 80000 + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_cluster_builder *self = PHP_DRIVER_GET_CLUSTER_BUILDER(&obj_zval); + HashTable *props = zend_std_get_properties(object); +#else + php_driver_ *self = PHP_DRIVER_GET_(object); HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif PHP5TO7_ZVAL_MAYBE_MAKE(contactPoints); PHP5TO7_ZVAL_STRING(PHP5TO7_ZVAL_MAYBE_P(contactPoints), self->contact_points); @@ -1320,57 +1337,52 @@ php_driver_cluster_builder_properties(zval *object TSRMLS_DC) return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_cluster_builder_compare(zval *obj1, zval *obj2 TSRMLS_DC) { if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#endif static void php_driver_cluster_builder_free(php5to7_zend_object_free *object TSRMLS_DC) { - php_driver_cluster_builder *self = - PHP5TO7_ZEND_OBJECT_GET(cluster_builder, object); + php_driver_cluster_builder *self = PHP5TO7_ZEND_OBJECT_GET(cluster_builder, object); - efree(self->contact_points); - self->contact_points = NULL; + if (self->contact_points) { + efree(self->contact_points); + } if (self->local_dc) { efree(self->local_dc); - self->local_dc = NULL; } if (self->username) { efree(self->username); - self->username = NULL; } if (self->password) { efree(self->password); - self->password = NULL; - } - - if (self->whitelist_hosts) { - efree(self->whitelist_hosts); - self->whitelist_hosts = NULL; } if (self->blacklist_hosts) { efree(self->blacklist_hosts); - self->blacklist_hosts = NULL; } - if (self->whitelist_dcs) { - efree(self->whitelist_dcs); - self->whitelist_dcs = NULL; + if (self->whitelist_hosts) { + efree(self->whitelist_hosts); } if (self->blacklist_dcs) { efree(self->blacklist_dcs); - self->whitelist_dcs = NULL; + } + + if (self->whitelist_dcs) { + efree(self->whitelist_dcs); } PHP5TO7_ZVAL_MAYBE_DESTROY(self->ssl_options); @@ -1378,7 +1390,11 @@ php_driver_cluster_builder_free(php5to7_zend_object_free *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_DESTROY(self->retry_policy); PHP5TO7_ZVAL_MAYBE_DESTROY(self->timestamp_gen); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -1425,7 +1441,14 @@ php_driver_cluster_builder_new(zend_class_entry *ce TSRMLS_DC) PHP5TO7_ZVAL_UNDEF(self->retry_policy); PHP5TO7_ZVAL_UNDEF(self->timestamp_gen); +#if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_cluster_builder_handlers; + return &self->std; +#else PHP5TO7_ZEND_OBJECT_INIT(cluster_builder, self, ce); +#endif } void php_driver_define_ClusterBuilder(TSRMLS_D) @@ -1438,9 +1461,11 @@ void php_driver_define_ClusterBuilder(TSRMLS_D) php_driver_cluster_builder_ce->create_object = php_driver_cluster_builder_new; memcpy(&php_driver_cluster_builder_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_cluster_builder_handlers.get_properties = php_driver_cluster_builder_properties; + php_driver_cluster_builder_handlers.get_properties = php_driver_cluster_builder_properties; #if PHP_VERSION_ID >= 50400 - php_driver_cluster_builder_handlers.get_gc = php_driver_cluster_builder_gc; + php_driver_cluster_builder_handlers.get_gc = php_driver_cluster_builder_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_cluster_builder_handlers.compare_objects = php_driver_cluster_builder_compare; +#endif } diff --git a/ext/src/Cluster/Builder.dep b/ext/src/Cluster/Builder.dep new file mode 100644 index 000000000..031018ae1 --- /dev/null +++ b/ext/src/Cluster/Builder.dep @@ -0,0 +1,100 @@ +src/Cluster/Builder.lo: \ + /home/agabadounir/php-cassandra/ext/src/Cluster/Builder.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h php_driver_types.h \ + util/consistency.h /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Collection.c b/ext/src/Collection.c index ceebfee10..541d910f9 100644 --- a/ext/src/Collection.c +++ b/ext/src/Collection.c @@ -255,6 +255,26 @@ PHP_METHOD(Collection, rewind) } /* }}} */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_key, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_next, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rewind, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() +#endif + /* {{{ Collection::remove(key) */ PHP_METHOD(Collection, remove) { @@ -298,13 +318,37 @@ static zend_function_entry php_driver_collection_methods[] = { PHP_ME(Collection, get, arginfo_index, ZEND_ACC_PUBLIC) PHP_ME(Collection, find, arginfo_value, ZEND_ACC_PUBLIC) /* Countable */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Collection, count, arginfo_count, ZEND_ACC_PUBLIC) +#else PHP_ME(Collection, count, arginfo_none, ZEND_ACC_PUBLIC) +#endif /* Iterator */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Collection, current, arginfo_current, ZEND_ACC_PUBLIC) +#else PHP_ME(Collection, current, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Collection, key, arginfo_key, ZEND_ACC_PUBLIC) +#else PHP_ME(Collection, key, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Collection, next, arginfo_next, ZEND_ACC_PUBLIC) +#else PHP_ME(Collection, next, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Collection, valid, arginfo_valid, ZEND_ACC_PUBLIC) +#else PHP_ME(Collection, valid, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Collection, rewind, arginfo_rewind, ZEND_ACC_PUBLIC) +#else PHP_ME(Collection, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#endif PHP_ME(Collection, remove, arginfo_index, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -312,20 +356,36 @@ static zend_function_entry php_driver_collection_methods[] = { static php_driver_value_handlers php_driver_collection_handlers; static HashTable * -php_driver_collection_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_collection_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_collection_properties(zend_object *object) +{ + php5to7_zval values; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_collection *self = PHP_DRIVER_GET_COLLECTION(&obj_zval); + HashTable *props = zend_std_get_properties(object); +#else static HashTable * php_driver_collection_properties(zval *object TSRMLS_DC) { php5to7_zval values; php_driver_collection *self = PHP_DRIVER_GET_COLLECTION(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC); +#endif PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), @@ -340,6 +400,7 @@ php_driver_collection_properties(zval *object TSRMLS_DC) return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_collection_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -383,6 +444,7 @@ php_driver_collection_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 0; } +#endif static unsigned php_driver_collection_hash_value(zval *obj TSRMLS_DC) @@ -413,7 +475,11 @@ php_driver_collection_free(php5to7_zend_object_free *object TSRMLS_DC) zend_hash_destroy(&self->values); PHP5TO7_ZVAL_MAYBE_DESTROY(self->type); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -424,10 +490,18 @@ php_driver_collection_new(zend_class_entry *ce TSRMLS_DC) PHP5TO7_ZEND_OBJECT_ECALLOC(collection, ce); zend_hash_init(&self->values, 0, NULL, ZVAL_PTR_DTOR, 0); - self->dirty = 1; - PHP5TO7_ZVAL_UNDEF(self->type); - PHP5TO7_ZEND_OBJECT_INIT(collection, self, ce); +#if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_collection_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_collection_handlers; + return &self->zval; +#endif } void php_driver_define_Collection(TSRMLS_D) @@ -442,11 +516,15 @@ void php_driver_define_Collection(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_collection_handlers.std.get_gc = php_driver_collection_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_collection_handlers.std.compare_objects = php_driver_collection_compare; +#endif php_driver_collection_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_collection_ce->create_object = php_driver_collection_new; - zend_class_implements(php_driver_collection_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); - + zend_class_implements(php_driver_collection_ce TSRMLS_CC, 2, zend_ce_countable, zend_ce_iterator); + +#if PHP_VERSION_ID < 80000 php_driver_collection_handlers.hash_value = php_driver_collection_hash_value; +#endif php_driver_collection_handlers.std.clone_obj = NULL; } diff --git a/ext/src/Collection.dep b/ext/src/Collection.dep new file mode 100644 index 000000000..5364c2f95 --- /dev/null +++ b/ext/src/Collection.dep @@ -0,0 +1,99 @@ +src/Collection.lo: /home/agabadounir/php-cassandra/ext/src/Collection.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/collections.h util/hash.h util/uthash.h \ + util/types.h /usr/include/php/20230831/Zend/zend_smart_str.h \ + src/Collection.h diff --git a/ext/src/Column.dep b/ext/src/Column.dep new file mode 100644 index 000000000..172098efe --- /dev/null +++ b/ext/src/Column.dep @@ -0,0 +1,96 @@ +src/Column.lo: /home/agabadounir/php-cassandra/ext/src/Column.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Core.dep b/ext/src/Core.dep new file mode 100644 index 000000000..8a2b98501 --- /dev/null +++ b/ext/src/Core.dep @@ -0,0 +1,96 @@ +src/Core.lo: /home/agabadounir/php-cassandra/ext/src/Core.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Custom.dep b/ext/src/Custom.dep new file mode 100644 index 000000000..87eb0efc4 --- /dev/null +++ b/ext/src/Custom.dep @@ -0,0 +1,97 @@ +src/Custom.lo: /home/agabadounir/php-cassandra/ext/src/Custom.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Date.c b/ext/src/Date.c index 91dce9eae..6c510b1f2 100644 --- a/ext/src/Date.c +++ b/ext/src/Date.c @@ -103,7 +103,7 @@ PHP_METHOD(Date, toDateTime) datetime_obj = zend_object_store_get_object(datetime TSRMLS_CC); #endif - str_len = spprintf(&str, 0, "%lld", + str_len = spprintf(&str, 0, "%" LL_FORMAT "d", cass_date_time_to_epoch(self->date, time_obj != NULL ? time_obj->time : 0)); php_date_initialize(datetime_obj, str, str_len, "U", NULL, 0 TSRMLS_CC); @@ -124,11 +124,19 @@ PHP_METHOD(Date, fromDateTime) return; } +#if PHP_VERSION_ID >= 80000 + zend_call_method_with_0_params(Z_OBJ_P(zdatetime), + php_date_get_date_ce(), + NULL, + "gettimestamp", + &retval); +#else zend_call_method_with_0_params(PHP5TO7_ZVAL_MAYBE_ADDR_OF(zdatetime), php_date_get_date_ce(), NULL, "gettimestamp", &retval); +#endif if (!PHP5TO7_ZVAL_IS_UNDEF(retval) && Z_TYPE_P(PHP5TO7_ZVAL_MAYBE_P(retval)) == IS_LONG) { @@ -142,6 +150,9 @@ PHP_METHOD(Date, fromDateTime) /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Date::__toString() */ PHP_METHOD(Date, __toString) { @@ -154,7 +165,7 @@ PHP_METHOD(Date, __toString) self = PHP_DRIVER_GET_DATE(getThis()); - spprintf(&ret, 0, PHP_DRIVER_NAMESPACE "\\Date(seconds=%lld)", cass_date_time_to_epoch(self->date, 0)); + spprintf(&ret, 0, PHP_DRIVER_NAMESPACE "\\Date(seconds=%\" LL_FORMAT \"d)", cass_date_time_to_epoch(self->date, 0)); PHP5TO7_RETVAL_STRING(ret); efree(ret); } @@ -181,28 +192,44 @@ static zend_function_entry php_driver_date_methods[] = { PHP_ME(Date, seconds, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Date, toDateTime, arginfo_time, ZEND_ACC_PUBLIC) PHP_ME(Date, fromDateTime, arginfo_datetime, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Date, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Date, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_FE_END }; static php_driver_value_handlers php_driver_date_handlers; static HashTable * -php_driver_date_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_date_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; +#if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_date_properties(zend_object *object) +#else static HashTable * php_driver_date_properties(zval *object TSRMLS_DC) +#endif { php5to7_zval type; php5to7_zval seconds; +#if PHP_VERSION_ID >= 80000 + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_date *self = PHP_DRIVER_GET_DATE(&obj_zval); + HashTable *props = zend_std_get_properties(object); +#else php_driver_date *self = PHP_DRIVER_GET_DATE(object); HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif type = php_driver_type_scalar(CASS_VALUE_TYPE_DATE TSRMLS_CC); PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); @@ -214,6 +241,7 @@ php_driver_date_properties(zval *object TSRMLS_DC) return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_date_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -227,6 +255,7 @@ php_driver_date_compare(zval *obj1, zval *obj2 TSRMLS_DC) return PHP_DRIVER_COMPARE(date1->date, date2->date); } +#endif static unsigned php_driver_date_hash_value(zval *obj TSRMLS_DC) @@ -235,6 +264,7 @@ php_driver_date_hash_value(zval *obj TSRMLS_DC) return 31 * 17 + self->date; } +#if PHP_VERSION_ID < 80000 static void php_driver_date_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -243,6 +273,7 @@ php_driver_date_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_date_new(zend_class_entry *ce TSRMLS_DC) @@ -252,7 +283,17 @@ php_driver_date_new(zend_class_entry *ce TSRMLS_DC) self->date = 0; - PHP5TO7_ZEND_OBJECT_INIT(date, self, ce); +#if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_date_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_date_handlers; + return &self->zval; +#endif } void php_driver_define_Date(TSRMLS_D) @@ -267,9 +308,12 @@ void php_driver_define_Date(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_date_handlers.std.get_gc = php_driver_date_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_date_handlers.std.compare_objects = php_driver_date_compare; +#endif php_driver_date_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_date_ce->create_object = php_driver_date_new; - +#if PHP_VERSION_ID < 80000 php_driver_date_handlers.hash_value = php_driver_date_hash_value; -} +#endif +} \ No newline at end of file diff --git a/ext/src/Date.dep b/ext/src/Date.dep new file mode 100644 index 000000000..0b61d83a6 --- /dev/null +++ b/ext/src/Date.dep @@ -0,0 +1,102 @@ +src/Date.lo: /home/agabadounir/php-cassandra/ext/src/Date.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /usr/include/php/20230831/ext/date/php_date.h \ + /usr/include/php/20230831/ext/date/lib/timelib.h \ + /usr/include/php/20230831/ext/date/lib/timelib_config.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/main/php_version.h diff --git a/ext/src/Decimal.c b/ext/src/Decimal.c index 916afc148..0bb6b9af1 100644 --- a/ext/src/Decimal.c +++ b/ext/src/Decimal.c @@ -112,12 +112,8 @@ from_double(php_driver_numeric *result, double value) mantissa >>= 1; } - /* There isn't any "long long" setter method */ -#ifdef _WIN32 - sprintf(mantissa_str, "%I64d", mantissa); -#else - sprintf(mantissa_str, "%lld", mantissa); -#endif + /* Use portable 64-bit printf format */ + sprintf(mantissa_str, LL_FORMAT, (long long)mantissa); mpz_set_str(result->data.decimal.value, mantissa_str, 10); /* Change the sign if negative */ @@ -270,6 +266,9 @@ PHP_METHOD(Decimal, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Decimal::__toString() */ PHP_METHOD(Decimal, __toString) { @@ -492,7 +491,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_decimal_methods[] = { PHP_ME(Decimal, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Decimal, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Decimal, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Decimal, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Decimal, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Decimal, scale, arginfo_none, ZEND_ACC_PUBLIC) @@ -511,12 +510,35 @@ static zend_function_entry php_driver_decimal_methods[] = { static php_driver_value_handlers php_driver_decimal_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable* +php_driver_decimal_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} + +static HashTable* +php_driver_decimal_properties(zend_object *object) +{ + char* string; + int string_len; + php5to7_zval type; + php5to7_zval value; + php5to7_zval scale; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zval); + HashTable *props = zend_std_get_properties(object); +#else static HashTable* php_driver_decimal_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC); } static HashTable* @@ -529,7 +551,8 @@ php_driver_decimal_properties(zval *object TSRMLS_DC) php5to7_zval scale; php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC); +#endif type = php_driver_type_scalar(CASS_VALUE_TYPE_DECIMAL TSRMLS_CC); PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); @@ -547,6 +570,7 @@ php_driver_decimal_properties(zval *object TSRMLS_DC) return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_decimal_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -567,6 +591,7 @@ php_driver_decimal_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 1; } } +#endif static unsigned php_driver_decimal_hash_value(zval *obj TSRMLS_DC) @@ -575,6 +600,28 @@ php_driver_decimal_hash_value(zval *obj TSRMLS_DC) return php_driver_mpz_hash((unsigned)self->data.decimal.scale, self->data.decimal.value); } +#if PHP_VERSION_ID >= 80000 +static int +php_driver_decimal_cast_object(zend_object *object, zval *retval, int type) +{ + zval obj_zv; + ZVAL_OBJ(&obj_zv, object); + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zv); + + switch (type) { + case IS_LONG: + return to_long(retval, self TSRMLS_CC); + case IS_DOUBLE: + return to_double(retval, self TSRMLS_CC); + case IS_STRING: + return to_string(retval, self TSRMLS_CC); + default: + return FAILURE; + } + + return SUCCESS; +} +#else static int php_driver_decimal_cast(zval *object, zval *retval, int type TSRMLS_DC) { @@ -593,17 +640,26 @@ php_driver_decimal_cast(zval *object, zval *retval, int type TSRMLS_DC) return SUCCESS; } +#endif +#if PHP_VERSION_ID >= 80000 +static void php_driver_decimal_free_obj(zend_object *object) +{ + php_driver_numeric *self = php_driver_numeric_object_fetch(object); + mpz_clear(self->data.decimal.value); + zend_object_std_dtor(object); +} +#else static void php_driver_decimal_free(php5to7_zend_object_free *object TSRMLS_DC) { php_driver_numeric *self = PHP5TO7_ZEND_OBJECT_GET(numeric, object); mpz_clear(self->data.decimal.value); - zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_decimal_new(zend_class_entry *ce TSRMLS_DC) @@ -615,7 +671,17 @@ php_driver_decimal_new(zend_class_entry *ce TSRMLS_DC) self->data.decimal.scale = 0; mpz_init(self->data.decimal.value); - PHP5TO7_ZEND_OBJECT_INIT_EX(numeric, decimal, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_decimal_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_decimal_handlers; + return &self->zval; +#endif } void php_driver_define_Decimal(TSRMLS_D) @@ -633,9 +699,17 @@ void php_driver_define_Decimal(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_decimal_handlers.std.get_gc = php_driver_decimal_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_decimal_handlers.std.compare_objects = php_driver_decimal_compare; +#endif + /* Assign cast and free handlers based on PHP version */ +#if PHP_VERSION_ID >= 80000 + php_driver_decimal_handlers.std.cast_object = php_driver_decimal_cast_object; + php_driver_decimal_handlers.std.free_obj = php_driver_decimal_free_obj; +#else php_driver_decimal_handlers.std.cast_object = php_driver_decimal_cast; +#endif php_driver_decimal_handlers.hash_value = php_driver_decimal_hash_value; php_driver_decimal_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Decimal.dep b/ext/src/Decimal.dep new file mode 100644 index 000000000..e5e3d0c84 --- /dev/null +++ b/ext/src/Decimal.dep @@ -0,0 +1,98 @@ +src/Decimal.lo: /home/agabadounir/php-cassandra/ext/src/Decimal.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/DefaultAggregate.c b/ext/src/DefaultAggregate.c index 57c6036a5..d44f033b1 100644 --- a/ext/src/DefaultAggregate.c +++ b/ext/src/DefaultAggregate.c @@ -214,17 +214,31 @@ static zend_function_entry php_driver_default_aggregate_methods[] = { static zend_object_handlers php_driver_default_aggregate_handlers; static HashTable * -php_driver_type_default_aggregate_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_aggregate_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_aggregate_properties(zend_object *object) +#else static HashTable * php_driver_default_aggregate_properties(zval *object TSRMLS_DC) +#endif { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = +#if PHP_VERSION_ID >= 80000 + zend_std_get_properties(object); +#else + zend_std_get_properties(object TSRMLS_CC); +#endif return props; } @@ -235,9 +249,32 @@ php_driver_default_aggregate_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 +static void php_driver_default_aggregate_free_obj(zend_object *object) +{ + php_driver_aggregate *self = php_driver_aggregate_object_fetch(object); + + PHP5TO7_ZVAL_MAYBE_DESTROY(self->simple_name); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->argument_types); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->state_function); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->final_function); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->initial_condition); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->state_type); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->return_type); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->signature); + + if (self->schema) { + php_driver_del_ref(&self->schema); + self->schema = NULL; + } + self->meta = NULL; + + zend_object_std_dtor(object); +} +#else static void php_driver_default_aggregate_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -261,6 +298,7 @@ php_driver_default_aggregate_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_default_aggregate_new(zend_class_entry *ce TSRMLS_DC) @@ -279,8 +317,14 @@ php_driver_default_aggregate_new(zend_class_entry *ce TSRMLS_DC) self->schema = NULL; self->meta = NULL; - +#if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_default_aggregate_handlers; + return &self->std; +#else PHP5TO7_ZEND_OBJECT_INIT_EX(aggregate, default_aggregate, self, ce); +#endif } void php_driver_define_DefaultAggregate(TSRMLS_D) @@ -294,10 +338,16 @@ void php_driver_define_DefaultAggregate(TSRMLS_D) php_driver_default_aggregate_ce->create_object = php_driver_default_aggregate_new; memcpy(&php_driver_default_aggregate_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_aggregate_handlers.get_properties = php_driver_default_aggregate_properties; + php_driver_default_aggregate_handlers.get_properties = php_driver_default_aggregate_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_aggregate_handlers.get_gc = php_driver_type_default_aggregate_gc; + php_driver_default_aggregate_handlers.get_gc = php_driver_type_default_aggregate_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_default_aggregate_handlers.compare_objects = php_driver_default_aggregate_compare; +#endif + /* Set free_obj for PHP 8+ */ +#if PHP_VERSION_ID >= 80000 + php_driver_default_aggregate_handlers.free_obj = php_driver_default_aggregate_free_obj; +#endif php_driver_default_aggregate_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultAggregate.dep b/ext/src/DefaultAggregate.dep new file mode 100644 index 000000000..b86c00783 --- /dev/null +++ b/ext/src/DefaultAggregate.dep @@ -0,0 +1,99 @@ +src/DefaultAggregate.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultAggregate.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/ref.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultFunction.h diff --git a/ext/src/DefaultCluster.c b/ext/src/DefaultCluster.c index 8f88d4191..72757c9d2 100644 --- a/ext/src/DefaultCluster.c +++ b/ext/src/DefaultCluster.c @@ -217,10 +217,20 @@ static zend_function_entry php_driver_default_cluster_methods[] = { static zend_object_handlers php_driver_default_cluster_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_cluster_properties(zend_object *object) +#else static HashTable * php_driver_default_cluster_properties(zval *object TSRMLS_DC) +#endif { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = +#if PHP_VERSION_ID >= 80000 + zend_std_get_properties(object); +#else + zend_std_get_properties(object TSRMLS_CC); +#endif return props; } @@ -231,9 +241,27 @@ php_driver_default_cluster_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 +static void php_driver_default_cluster_free_obj(zend_object *object) +{ + php_driver_cluster *self = php_driver_cluster_object_fetch(object); + + if (self->persist) { + efree(self->hash_key); + } else { + if (self->cluster) { + cass_cluster_free(self->cluster); + } + } + + PHP5TO7_ZVAL_MAYBE_DESTROY(self->default_timeout); + + zend_object_std_dtor(object); +} +#else static void php_driver_default_cluster_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -252,6 +280,7 @@ php_driver_default_cluster_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_default_cluster_new(zend_class_entry *ce TSRMLS_DC) @@ -267,7 +296,14 @@ php_driver_default_cluster_new(zend_class_entry *ce TSRMLS_DC) PHP5TO7_ZVAL_UNDEF(self->default_timeout); +#if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_default_cluster_handlers; + return &self->std; +#else PHP5TO7_ZEND_OBJECT_INIT_EX(cluster, default_cluster, self, ce); +#endif } void php_driver_define_DefaultCluster(TSRMLS_D) @@ -281,6 +317,11 @@ void php_driver_define_DefaultCluster(TSRMLS_D) php_driver_default_cluster_ce->create_object = php_driver_default_cluster_new; memcpy(&php_driver_default_cluster_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_cluster_handlers.get_properties = php_driver_default_cluster_properties; + php_driver_default_cluster_handlers.get_properties = php_driver_default_cluster_properties; +#if PHP_VERSION_ID < 80000 php_driver_default_cluster_handlers.compare_objects = php_driver_default_cluster_compare; +#endif +#if PHP_VERSION_ID >= 80000 + php_driver_default_cluster_handlers.free_obj = php_driver_default_cluster_free_obj; +#endif } diff --git a/ext/src/DefaultCluster.dep b/ext/src/DefaultCluster.dep new file mode 100644 index 000000000..cf7db7dc6 --- /dev/null +++ b/ext/src/DefaultCluster.dep @@ -0,0 +1,100 @@ +src/DefaultCluster.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultCluster.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h php_driver_types.h \ + util/future.h util/ref.h diff --git a/ext/src/DefaultColumn.c b/ext/src/DefaultColumn.c index a990a6e03..54a10012a 100644 --- a/ext/src/DefaultColumn.c +++ b/ext/src/DefaultColumn.c @@ -221,17 +221,31 @@ static zend_function_entry php_driver_default_column_methods[] = { static zend_object_handlers php_driver_default_column_handlers; static HashTable * -php_driver_type_default_column_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_column_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_column_properties(zend_object *object) +#else static HashTable * php_driver_default_column_properties(zval *object TSRMLS_DC) +#endif { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = +#if PHP_VERSION_ID >= 80000 + zend_std_get_properties(object); +#else + zend_std_get_properties(object TSRMLS_CC); +#endif return props; } @@ -242,9 +256,26 @@ php_driver_default_column_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 +static void php_driver_default_column_free_obj(zend_object *object) +{ + php_driver_column *self = php_driver_column_object_fetch(object); + + PHP5TO7_ZVAL_MAYBE_DESTROY(self->name); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->type); + + if (self->schema) { + php_driver_del_ref(&self->schema); + self->schema = NULL; + } + self->meta = NULL; + + zend_object_std_dtor(object); +} +#else static void php_driver_default_column_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -262,6 +293,7 @@ php_driver_default_column_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_default_column_new(zend_class_entry *ce TSRMLS_DC) @@ -290,10 +322,17 @@ void php_driver_define_DefaultColumn(TSRMLS_D) php_driver_default_column_ce->create_object = php_driver_default_column_new; memcpy(&php_driver_default_column_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_column_handlers.get_properties = php_driver_default_column_properties; + php_driver_default_column_handlers.get_properties = php_driver_default_column_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_column_handlers.get_gc = php_driver_type_default_column_gc; + php_driver_default_column_handlers.get_gc = php_driver_type_default_column_gc; #endif + /* compare_objects was removed in PHP 8 */ +#if PHP_VERSION_ID < 80000 php_driver_default_column_handlers.compare_objects = php_driver_default_column_compare; +#endif + /* Set free_obj for PHP 8+ */ +#if PHP_VERSION_ID >= 80000 + php_driver_default_column_handlers.free_obj = php_driver_default_column_free_obj; +#endif php_driver_default_column_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultColumn.dep b/ext/src/DefaultColumn.dep new file mode 100644 index 000000000..871e9d5b6 --- /dev/null +++ b/ext/src/DefaultColumn.dep @@ -0,0 +1,99 @@ +src/DefaultColumn.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultColumn.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h util/ref.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultColumn.h diff --git a/ext/src/DefaultFunction.c b/ext/src/DefaultFunction.c index fd9a696d3..deb7edd89 100644 --- a/ext/src/DefaultFunction.c +++ b/ext/src/DefaultFunction.c @@ -207,17 +207,30 @@ static zend_function_entry php_driver_default_function_methods[] = { static zend_object_handlers php_driver_default_function_handlers; static HashTable * -php_driver_type_default_function_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_function_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_function_properties(zend_object *object) +#else static HashTable * php_driver_default_function_properties(zval *object TSRMLS_DC) +#endif { +#if PHP_VERSION_ID >= 80000 + HashTable *props = zend_std_get_properties(object); +#else HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif return props; } @@ -228,9 +241,31 @@ php_driver_default_function_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 +static void +php_driver_default_function_free(zend_object *object) +{ + php_driver_function *self = php_driver_function_object_fetch(object); + + PHP5TO7_ZVAL_MAYBE_DESTROY(self->simple_name); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->arguments); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->return_type); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->signature); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->language); + PHP5TO7_ZVAL_MAYBE_DESTROY(self->body); + + if (self->schema) { + php_driver_del_ref(&self->schema); + self->schema = NULL; + } + self->meta = NULL; + + zend_object_std_dtor(&self->std); +} +#else static void php_driver_default_function_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -252,7 +287,33 @@ php_driver_default_function_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_default_function_new(zend_class_entry *ce) +{ + php_driver_function *self = + (php_driver_function *) zend_object_alloc(sizeof(php_driver_function), ce); + + PHP5TO7_ZVAL_UNDEF(self->simple_name); + PHP5TO7_ZVAL_UNDEF(self->arguments); + PHP5TO7_ZVAL_UNDEF(self->return_type); + PHP5TO7_ZVAL_UNDEF(self->signature); + PHP5TO7_ZVAL_UNDEF(self->language); + PHP5TO7_ZVAL_UNDEF(self->body); + + self->schema = NULL; + self->meta = NULL; + + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_default_function_handlers; + + return &self->std; +} +#else static php5to7_zend_object php_driver_default_function_new(zend_class_entry *ce TSRMLS_DC) { @@ -271,6 +332,7 @@ php_driver_default_function_new(zend_class_entry *ce TSRMLS_DC) PHP5TO7_ZEND_OBJECT_INIT_EX(function, default_function, self, ce); } +#endif void php_driver_define_DefaultFunction(TSRMLS_D) { @@ -283,10 +345,17 @@ void php_driver_define_DefaultFunction(TSRMLS_D) php_driver_default_function_ce->create_object = php_driver_default_function_new; memcpy(&php_driver_default_function_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_function_handlers.get_properties = php_driver_default_function_properties; + php_driver_default_function_handlers.get_properties = php_driver_default_function_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_function_handlers.get_gc = php_driver_type_default_function_gc; + php_driver_default_function_handlers.get_gc = php_driver_type_default_function_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_default_function_handlers.compare_objects = php_driver_default_function_compare; +#else + /* PHP 8+: do not set compare_objects; use default */ +#endif php_driver_default_function_handlers.clone_obj = NULL; +#if PHP_VERSION_ID >= 80000 + php_driver_default_function_handlers.free_obj = php_driver_default_function_free; +#endif } diff --git a/ext/src/DefaultFunction.dep b/ext/src/DefaultFunction.dep new file mode 100644 index 000000000..564f29193 --- /dev/null +++ b/ext/src/DefaultFunction.dep @@ -0,0 +1,99 @@ +src/DefaultFunction.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultFunction.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/ref.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultFunction.h diff --git a/ext/src/DefaultIndex.c b/ext/src/DefaultIndex.c index 83fc5851a..3d545ffcb 100644 --- a/ext/src/DefaultIndex.c +++ b/ext/src/DefaultIndex.c @@ -235,17 +235,30 @@ static zend_function_entry php_driver_default_index_methods[] = { static zend_object_handlers php_driver_default_index_handlers; static HashTable * -php_driver_type_default_index_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_index_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_index_properties(zend_object *object) +#else static HashTable * php_driver_default_index_properties(zval *object TSRMLS_DC) +#endif { + #if PHP_VERSION_ID >= 80000 + HashTable *props = zend_std_get_properties(object); + #else HashTable *props = zend_std_get_properties(object TSRMLS_CC); + #endif return props; } @@ -256,7 +269,7 @@ php_driver_default_index_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -275,7 +288,11 @@ php_driver_default_index_free(php5to7_zend_object_free *object TSRMLS_DC) } self->meta = NULL; + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); + #else zend_object_std_dtor(&self->zval TSRMLS_CC); + #endif PHP5TO7_MAYBE_EFREE(self); } @@ -307,10 +324,14 @@ void php_driver_define_DefaultIndex(TSRMLS_D) php_driver_default_index_ce->create_object = php_driver_default_index_new; memcpy(&php_driver_default_index_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_index_handlers.get_properties = php_driver_default_index_properties; + php_driver_default_index_handlers.get_properties = php_driver_default_index_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_index_handlers.get_gc = php_driver_type_default_index_gc; + php_driver_default_index_handlers.get_gc = php_driver_type_default_index_gc; #endif + #if PHP_VERSION_ID < 80000 php_driver_default_index_handlers.compare_objects = php_driver_default_index_compare; + #else + /* PHP 8+: do not set compare_objects; use default */ + #endif php_driver_default_index_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultIndex.dep b/ext/src/DefaultIndex.dep new file mode 100644 index 000000000..b9da5404a --- /dev/null +++ b/ext/src/DefaultIndex.dep @@ -0,0 +1,99 @@ +src/DefaultIndex.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultIndex.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/ref.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultIndex.h diff --git a/ext/src/DefaultKeyspace.c b/ext/src/DefaultKeyspace.c index 4e6af2350..f220d6df2 100644 --- a/ext/src/DefaultKeyspace.c +++ b/ext/src/DefaultKeyspace.c @@ -516,17 +516,30 @@ static zend_function_entry php_driver_default_keyspace_methods[] = { static zend_object_handlers php_driver_default_keyspace_handlers; static HashTable * -php_driver_type_default_keyspace_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_keyspace_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_keyspace_properties(zend_object *object) +#else static HashTable * php_driver_default_keyspace_properties(zval *object TSRMLS_DC) +#endif { + #if PHP_VERSION_ID >= 80000 + HashTable *props = zend_std_get_properties(object); + #else HashTable *props = zend_std_get_properties(object TSRMLS_CC); + #endif return props; } @@ -537,7 +550,7 @@ php_driver_default_keyspace_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -551,7 +564,11 @@ php_driver_default_keyspace_free(php5to7_zend_object_free *object TSRMLS_DC) } self->meta = NULL; + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); + #else zend_object_std_dtor(&self->zval TSRMLS_CC); + #endif PHP5TO7_MAYBE_EFREE(self); } @@ -578,10 +595,14 @@ void php_driver_define_DefaultKeyspace(TSRMLS_D) php_driver_default_keyspace_ce->create_object = php_driver_default_keyspace_new; memcpy(&php_driver_default_keyspace_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_keyspace_handlers.get_properties = php_driver_default_keyspace_properties; + php_driver_default_keyspace_handlers.get_properties = php_driver_default_keyspace_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_keyspace_handlers.get_gc = php_driver_type_default_keyspace_gc; + php_driver_default_keyspace_handlers.get_gc = php_driver_type_default_keyspace_gc; #endif + #if PHP_VERSION_ID < 80000 php_driver_default_keyspace_handlers.compare_objects = php_driver_default_keyspace_compare; + #else + /* PHP 8+: do not set compare_objects; use default */ + #endif php_driver_default_keyspace_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultKeyspace.dep b/ext/src/DefaultKeyspace.dep new file mode 100644 index 000000000..5b3325f12 --- /dev/null +++ b/ext/src/DefaultKeyspace.dep @@ -0,0 +1,101 @@ +src/DefaultKeyspace.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultKeyspace.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/ref.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultFunction.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultMaterializedView.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultTable.h diff --git a/ext/src/DefaultMaterializedView.c b/ext/src/DefaultMaterializedView.c index a1bb2e26b..def2f3d18 100644 --- a/ext/src/DefaultMaterializedView.c +++ b/ext/src/DefaultMaterializedView.c @@ -578,17 +578,30 @@ static zend_function_entry php_driver_default_materialized_view_methods[] = { static zend_object_handlers php_driver_default_materialized_view_handlers; static HashTable * -php_driver_type_default_materialized_view_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_materialized_view_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_materialized_view_properties(zend_object *object) +#else static HashTable * php_driver_default_materialized_view_properties(zval *object TSRMLS_DC) +#endif { + #if PHP_VERSION_ID >= 80000 + HashTable *props = zend_std_get_properties(object); + #else HashTable *props = zend_std_get_properties(object TSRMLS_CC); + #endif return props; } @@ -599,7 +612,7 @@ php_driver_default_materialized_view_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -621,7 +634,11 @@ php_driver_default_materialized_view_free(php5to7_zend_object_free *object TSRML } self->meta = NULL; + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); + #else zend_object_std_dtor(&self->zval TSRMLS_CC); + #endif PHP5TO7_MAYBE_EFREE(self); } @@ -655,10 +672,13 @@ void php_driver_define_DefaultMaterializedView(TSRMLS_D) php_driver_default_materialized_view_ce->create_object = php_driver_default_materialized_view_new; memcpy(&php_driver_default_materialized_view_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_materialized_view_handlers.get_properties = php_driver_default_materialized_view_properties; + php_driver_default_materialized_view_handlers.get_properties = php_driver_default_materialized_view_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_materialized_view_handlers.get_gc = php_driver_type_default_materialized_view_gc; + php_driver_default_materialized_view_handlers.get_gc = php_driver_type_default_materialized_view_gc; #endif + /* compare_objects was removed in PHP 8 */ +#if PHP_VERSION_ID < 80000 php_driver_default_materialized_view_handlers.compare_objects = php_driver_default_materialized_view_compare; +#endif php_driver_default_materialized_view_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultMaterializedView.dep b/ext/src/DefaultMaterializedView.dep new file mode 100644 index 000000000..d878442bb --- /dev/null +++ b/ext/src/DefaultMaterializedView.dep @@ -0,0 +1,103 @@ +src/DefaultMaterializedView.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultMaterializedView.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/ref.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultColumn.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultIndex.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultTable.h \ + /home/agabadounir/php-cassandra/ext/src/Table.h diff --git a/ext/src/DefaultSchema.c b/ext/src/DefaultSchema.c index c64485546..d1f6a9396 100644 --- a/ext/src/DefaultSchema.c +++ b/ext/src/DefaultSchema.c @@ -112,8 +112,13 @@ static zend_function_entry php_driver_default_schema_methods[] = { static zend_object_handlers php_driver_default_schema_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_schema_properties(zend_object *object) +#else static HashTable * php_driver_default_schema_properties(zval *object TSRMLS_DC) +#endif { HashTable *props = zend_std_get_properties(object TSRMLS_CC); @@ -126,7 +131,7 @@ php_driver_default_schema_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -139,7 +144,11 @@ php_driver_default_schema_free(php5to7_zend_object_free *object TSRMLS_DC) self->schema = NULL; } +#if PHP_MAJOR_VERSION >= 7 + zend_object_std_dtor((zend_object*)object TSRMLS_CC); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -165,7 +174,11 @@ void php_driver_define_DefaultSchema(TSRMLS_D) php_driver_default_schema_ce->create_object = php_driver_default_schema_new; memcpy(&php_driver_default_schema_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_schema_handlers.get_properties = php_driver_default_schema_properties; + php_driver_default_schema_handlers.free_obj = php_driver_default_schema_free; + php_driver_default_schema_handlers.get_properties = php_driver_default_schema_properties; + /* compare_objects was removed in PHP 8 */ +#if PHP_VERSION_ID < 80000 php_driver_default_schema_handlers.compare_objects = php_driver_default_schema_compare; +#endif php_driver_default_schema_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultSchema.dep b/ext/src/DefaultSchema.dep new file mode 100644 index 000000000..13a11eed6 --- /dev/null +++ b/ext/src/DefaultSchema.dep @@ -0,0 +1,97 @@ +src/DefaultSchema.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultSchema.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/ref.h diff --git a/ext/src/DefaultSession.c b/ext/src/DefaultSession.c index 4fea3fbd4..8539081bf 100644 --- a/ext/src/DefaultSession.c +++ b/ext/src/DefaultSession.c @@ -1069,10 +1069,34 @@ static zend_function_entry php_driver_default_session_methods[] = { static zend_object_handlers php_driver_default_session_handlers; +#if PHP_VERSION_ID >= 50400 +static HashTable * +php_driver_type_default_session_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; +#if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else + return zend_std_get_properties(object TSRMLS_CC); +#endif +} +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_session_properties(zend_object *object) +#else static HashTable * php_driver_default_session_properties(zval *object TSRMLS_DC) +#endif { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props; +#if PHP_VERSION_ID >= 80000 + props = zend_std_get_properties(object); +#else + props = zend_std_get_properties(object TSRMLS_CC); +#endif return props; } @@ -1083,7 +1107,7 @@ php_driver_default_session_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -1094,7 +1118,11 @@ php_driver_default_session_free(php5to7_zend_object_free *object TSRMLS_DC) php_driver_del_peref(&self->session, 1); PHP5TO7_ZVAL_MAYBE_DESTROY(self->default_timeout); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -1124,7 +1152,12 @@ void php_driver_define_DefaultSession(TSRMLS_D) php_driver_default_session_ce->create_object = php_driver_default_session_new; memcpy(&php_driver_default_session_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_session_handlers.get_properties = php_driver_default_session_properties; + php_driver_default_session_handlers.get_properties = php_driver_default_session_properties; +#if PHP_VERSION_ID >= 50400 + php_driver_default_session_handlers.get_gc = php_driver_type_default_session_gc; +#endif +#if PHP_VERSION_ID < 80000 php_driver_default_session_handlers.compare_objects = php_driver_default_session_compare; +#endif php_driver_default_session_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultSession.dep b/ext/src/DefaultSession.dep new file mode 100644 index 000000000..98ca40451 --- /dev/null +++ b/ext/src/DefaultSession.dep @@ -0,0 +1,99 @@ +src/DefaultSession.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultSession.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/bytes.h util/future.h util/result.h util/ref.h \ + util/math.h util/collections.h \ + /home/agabadounir/php-cassandra/ext/src/ExecutionOptions.h diff --git a/ext/src/DefaultTable.c b/ext/src/DefaultTable.c index 82f20306f..f210da006 100644 --- a/ext/src/DefaultTable.c +++ b/ext/src/DefaultTable.c @@ -383,7 +383,7 @@ PHP_METHOD(DefaultTable, column) self = PHP_DRIVER_GET_TABLE(getThis()); meta = cass_table_meta_column_by_name(self->meta, name); if (meta == NULL) { - RETURN_FALSE + RETURN_FALSE; } column = php_driver_create_column(self->schema, meta TSRMLS_CC); @@ -686,19 +686,30 @@ static zend_function_entry php_driver_default_table_methods[] = { static zend_object_handlers php_driver_default_table_handlers; static HashTable * -php_driver_type_default_table_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_default_table_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_default_table_properties(zend_object *object) +#else static HashTable * php_driver_default_table_properties(zval *object TSRMLS_DC) +#endif { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; +#if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else + return zend_std_get_properties(object TSRMLS_CC); +#endif } static int @@ -707,7 +718,7 @@ php_driver_default_table_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -728,7 +739,11 @@ php_driver_default_table_free(php5to7_zend_object_free *object TSRMLS_DC) } self->meta = NULL; +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -762,10 +777,14 @@ void php_driver_define_DefaultTable(TSRMLS_D) php_driver_default_table_ce->create_object = php_driver_default_table_new; memcpy(&php_driver_default_table_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_default_table_handlers.get_properties = php_driver_default_table_properties; + php_driver_default_table_handlers.get_properties = php_driver_default_table_properties; #if PHP_VERSION_ID >= 50400 - php_driver_default_table_handlers.get_gc = php_driver_type_default_table_gc; + php_driver_default_table_handlers.get_gc = php_driver_type_default_table_gc; #endif + #if PHP_VERSION_ID < 80000 php_driver_default_table_handlers.compare_objects = php_driver_default_table_compare; + #else + /* PHP 8+: do not set compare_objects; use default */ + #endif php_driver_default_table_handlers.clone_obj = NULL; } diff --git a/ext/src/DefaultTable.dep b/ext/src/DefaultTable.dep new file mode 100644 index 000000000..f18e278a7 --- /dev/null +++ b/ext/src/DefaultTable.dep @@ -0,0 +1,102 @@ +src/DefaultTable.lo: \ + /home/agabadounir/php-cassandra/ext/src/DefaultTable.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/result.h util/ref.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultColumn.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultMaterializedView.h \ + /home/agabadounir/php-cassandra/ext/src/DefaultIndex.h \ + /home/agabadounir/php-cassandra/ext/src/Table.h diff --git a/ext/src/Duration.c b/ext/src/Duration.c index efa574d89..f3bc53b98 100644 --- a/ext/src/Duration.c +++ b/ext/src/Duration.c @@ -149,6 +149,9 @@ PHP_METHOD(Duration, __construct) php_driver_duration_init(INTERNAL_FUNCTION_PARAM_PASSTHRU); } +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + PHP_METHOD(Duration, __toString) { char* rep; @@ -219,12 +222,30 @@ static zend_function_entry php_driver_duration_methods[] = { PHP_ME(Duration, months, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Duration, days, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Duration, nanos, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Duration, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Duration, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_FE_END }; static php_driver_value_handlers php_driver_duration_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_duration_properties(zend_object *object) +{ + HashTable *props = zend_std_get_properties(object); + php_driver_duration *self = php_driver_duration_object_fetch(object); + + zval wrapped_months, wrapped_days, wrapped_nanos; + ZVAL_LONG(&wrapped_months, self->months); + ZVAL_LONG(&wrapped_days, self->days); + ZVAL_LONG(&wrapped_nanos, self->nanos); + zend_hash_str_update(props, "months", sizeof("months") - 1, &wrapped_months); + zend_hash_str_update(props, "days", sizeof("days") - 1, &wrapped_days); + zend_hash_str_update(props, "nanos", sizeof("nanos") - 1, &wrapped_nanos); + + return props; +} +#else static HashTable * php_driver_duration_properties(zval *object TSRMLS_DC) { @@ -244,7 +265,9 @@ php_driver_duration_properties(zval *object TSRMLS_DC) return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_duration_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -277,6 +300,7 @@ php_driver_duration_compare(zval *obj1, zval *obj2 TSRMLS_DC) return (left->nanos == right->nanos) ? 0 : 1; } +#endif static unsigned php_driver_duration_hash_value(zval *obj TSRMLS_DC) @@ -291,6 +315,7 @@ php_driver_duration_hash_value(zval *obj TSRMLS_DC) return hashv; } +#if PHP_VERSION_ID < 80000 static void php_driver_duration_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -298,15 +323,30 @@ php_driver_duration_free(php5to7_zend_object_free *object TSRMLS_DC) /* Clean up */ + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_duration_new(zend_class_entry *ce TSRMLS_DC) { php_driver_duration *self = PHP5TO7_ZEND_OBJECT_ECALLOC(duration, ce); - PHP5TO7_ZEND_OBJECT_INIT(duration, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_duration_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_duration_handlers; + return &self->zval; +#endif } void php_driver_define_Duration(TSRMLS_D) @@ -322,8 +362,10 @@ void php_driver_define_Duration(TSRMLS_D) memcpy(&php_driver_duration_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_driver_duration_handlers.std.get_properties = php_driver_duration_properties; +#if PHP_VERSION_ID < 80000 php_driver_duration_handlers.std.compare_objects = php_driver_duration_compare; +#endif php_driver_duration_handlers.hash_value = php_driver_duration_hash_value; php_driver_duration_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Duration.dep b/ext/src/Duration.dep new file mode 100644 index 000000000..6e67ff47e --- /dev/null +++ b/ext/src/Duration.dep @@ -0,0 +1,102 @@ +src/Duration.lo: /home/agabadounir/php-cassandra/ext/src/Duration.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h php_driver_types.h \ + util/hash.h util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/Duration.h diff --git a/ext/src/Exception.dep b/ext/src/Exception.dep new file mode 100644 index 000000000..486b1b8f6 --- /dev/null +++ b/ext/src/Exception.dep @@ -0,0 +1,96 @@ +src/Exception.lo: /home/agabadounir/php-cassandra/ext/src/Exception.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Exception/AlreadyExistsException.dep b/ext/src/Exception/AlreadyExistsException.dep new file mode 100644 index 000000000..bb1809cc8 --- /dev/null +++ b/ext/src/Exception/AlreadyExistsException.dep @@ -0,0 +1,98 @@ +src/Exception/AlreadyExistsException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/AlreadyExistsException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/AuthenticationException.dep b/ext/src/Exception/AuthenticationException.dep new file mode 100644 index 000000000..73f9795f6 --- /dev/null +++ b/ext/src/Exception/AuthenticationException.dep @@ -0,0 +1,98 @@ +src/Exception/AuthenticationException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/AuthenticationException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/ConfigurationException.dep b/ext/src/Exception/ConfigurationException.dep new file mode 100644 index 000000000..f5ff1a159 --- /dev/null +++ b/ext/src/Exception/ConfigurationException.dep @@ -0,0 +1,98 @@ +src/Exception/ConfigurationException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/ConfigurationException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/DivideByZeroException.dep b/ext/src/Exception/DivideByZeroException.dep new file mode 100644 index 000000000..c87848816 --- /dev/null +++ b/ext/src/Exception/DivideByZeroException.dep @@ -0,0 +1,98 @@ +src/Exception/DivideByZeroException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/DivideByZeroException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/DomainException.dep b/ext/src/Exception/DomainException.dep new file mode 100644 index 000000000..a678155db --- /dev/null +++ b/ext/src/Exception/DomainException.dep @@ -0,0 +1,98 @@ +src/Exception/DomainException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/DomainException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/ExecutionException.dep b/ext/src/Exception/ExecutionException.dep new file mode 100644 index 000000000..7349241a1 --- /dev/null +++ b/ext/src/Exception/ExecutionException.dep @@ -0,0 +1,98 @@ +src/Exception/ExecutionException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/ExecutionException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/InvalidArgumentException.dep b/ext/src/Exception/InvalidArgumentException.dep new file mode 100644 index 000000000..7180f5adc --- /dev/null +++ b/ext/src/Exception/InvalidArgumentException.dep @@ -0,0 +1,98 @@ +src/Exception/InvalidArgumentException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/InvalidArgumentException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/InvalidQueryException.dep b/ext/src/Exception/InvalidQueryException.dep new file mode 100644 index 000000000..6a0aa69ae --- /dev/null +++ b/ext/src/Exception/InvalidQueryException.dep @@ -0,0 +1,98 @@ +src/Exception/InvalidQueryException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/InvalidQueryException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/InvalidSyntaxException.dep b/ext/src/Exception/InvalidSyntaxException.dep new file mode 100644 index 000000000..b82c8d1e4 --- /dev/null +++ b/ext/src/Exception/InvalidSyntaxException.dep @@ -0,0 +1,98 @@ +src/Exception/InvalidSyntaxException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/InvalidSyntaxException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/IsBootstrappingException.dep b/ext/src/Exception/IsBootstrappingException.dep new file mode 100644 index 000000000..e4093f1b7 --- /dev/null +++ b/ext/src/Exception/IsBootstrappingException.dep @@ -0,0 +1,98 @@ +src/Exception/IsBootstrappingException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/IsBootstrappingException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/LogicException.dep b/ext/src/Exception/LogicException.dep new file mode 100644 index 000000000..22d8284e6 --- /dev/null +++ b/ext/src/Exception/LogicException.dep @@ -0,0 +1,98 @@ +src/Exception/LogicException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/LogicException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/OverloadedException.dep b/ext/src/Exception/OverloadedException.dep new file mode 100644 index 000000000..14a724a5a --- /dev/null +++ b/ext/src/Exception/OverloadedException.dep @@ -0,0 +1,98 @@ +src/Exception/OverloadedException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/OverloadedException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/ProtocolException.dep b/ext/src/Exception/ProtocolException.dep new file mode 100644 index 000000000..d8ffb0f66 --- /dev/null +++ b/ext/src/Exception/ProtocolException.dep @@ -0,0 +1,98 @@ +src/Exception/ProtocolException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/ProtocolException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/RangeException.dep b/ext/src/Exception/RangeException.dep new file mode 100644 index 000000000..c2eef36ea --- /dev/null +++ b/ext/src/Exception/RangeException.dep @@ -0,0 +1,98 @@ +src/Exception/RangeException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/RangeException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/ReadTimeoutException.dep b/ext/src/Exception/ReadTimeoutException.dep new file mode 100644 index 000000000..f906488ef --- /dev/null +++ b/ext/src/Exception/ReadTimeoutException.dep @@ -0,0 +1,98 @@ +src/Exception/ReadTimeoutException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/ReadTimeoutException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/RuntimeException.dep b/ext/src/Exception/RuntimeException.dep new file mode 100644 index 000000000..1eeee96e5 --- /dev/null +++ b/ext/src/Exception/RuntimeException.dep @@ -0,0 +1,98 @@ +src/Exception/RuntimeException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/RuntimeException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/ServerException.dep b/ext/src/Exception/ServerException.dep new file mode 100644 index 000000000..6a1663026 --- /dev/null +++ b/ext/src/Exception/ServerException.dep @@ -0,0 +1,98 @@ +src/Exception/ServerException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/ServerException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/TimeoutException.dep b/ext/src/Exception/TimeoutException.dep new file mode 100644 index 000000000..eace44ec2 --- /dev/null +++ b/ext/src/Exception/TimeoutException.dep @@ -0,0 +1,97 @@ +src/Exception/TimeoutException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/TimeoutException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Exception/TruncateException.dep b/ext/src/Exception/TruncateException.dep new file mode 100644 index 000000000..465a41697 --- /dev/null +++ b/ext/src/Exception/TruncateException.dep @@ -0,0 +1,98 @@ +src/Exception/TruncateException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/TruncateException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/UnauthorizedException.dep b/ext/src/Exception/UnauthorizedException.dep new file mode 100644 index 000000000..79dc97def --- /dev/null +++ b/ext/src/Exception/UnauthorizedException.dep @@ -0,0 +1,98 @@ +src/Exception/UnauthorizedException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/UnauthorizedException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/UnavailableException.dep b/ext/src/Exception/UnavailableException.dep new file mode 100644 index 000000000..73c32e3d2 --- /dev/null +++ b/ext/src/Exception/UnavailableException.dep @@ -0,0 +1,98 @@ +src/Exception/UnavailableException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/UnavailableException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/UnpreparedException.dep b/ext/src/Exception/UnpreparedException.dep new file mode 100644 index 000000000..27577d7b7 --- /dev/null +++ b/ext/src/Exception/UnpreparedException.dep @@ -0,0 +1,98 @@ +src/Exception/UnpreparedException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/UnpreparedException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/ValidationException.dep b/ext/src/Exception/ValidationException.dep new file mode 100644 index 000000000..a898127ca --- /dev/null +++ b/ext/src/Exception/ValidationException.dep @@ -0,0 +1,98 @@ +src/Exception/ValidationException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/ValidationException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Exception/WriteTimeoutException.dep b/ext/src/Exception/WriteTimeoutException.dep new file mode 100644 index 000000000..a5c5a1432 --- /dev/null +++ b/ext/src/Exception/WriteTimeoutException.dep @@ -0,0 +1,98 @@ +src/Exception/WriteTimeoutException.lo: \ + /home/agabadounir/php-cassandra/ext/src/Exception/WriteTimeoutException.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/ExecutionOptions.c b/ext/src/ExecutionOptions.c index c1c8d6095..eddbd372c 100644 --- a/ext/src/ExecutionOptions.c +++ b/ext/src/ExecutionOptions.c @@ -247,13 +247,19 @@ static zend_function_entry php_driver_execution_options_methods[] = { static zend_object_handlers php_driver_execution_options_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_execution_options_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_execution_options_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_execution_options_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -261,7 +267,7 @@ php_driver_execution_options_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -277,7 +283,11 @@ php_driver_execution_options_free(php5to7_zend_object_free *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_DESTROY(self->timeout); PHP5TO7_ZVAL_MAYBE_DESTROY(self->retry_policy); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -302,7 +312,10 @@ void php_driver_define_ExecutionOptions(TSRMLS_D) php_driver_execution_options_ce->create_object = php_driver_execution_options_new; memcpy(&php_driver_execution_options_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_execution_options_handlers.get_properties = php_driver_execution_options_properties; + php_driver_execution_options_handlers.get_properties = php_driver_execution_options_properties; + /* compare_objects was removed in PHP 8 */ +#if PHP_VERSION_ID < 80000 php_driver_execution_options_handlers.compare_objects = php_driver_execution_options_compare; +#endif php_driver_execution_options_handlers.clone_obj = NULL; } diff --git a/ext/src/ExecutionOptions.dep b/ext/src/ExecutionOptions.dep new file mode 100644 index 000000000..e942f93cd --- /dev/null +++ b/ext/src/ExecutionOptions.dep @@ -0,0 +1,97 @@ +src/ExecutionOptions.lo: \ + /home/agabadounir/php-cassandra/ext/src/ExecutionOptions.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/consistency.h util/math.h diff --git a/ext/src/Float.c b/ext/src/Float.c index 1ac790f24..616a8089b 100644 --- a/ext/src/Float.c +++ b/ext/src/Float.c @@ -22,6 +22,17 @@ zend_class_entry *php_driver_float_ce = NULL; +#if PHP_VERSION_ID >= 80000 +static int +to_string(zval *result, php_driver_numeric *flt) +{ + char *string; + spprintf(&string, 0, "%.*F", (int) EG(precision), flt->data.floating.value); + PHP5TO7_ZVAL_STRING(result, string); + efree(string); + return SUCCESS; +} +#else static int to_string(zval *result, php_driver_numeric *flt TSRMLS_DC) { @@ -31,6 +42,7 @@ to_string(zval *result, php_driver_numeric *flt TSRMLS_DC) efree(string); return SUCCESS; } +#endif void php_driver_float_init(INTERNAL_FUNCTION_PARAMETERS) @@ -75,6 +87,9 @@ PHP_METHOD(Float, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Float::__toString() */ PHP_METHOD(Float, __toString) { @@ -348,7 +363,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_float_methods[] = { PHP_ME(Float, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Float, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Float, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Float, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Float, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Float, isInfinite, arginfo_none, ZEND_ACC_PUBLIC) @@ -372,13 +387,40 @@ static zend_function_entry php_driver_float_methods[] = { static php_driver_value_handlers php_driver_float_handlers; static HashTable * -php_driver_float_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_float_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else + return zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC); +#endif +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_float_properties(zend_object *object) +{ + php_driver_numeric *self = php_driver_numeric_object_fetch(object); + HashTable *props = zend_std_get_properties(object); + + zval type; + zval value; + + type = php_driver_type_scalar(CASS_VALUE_TYPE_FLOAT); + zend_hash_str_update(props, "type", sizeof("type") - 1, &type); + + to_string(&value, self); + zend_hash_str_update(props, "value", sizeof("value") - 1, &value); + + return props; +} +#else static HashTable * php_driver_float_properties(zval *object TSRMLS_DC) { @@ -386,7 +428,7 @@ php_driver_float_properties(zval *object TSRMLS_DC) php5to7_zval value; php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); type = php_driver_type_scalar(CASS_VALUE_TYPE_FLOAT TSRMLS_CC); PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); @@ -397,6 +439,7 @@ php_driver_float_properties(zval *object TSRMLS_DC) return props; } +#endif static inline cass_int32_t float_to_bits(cass_float_t value) { @@ -406,6 +449,7 @@ float_to_bits(cass_float_t value) { return bits; } +#if PHP_VERSION_ID < 80000 static int php_driver_float_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -428,6 +472,7 @@ php_driver_float_compare(zval *obj1, zval *obj2 TSRMLS_DC) /* Handle NaNs and negative and positive 0.0 */ return bits1 < bits2 ? -1 : bits1 > bits2; } +#endif static unsigned php_driver_float_hash_value(zval *obj TSRMLS_DC) @@ -457,14 +502,20 @@ php_driver_float_cast(zval *object, zval *retval, int type TSRMLS_DC) return SUCCESS; } +#if PHP_VERSION_ID < 80000 static void php_driver_float_free(php5to7_zend_object_free *object TSRMLS_DC) { php_driver_numeric *self = PHP5TO7_ZEND_OBJECT_GET(numeric, object); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_float_new(zend_class_entry *ce TSRMLS_DC) @@ -472,7 +523,17 @@ php_driver_float_new(zend_class_entry *ce TSRMLS_DC) php_driver_numeric *self = PHP5TO7_ZEND_OBJECT_ECALLOC(numeric, ce); - PHP5TO7_ZEND_OBJECT_INIT_EX(numeric, float, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_float_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_float_handlers; + return &self->zval; +#endif } void php_driver_define_Float(TSRMLS_D) @@ -490,9 +551,11 @@ void php_driver_define_Float(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_float_handlers.std.get_gc = php_driver_float_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_float_handlers.std.compare_objects = php_driver_float_compare; +#endif php_driver_float_handlers.std.cast_object = php_driver_float_cast; php_driver_float_handlers.hash_value = php_driver_float_hash_value; php_driver_float_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Float.dep b/ext/src/Float.dep new file mode 100644 index 000000000..e0f6065bf --- /dev/null +++ b/ext/src/Float.dep @@ -0,0 +1,98 @@ +src/Float.lo: /home/agabadounir/php-cassandra/ext/src/Float.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Function.dep b/ext/src/Function.dep new file mode 100644 index 000000000..bed3799b8 --- /dev/null +++ b/ext/src/Function.dep @@ -0,0 +1,96 @@ +src/Function.lo: /home/agabadounir/php-cassandra/ext/src/Function.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Future.dep b/ext/src/Future.dep new file mode 100644 index 000000000..61677f1b0 --- /dev/null +++ b/ext/src/Future.dep @@ -0,0 +1,96 @@ +src/Future.lo: /home/agabadounir/php-cassandra/ext/src/Future.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/FutureClose.c b/ext/src/FutureClose.c index 10217af0b..9b39dbbbc 100644 --- a/ext/src/FutureClose.c +++ b/ext/src/FutureClose.c @@ -48,13 +48,19 @@ static zend_function_entry php_driver_future_close_methods[] = { static zend_object_handlers php_driver_future_close_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_future_close_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_future_close_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_future_close_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -62,7 +68,7 @@ php_driver_future_close_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -74,7 +80,11 @@ php_driver_future_close_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->future) cass_future_free(self->future); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -100,7 +110,11 @@ void php_driver_define_FutureClose(TSRMLS_D) php_driver_future_close_ce->create_object = php_driver_future_close_new; memcpy(&php_driver_future_close_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_future_close_handlers.get_properties = php_driver_future_close_properties; + php_driver_future_close_handlers.get_properties = php_driver_future_close_properties; +#if PHP_VERSION_ID < 80000 php_driver_future_close_handlers.compare_objects = php_driver_future_close_compare; +#else + /* PHP 8+: do not set compare_objects; use default */ +#endif php_driver_future_close_handlers.clone_obj = NULL; } diff --git a/ext/src/FutureClose.dep b/ext/src/FutureClose.dep new file mode 100644 index 000000000..1636de3d2 --- /dev/null +++ b/ext/src/FutureClose.dep @@ -0,0 +1,97 @@ +src/FutureClose.lo: /home/agabadounir/php-cassandra/ext/src/FutureClose.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/future.h diff --git a/ext/src/FuturePreparedStatement.c b/ext/src/FuturePreparedStatement.c index 96e0f3c19..c3dd6fa42 100644 --- a/ext/src/FuturePreparedStatement.c +++ b/ext/src/FuturePreparedStatement.c @@ -62,13 +62,19 @@ static zend_function_entry php_driver_future_prepared_statement_methods[] = { static zend_object_handlers php_driver_future_prepared_statement_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_future_prepared_statement_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_future_prepared_statement_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_future_prepared_statement_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -76,7 +82,7 @@ php_driver_future_prepared_statement_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -92,7 +98,11 @@ php_driver_future_prepared_statement_free(php5to7_zend_object_free *object TSRML PHP5TO7_ZVAL_MAYBE_DESTROY(self->prepared_statement); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -119,7 +129,11 @@ void php_driver_define_FuturePreparedStatement(TSRMLS_D) php_driver_future_prepared_statement_ce->create_object = php_driver_future_prepared_statement_new; memcpy(&php_driver_future_prepared_statement_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_future_prepared_statement_handlers.get_properties = php_driver_future_prepared_statement_properties; + php_driver_future_prepared_statement_handlers.get_properties = php_driver_future_prepared_statement_properties; +#if PHP_VERSION_ID < 80000 php_driver_future_prepared_statement_handlers.compare_objects = php_driver_future_prepared_statement_compare; +#else + /* PHP 8+: do not set compare_objects; use default */ +#endif php_driver_future_prepared_statement_handlers.clone_obj = NULL; } diff --git a/ext/src/FuturePreparedStatement.dep b/ext/src/FuturePreparedStatement.dep new file mode 100644 index 000000000..0693aec87 --- /dev/null +++ b/ext/src/FuturePreparedStatement.dep @@ -0,0 +1,98 @@ +src/FuturePreparedStatement.lo: \ + /home/agabadounir/php-cassandra/ext/src/FuturePreparedStatement.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/future.h diff --git a/ext/src/FutureRows.c b/ext/src/FutureRows.c index 5ae9dbab6..43eca9268 100644 --- a/ext/src/FutureRows.c +++ b/ext/src/FutureRows.c @@ -102,13 +102,19 @@ static zend_function_entry php_driver_future_rows_methods[] = { static zend_object_handlers php_driver_future_rows_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_future_rows_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_future_rows_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_future_rows_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -116,7 +122,7 @@ php_driver_future_rows_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -134,7 +140,11 @@ php_driver_future_rows_free(php5to7_zend_object_free *object TSRMLS_DC) cass_future_free(self->future); } +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -164,7 +174,11 @@ void php_driver_define_FutureRows(TSRMLS_D) php_driver_future_rows_ce->create_object = php_driver_future_rows_new; memcpy(&php_driver_future_rows_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_future_rows_handlers.get_properties = php_driver_future_rows_properties; + php_driver_future_rows_handlers.get_properties = php_driver_future_rows_properties; +#if PHP_VERSION_ID < 80000 php_driver_future_rows_handlers.compare_objects = php_driver_future_rows_compare; +#else + /* PHP 8+: do not set compare_objects; use default */ +#endif php_driver_future_rows_handlers.clone_obj = NULL; } diff --git a/ext/src/FutureRows.dep b/ext/src/FutureRows.dep new file mode 100644 index 000000000..18d208ad1 --- /dev/null +++ b/ext/src/FutureRows.dep @@ -0,0 +1,97 @@ +src/FutureRows.lo: /home/agabadounir/php-cassandra/ext/src/FutureRows.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/future.h util/result.h util/ref.h diff --git a/ext/src/FutureSession.c b/ext/src/FutureSession.c index 3c622f6e6..2709979b4 100644 --- a/ext/src/FutureSession.c +++ b/ext/src/FutureSession.c @@ -94,13 +94,19 @@ static zend_function_entry php_driver_future_session_methods[] = { static zend_object_handlers php_driver_future_session_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_future_session_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_future_session_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_future_session_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -108,7 +114,7 @@ php_driver_future_session_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -133,7 +139,11 @@ php_driver_future_session_free(php5to7_zend_object_free *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_DESTROY(self->default_session); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -165,7 +175,11 @@ void php_driver_define_FutureSession(TSRMLS_D) php_driver_future_session_ce->create_object = php_driver_future_session_new; memcpy(&php_driver_future_session_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_future_session_handlers.get_properties = php_driver_future_session_properties; + php_driver_future_session_handlers.get_properties = php_driver_future_session_properties; +#if PHP_VERSION_ID < 80000 php_driver_future_session_handlers.compare_objects = php_driver_future_session_compare; +#else + /* PHP 8+: do not set compare_objects; use default */ +#endif php_driver_future_session_handlers.clone_obj = NULL; } diff --git a/ext/src/FutureSession.dep b/ext/src/FutureSession.dep new file mode 100644 index 000000000..1f118a680 --- /dev/null +++ b/ext/src/FutureSession.dep @@ -0,0 +1,100 @@ +src/FutureSession.lo: \ + /home/agabadounir/php-cassandra/ext/src/FutureSession.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h php_driver_types.h \ + util/future.h util/ref.h diff --git a/ext/src/FutureValue.c b/ext/src/FutureValue.c index bcd5dd3d6..ccdee101b 100644 --- a/ext/src/FutureValue.c +++ b/ext/src/FutureValue.c @@ -45,13 +45,19 @@ static zend_function_entry php_driver_future_value_methods[] = { static zend_object_handlers php_driver_future_value_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_future_value_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_future_value_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_future_value_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -59,7 +65,7 @@ php_driver_future_value_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -70,7 +76,11 @@ php_driver_future_value_free(php5to7_zend_object_free *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_DESTROY(self->value); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -96,7 +106,11 @@ void php_driver_define_FutureValue(TSRMLS_D) php_driver_future_value_ce->create_object = php_driver_future_value_new; memcpy(&php_driver_future_value_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_future_value_handlers.get_properties = php_driver_future_value_properties; + php_driver_future_value_handlers.get_properties = php_driver_future_value_properties; +#if PHP_VERSION_ID < 80000 php_driver_future_value_handlers.compare_objects = php_driver_future_value_compare; +#else + /* PHP 8+: do not set compare_objects; use default */ +#endif php_driver_future_value_handlers.clone_obj = NULL; } diff --git a/ext/src/FutureValue.dep b/ext/src/FutureValue.dep new file mode 100644 index 000000000..ede5b0c47 --- /dev/null +++ b/ext/src/FutureValue.dep @@ -0,0 +1,97 @@ +src/FutureValue.lo: /home/agabadounir/php-cassandra/ext/src/FutureValue.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Index.dep b/ext/src/Index.dep new file mode 100644 index 000000000..f8086795e --- /dev/null +++ b/ext/src/Index.dep @@ -0,0 +1,96 @@ +src/Index.lo: /home/agabadounir/php-cassandra/ext/src/Index.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Inet.c b/ext/src/Inet.c index 2c64b9856..a0ad13a2c 100644 --- a/ext/src/Inet.c +++ b/ext/src/Inet.c @@ -51,6 +51,9 @@ PHP_METHOD(Inet, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Inet::__toString() */ PHP_METHOD(Inet, __toString) { @@ -92,7 +95,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_inet_methods[] = { PHP_ME(Inet, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Inet, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Inet, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Inet, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Inet, address, arginfo_none, ZEND_ACC_PUBLIC) PHP_FE_END @@ -101,13 +104,43 @@ static zend_function_entry php_driver_inet_methods[] = { static php_driver_value_handlers php_driver_inet_handlers; static HashTable * -php_driver_inet_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_inet_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else + return zend_std_get_properties(Z_OBJ_P(object) TSRMLS_CC); +#endif +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_inet_properties(zend_object *object) +{ + char *string; + zval type; + zval address; + + php_driver_inet *self = php_driver_inet_object_fetch(object); + HashTable *props = zend_std_get_properties(object); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_INET); + zend_hash_str_update(props, "type", sizeof("type") - 1, &type); + + php_driver_format_address(self->inet, &string); + ZVAL_STRING(&address, string); + efree(string); + zend_hash_str_update(props, "address", sizeof("address") - 1, &address); + + return props; +} +#else static HashTable * php_driver_inet_properties(zval *object TSRMLS_DC) { @@ -116,7 +149,7 @@ php_driver_inet_properties(zval *object TSRMLS_DC) php5to7_zval address; php_driver_inet *self = PHP_DRIVER_GET_INET(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); type = php_driver_type_scalar(CASS_VALUE_TYPE_INET TSRMLS_CC); PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); @@ -129,7 +162,9 @@ php_driver_inet_properties(zval *object TSRMLS_DC) return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_inet_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -164,6 +199,7 @@ php_driver_inet_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_inet_new(zend_class_entry *ce TSRMLS_DC) @@ -171,7 +207,17 @@ php_driver_inet_new(zend_class_entry *ce TSRMLS_DC) php_driver_inet *self = PHP5TO7_ZEND_OBJECT_ECALLOC(inet, ce); - PHP5TO7_ZEND_OBJECT_INIT(inet, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_inet_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_inet_handlers; + return &self->zval; +#endif } void php_driver_define_Inet(TSRMLS_D) @@ -186,10 +232,14 @@ void php_driver_define_Inet(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_inet_handlers.std.get_gc = php_driver_inet_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_inet_handlers.std.compare_objects = php_driver_inet_compare; +#endif php_driver_inet_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_inet_ce->create_object = php_driver_inet_new; + #if PHP_VERSION_ID < 80000 php_driver_inet_handlers.hash_value = php_driver_inet_hash_value; +#endif php_driver_inet_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Inet.dep b/ext/src/Inet.dep new file mode 100644 index 000000000..93f70c45b --- /dev/null +++ b/ext/src/Inet.dep @@ -0,0 +1,97 @@ +src/Inet.lo: /home/agabadounir/php-cassandra/ext/src/Inet.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/inet.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Keyspace.dep b/ext/src/Keyspace.dep new file mode 100644 index 000000000..939ae66aa --- /dev/null +++ b/ext/src/Keyspace.dep @@ -0,0 +1,96 @@ +src/Keyspace.lo: /home/agabadounir/php-cassandra/ext/src/Keyspace.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Map.c b/ext/src/Map.c index 2056b978c..7510ab33c 100644 --- a/ext/src/Map.c +++ b/ext/src/Map.c @@ -139,6 +139,31 @@ php_driver_map_has(php_driver_map *map, zval *zkey TSRMLS_DC) return result; } +#if PHP_VERSION_ID >= 80000 +static void +php_driver_map_populate_keys(const php_driver_map *map, zval *array) +{ + php_driver_map_entry *curr, *temp; + HASH_ITER(hh, map->entries, curr, temp) { + if (add_next_index_zval(array, &curr->key) != SUCCESS) { + break; + } + Z_TRY_ADDREF(curr->key); + } +} + +static void +php_driver_map_populate_values(const php_driver_map *map, zval *array) +{ + php_driver_map_entry *curr, *temp; + HASH_ITER(hh, map->entries, curr, temp) { + if (add_next_index_zval(array, &curr->value) != SUCCESS) { + break; + } + Z_TRY_ADDREF(curr->value); + } +} +#else static void php_driver_map_populate_keys(const php_driver_map *map, zval *array TSRMLS_DC) { @@ -162,6 +187,7 @@ php_driver_map_populate_values(const php_driver_map *map, zval *array TSRMLS_DC) Z_TRY_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(curr->value)); } } +#endif /* {{{ Map::__construct(type, type) */ PHP_METHOD(Map, __construct) @@ -311,12 +337,20 @@ PHP_METHOD(Map, has) RETURN_FALSE; } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, count) { php_driver_map *self = PHP_DRIVER_GET_MAP(getThis()); RETURN_LONG((long)HASH_COUNT(self->entries)); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, current) { php_driver_map *self = PHP_DRIVER_GET_MAP(getThis()); @@ -324,6 +358,10 @@ PHP_METHOD(Map, current) RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->iter_curr->value), 1, 0); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_key, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, key) { php_driver_map *self = PHP_DRIVER_GET_MAP(getThis()); @@ -331,6 +369,10 @@ PHP_METHOD(Map, key) RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->iter_curr->key), 1, 0); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_next, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, next) { php_driver_map *self = PHP_DRIVER_GET_MAP(getThis()); @@ -338,12 +380,20 @@ PHP_METHOD(Map, next) self->iter_temp = self->iter_temp != NULL ? (php_driver_map_entry *)self->iter_temp->hh.next : NULL; } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, valid) { php_driver_map *self = PHP_DRIVER_GET_MAP(getThis()); RETURN_BOOL(self->iter_curr != NULL); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rewind, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, rewind) { php_driver_map *self = PHP_DRIVER_GET_MAP(getThis()); @@ -351,6 +401,12 @@ PHP_METHOD(Map, rewind) self->iter_temp = self->entries != NULL ? (php_driver_map_entry *)self->entries->hh.next : NULL; } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offsetSet, 0, 2, IS_VOID, 0) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, offsetSet) { zval *key; @@ -365,6 +421,11 @@ PHP_METHOD(Map, offsetSet) php_driver_map_set(self, key, value TSRMLS_CC); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offsetGet, 0, 1, IS_MIXED, 0) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, offsetGet) { zval *key; @@ -380,6 +441,11 @@ PHP_METHOD(Map, offsetGet) RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(value), 1, 0); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offsetUnset, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, offsetUnset) { zval *key; @@ -393,6 +459,11 @@ PHP_METHOD(Map, offsetUnset) php_driver_map_del(self, key TSRMLS_CC); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offsetExists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Map, offsetExists) { zval *key; @@ -436,31 +507,109 @@ static zend_function_entry php_driver_map_methods[] = { PHP_ME(Map, remove, arginfo_one, ZEND_ACC_PUBLIC) PHP_ME(Map, has, arginfo_one, ZEND_ACC_PUBLIC) /* Countable */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, count, arginfo_count, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, count, arginfo_none, ZEND_ACC_PUBLIC) +#endif /* Iterator */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, current, arginfo_current, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, current, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, key, arginfo_key, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, key, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, next, arginfo_next, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, next, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, valid, arginfo_valid, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, valid, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, rewind, arginfo_rewind, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#endif /* ArrayAccess */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, offsetSet, arginfo_offsetSet, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, offsetSet, arginfo_two, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, offsetGet, arginfo_offsetGet, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, offsetGet, arginfo_one, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, offsetUnset, arginfo_offsetUnset, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, offsetUnset, arginfo_one, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Map, offsetExists, arginfo_offsetExists, ZEND_ACC_PUBLIC) +#else PHP_ME(Map, offsetExists, arginfo_one, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; -static php_driver_value_handlers php_driver_map_handlers; +static zend_object_handlers php_driver_map_handlers; static HashTable * -php_driver_map_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_map_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static int +php_driver_bucket_data_compare(Bucket *a, Bucket *b) +{ + return php_driver_data_compare(&a->val, &b->val); +} + +static HashTable * +php_driver_map_properties(zend_object *object) +{ + zval keys; + zval values; + + php_driver_map *self = php_driver_map_object_fetch(object); + HashTable *props = zend_std_get_properties(object); + + zend_hash_update(props, + zend_string_init("type", sizeof("type") - 1, 0), + &self->type); + Z_ADDREF(self->type); + + array_init(&keys); + php_driver_map_populate_keys(self, &keys); + zend_hash_sort(Z_ARRVAL(keys), php_driver_bucket_data_compare, 1); + zend_hash_str_update(props, "keys", sizeof("keys") - 1, &keys); + + array_init(&values); + php_driver_map_populate_values(self, &values); + zend_hash_sort(Z_ARRVAL(values), php_driver_bucket_data_compare, 1); + zend_hash_str_update(props, "values", sizeof("values") - 1, &values); + + return props; +} +#else static HashTable * php_driver_map_properties(zval *object TSRMLS_DC) { @@ -468,7 +617,7 @@ php_driver_map_properties(zval *object TSRMLS_DC) php5to7_zval values; php_driver_map *self = PHP_DRIVER_GET_MAP(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); PHP5TO7_ZEND_HASH_UPDATE(props, @@ -490,9 +639,15 @@ php_driver_map_properties(zval *object TSRMLS_DC) return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_map_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_map_compare(zval *obj1, zval *obj2) +#endif { php_driver_map_entry *curr, *temp; php_driver_map *map1; @@ -553,6 +708,7 @@ php_driver_map_hash_value(zval *obj TSRMLS_DC) return hashv; } +#if PHP_VERSION_ID < 80000 static void php_driver_map_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -571,6 +727,7 @@ php_driver_map_free(php5to7_zend_object_free *object TSRMLS_DC) zend_object_std_dtor(&self->zval TSRMLS_CC); PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_map_new(zend_class_entry *ce TSRMLS_DC) @@ -582,7 +739,17 @@ php_driver_map_new(zend_class_entry *ce TSRMLS_DC) self->dirty = 1; PHP5TO7_ZVAL_UNDEF(self->type); - PHP5TO7_ZEND_OBJECT_INIT(map, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_map_handlers; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_map_handlers; + return &self->zval; +#endif } void php_driver_define_Map(TSRMLS_D) @@ -593,15 +760,19 @@ void php_driver_define_Map(TSRMLS_D) php_driver_map_ce = zend_register_internal_class(&ce TSRMLS_CC); zend_class_implements(php_driver_map_ce TSRMLS_CC, 1, php_driver_value_ce); memcpy(&php_driver_map_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_map_handlers.std.get_properties = php_driver_map_properties; + php_driver_map_handlers.get_properties = php_driver_map_properties; #if PHP_VERSION_ID >= 50400 - php_driver_map_handlers.std.get_gc = php_driver_map_gc; + php_driver_map_handlers.get_gc = php_driver_map_gc; +#endif +#if PHP_VERSION_ID < 80000 + php_driver_map_handlers.compare_objects = php_driver_map_compare; #endif - php_driver_map_handlers.std.compare_objects = php_driver_map_compare; php_driver_map_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_map_ce->create_object = php_driver_map_new; +#if PHP_VERSION_ID >= 80000 + zend_class_implements(php_driver_map_ce, 3, zend_ce_countable, zend_ce_iterator, zend_ce_arrayaccess); +#else zend_class_implements(php_driver_map_ce TSRMLS_CC, 3, spl_ce_Countable, zend_ce_iterator, zend_ce_arrayaccess); - - php_driver_map_handlers.hash_value = php_driver_map_hash_value; - php_driver_map_handlers.std.clone_obj = NULL; +#endif + php_driver_map_handlers.clone_obj = NULL; } diff --git a/ext/src/Map.dep b/ext/src/Map.dep new file mode 100644 index 000000000..fc19708e0 --- /dev/null +++ b/ext/src/Map.dep @@ -0,0 +1,98 @@ +src/Map.lo: /home/agabadounir/php-cassandra/ext/src/Map.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/collections.h util/hash.h util/uthash.h \ + util/types.h /usr/include/php/20230831/Zend/zend_smart_str.h \ + /home/agabadounir/php-cassandra/ext/src/Map.h diff --git a/ext/src/MaterializedView.dep b/ext/src/MaterializedView.dep new file mode 100644 index 000000000..84947d8cf --- /dev/null +++ b/ext/src/MaterializedView.dep @@ -0,0 +1,97 @@ +src/MaterializedView.lo: \ + /home/agabadounir/php-cassandra/ext/src/MaterializedView.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Numeric.dep b/ext/src/Numeric.dep new file mode 100644 index 000000000..b29565f2b --- /dev/null +++ b/ext/src/Numeric.dep @@ -0,0 +1,96 @@ +src/Numeric.lo: /home/agabadounir/php-cassandra/ext/src/Numeric.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/PreparedStatement.c b/ext/src/PreparedStatement.c index 2366bc7d7..0cbbe1bc7 100644 --- a/ext/src/PreparedStatement.c +++ b/ext/src/PreparedStatement.c @@ -23,20 +23,35 @@ PHP_METHOD(PreparedStatement, __construct) { } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot declare a return type; use untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, 0, 0) +ZEND_END_ARG_INFO() +#else +ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) +ZEND_END_ARG_INFO() +#endif + static zend_function_entry php_driver_prepared_statement_methods[] = { - PHP_ME(PreparedStatement, __construct, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) + PHP_ME(PreparedStatement, __construct, arginfo_none, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) PHP_FE_END }; static zend_object_handlers php_driver_prepared_statement_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_prepared_statement_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_prepared_statement_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_prepared_statement_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -44,7 +59,7 @@ php_driver_prepared_statement_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -55,7 +70,11 @@ php_driver_prepared_statement_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->data.prepared.prepared) cass_prepared_free(self->data.prepared.prepared); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -82,7 +101,10 @@ void php_driver_define_PreparedStatement(TSRMLS_D) php_driver_prepared_statement_ce->create_object = php_driver_prepared_statement_new; memcpy(&php_driver_prepared_statement_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_prepared_statement_handlers.get_properties = php_driver_prepared_statement_properties; + php_driver_prepared_statement_handlers.get_properties = php_driver_prepared_statement_properties; + /* compare_objects was removed in PHP 8 */ +#if PHP_VERSION_ID < 80000 php_driver_prepared_statement_handlers.compare_objects = php_driver_prepared_statement_compare; +#endif php_driver_prepared_statement_handlers.clone_obj = NULL; } diff --git a/ext/src/PreparedStatement.dep b/ext/src/PreparedStatement.dep new file mode 100644 index 000000000..2e2fdd257 --- /dev/null +++ b/ext/src/PreparedStatement.dep @@ -0,0 +1,97 @@ +src/PreparedStatement.lo: \ + /home/agabadounir/php-cassandra/ext/src/PreparedStatement.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/RetryPolicy.dep b/ext/src/RetryPolicy.dep new file mode 100644 index 000000000..059ae0d1a --- /dev/null +++ b/ext/src/RetryPolicy.dep @@ -0,0 +1,98 @@ +src/RetryPolicy.lo: /home/agabadounir/php-cassandra/ext/src/RetryPolicy.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/RetryPolicy/DefaultPolicy.c b/ext/src/RetryPolicy/DefaultPolicy.c index 68aff8ad0..07d547e32 100644 --- a/ext/src/RetryPolicy/DefaultPolicy.c +++ b/ext/src/RetryPolicy/DefaultPolicy.c @@ -33,7 +33,11 @@ php_driver_retry_policy_default_free(php5to7_zend_object_free *object TSRMLS_DC) cass_retry_policy_free(self->policy); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } diff --git a/ext/src/RetryPolicy/DefaultPolicy.dep b/ext/src/RetryPolicy/DefaultPolicy.dep new file mode 100644 index 000000000..9da82dd1d --- /dev/null +++ b/ext/src/RetryPolicy/DefaultPolicy.dep @@ -0,0 +1,99 @@ +src/RetryPolicy/DefaultPolicy.lo: \ + /home/agabadounir/php-cassandra/ext/src/RetryPolicy/DefaultPolicy.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/RetryPolicy/DowngradingConsistency.c b/ext/src/RetryPolicy/DowngradingConsistency.c index d28596fe2..f88aaed6b 100644 --- a/ext/src/RetryPolicy/DowngradingConsistency.c +++ b/ext/src/RetryPolicy/DowngradingConsistency.c @@ -33,7 +33,11 @@ php_driver_retry_policy_downgrading_consistency_free(php5to7_zend_object_free *o cass_retry_policy_free(self->policy); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } diff --git a/ext/src/RetryPolicy/DowngradingConsistency.dep b/ext/src/RetryPolicy/DowngradingConsistency.dep new file mode 100644 index 000000000..2e6111961 --- /dev/null +++ b/ext/src/RetryPolicy/DowngradingConsistency.dep @@ -0,0 +1,99 @@ +src/RetryPolicy/DowngradingConsistency.lo: \ + /home/agabadounir/php-cassandra/ext/src/RetryPolicy/DowngradingConsistency.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/RetryPolicy/Fallthrough.c b/ext/src/RetryPolicy/Fallthrough.c index 517bafa05..f8f383406 100644 --- a/ext/src/RetryPolicy/Fallthrough.c +++ b/ext/src/RetryPolicy/Fallthrough.c @@ -33,7 +33,11 @@ php_driver_retry_policy_fallthrough_free(php5to7_zend_object_free *object TSRMLS cass_retry_policy_free(self->policy); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } diff --git a/ext/src/RetryPolicy/Fallthrough.dep b/ext/src/RetryPolicy/Fallthrough.dep new file mode 100644 index 000000000..306b60308 --- /dev/null +++ b/ext/src/RetryPolicy/Fallthrough.dep @@ -0,0 +1,99 @@ +src/RetryPolicy/Fallthrough.lo: \ + /home/agabadounir/php-cassandra/ext/src/RetryPolicy/Fallthrough.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/RetryPolicy/Logging.c b/ext/src/RetryPolicy/Logging.c index 356312c23..b930899a5 100644 --- a/ext/src/RetryPolicy/Logging.c +++ b/ext/src/RetryPolicy/Logging.c @@ -62,7 +62,11 @@ php_driver_retry_policy_logging_free(php5to7_zend_object_free *object TSRMLS_DC) cass_retry_policy_free(self->policy); } + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } diff --git a/ext/src/RetryPolicy/Logging.dep b/ext/src/RetryPolicy/Logging.dep new file mode 100644 index 000000000..6df353b0b --- /dev/null +++ b/ext/src/RetryPolicy/Logging.dep @@ -0,0 +1,99 @@ +src/RetryPolicy/Logging.lo: \ + /home/agabadounir/php-cassandra/ext/src/RetryPolicy/Logging.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Rows.c b/ext/src/Rows.c index c2b003811..0389c3156 100644 --- a/ext/src/Rows.c +++ b/ext/src/Rows.c @@ -373,6 +373,55 @@ PHP_METHOD(Rows, first) } } +#if PHP_VERSION_ID >= 80100 +/* Typed arginfo for PHP 8.1+ */ +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_none, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bool, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mixed, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_key_maybe_long, 0, 0, MAY_BE_LONG|MAY_BE_NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_string_or_null, 0, 0, MAY_BE_STRING|MAY_BE_NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rows_next_page, 0, 0, IS_OBJECT, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_MIXED, 1, "null") +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_next_page_async, 0, 0, MAY_BE_OBJECT) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offset_exists, 0, 1, _IS_BOOL, 0) + ZEND_ARG_INFO(0, offset) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offset_get, 0, 1, IS_MIXED, 0) + ZEND_ARG_INFO(0, offset) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offset_set, 0, 2, IS_VOID, 0) + ZEND_ARG_INFO(0, offset) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_offset_unset, 0, 1, IS_VOID, 0) + ZEND_ARG_INFO(0, offset) +ZEND_END_ARG_INFO() +#else +/* Legacy arginfo for older PHP versions */ ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() @@ -388,8 +437,27 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timeout, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, timeout) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_rows_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(Rows, __construct, arginfo_ctor_none, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Rows, count, arginfo_count, ZEND_ACC_PUBLIC) + PHP_ME(Rows, rewind, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Rows, current, arginfo_mixed, ZEND_ACC_PUBLIC) + PHP_ME(Rows, key, arginfo_key_maybe_long,ZEND_ACC_PUBLIC) + PHP_ME(Rows, next, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Rows, valid, arginfo_bool, ZEND_ACC_PUBLIC) + PHP_ME(Rows, offsetExists, arginfo_offset_exists, ZEND_ACC_PUBLIC) + PHP_ME(Rows, offsetGet, arginfo_offset_get, ZEND_ACC_PUBLIC) + PHP_ME(Rows, offsetSet, arginfo_offset_set, ZEND_ACC_PUBLIC) + PHP_ME(Rows, offsetUnset, arginfo_offset_unset, ZEND_ACC_PUBLIC) + PHP_ME(Rows, isLastPage, arginfo_bool, ZEND_ACC_PUBLIC) + PHP_ME(Rows, nextPage, arginfo_rows_next_page,ZEND_ACC_PUBLIC) + PHP_ME(Rows, nextPageAsync, arginfo_next_page_async,ZEND_ACC_PUBLIC) + PHP_ME(Rows, pagingStateToken, arginfo_string_or_null,ZEND_ACC_PUBLIC) + PHP_ME(Rows, first, arginfo_mixed, ZEND_ACC_PUBLIC) +#else PHP_ME(Rows, __construct, arginfo_none, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_ME(Rows, count, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Rows, rewind, arginfo_none, ZEND_ACC_PUBLIC) @@ -406,18 +474,25 @@ static zend_function_entry php_driver_rows_methods[] = { PHP_ME(Rows, nextPageAsync, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Rows, pagingStateToken, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Rows, first, arginfo_none, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_rows_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_rows_properties(zend_object *object) +{ + return zend_std_get_properties(object); +} +#else static HashTable * php_driver_rows_properties(zval *object TSRMLS_DC) { - HashTable *props = zend_std_get_properties(object TSRMLS_CC); - - return props; + return zend_std_get_properties(object TSRMLS_CC); } +#endif static int php_driver_rows_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -425,7 +500,7 @@ php_driver_rows_compare(zval *obj1, zval *obj2 TSRMLS_DC) if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } static void @@ -442,7 +517,11 @@ php_driver_rows_free(php5to7_zend_object_free *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_DESTROY(self->next_rows); PHP5TO7_ZVAL_MAYBE_DESTROY(self->future_next_page); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -474,7 +553,10 @@ void php_driver_define_Rows(TSRMLS_D) php_driver_rows_ce->create_object = php_driver_rows_new; memcpy(&php_driver_rows_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_rows_handlers.get_properties = php_driver_rows_properties; + php_driver_rows_handlers.get_properties = php_driver_rows_properties; + /* compare_objects was removed in PHP 8 */ +#if PHP_VERSION_ID < 80000 php_driver_rows_handlers.compare_objects = php_driver_rows_compare; +#endif php_driver_rows_handlers.clone_obj = NULL; } diff --git a/ext/src/Rows.dep b/ext/src/Rows.dep new file mode 100644 index 000000000..8c22a7c53 --- /dev/null +++ b/ext/src/Rows.dep @@ -0,0 +1,97 @@ +src/Rows.lo: /home/agabadounir/php-cassandra/ext/src/Rows.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/future.h util/ref.h util/result.h \ + /home/agabadounir/php-cassandra/ext/src/FutureRows.h diff --git a/ext/src/SSLOptions.c b/ext/src/SSLOptions.c index 42842961f..465b8003b 100644 --- a/ext/src/SSLOptions.c +++ b/ext/src/SSLOptions.c @@ -25,44 +25,91 @@ static zend_function_entry php_driver_ssl_methods[] = { static zend_object_handlers php_driver_ssl_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_ssl_properties(zend_object *object) +{ + HashTable *props = zend_std_get_properties(object); + return props; +} +#else static HashTable * php_driver_ssl_properties(zval *object TSRMLS_DC) { HashTable *props = zend_std_get_properties(object TSRMLS_CC); - return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_ssl_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_ssl_compare(zval *obj1, zval *obj2) +#endif { if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 static void -php_driver_ssl_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_ssl_free(zend_object *object) { - php_driver_ssl *self = PHP5TO7_ZEND_OBJECT_GET(ssl, object); - + php_driver_ssl *self = (php_driver_ssl *) ((char *) (object) - XtOffsetOf(php_driver_ssl, std)); + cass_ssl_free(self->ssl); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_ssl_free(void *object TSRMLS_DC) +{ + php_driver_ssl *self = (php_driver_ssl *) object; cass_ssl_free(self->ssl); - zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_ssl_new(zend_class_entry *ce) +{ + php_driver_ssl *self = ecalloc(1, sizeof(php_driver_ssl) + zend_object_properties_size(ce)); + + self->ssl = cass_ssl_new(); + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_ssl_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_ssl_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_ssl *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(ssl, ce); + zend_object_value retval; + php_driver_ssl *self; + + self = (php_driver_ssl *) ecalloc(1, sizeof(php_driver_ssl)); self->ssl = cass_ssl_new(); - PHP5TO7_ZEND_OBJECT_INIT(ssl, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_ssl_free, + NULL TSRMLS_CC); + retval.handlers = &php_driver_ssl_handlers; + + return retval; } +#endif void php_driver_define_SSLOptions(TSRMLS_D) { @@ -70,11 +117,20 @@ void php_driver_define_SSLOptions(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\SSLOptions", php_driver_ssl_methods); php_driver_ssl_ce = zend_register_internal_class(&ce TSRMLS_CC); - php_driver_ssl_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + php_driver_ssl_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_ssl_ce->create_object = php_driver_ssl_new; memcpy(&php_driver_ssl_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_ssl_handlers.get_properties = php_driver_ssl_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_ssl_handlers.offset = XtOffsetOf(php_driver_ssl, std); + php_driver_ssl_handlers.free_obj = php_driver_ssl_free; + php_driver_ssl_handlers.get_properties = php_driver_ssl_properties; + php_driver_ssl_handlers.compare = php_driver_ssl_compare; + php_driver_ssl_handlers.clone_obj = NULL; +#else + php_driver_ssl_handlers.get_properties = php_driver_ssl_properties; php_driver_ssl_handlers.compare_objects = php_driver_ssl_compare; php_driver_ssl_handlers.clone_obj = NULL; -} +#endif +} \ No newline at end of file diff --git a/ext/src/SSLOptions.dep b/ext/src/SSLOptions.dep new file mode 100644 index 000000000..2ba6b47f5 --- /dev/null +++ b/ext/src/SSLOptions.dep @@ -0,0 +1,97 @@ +src/SSLOptions.lo: /home/agabadounir/php-cassandra/ext/src/SSLOptions.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/SSLOptions/Builder.c b/ext/src/SSLOptions/Builder.c index ad62b84c3..b74f65a84 100644 --- a/ext/src/SSLOptions/Builder.c +++ b/ext/src/SSLOptions/Builder.c @@ -22,36 +22,26 @@ zend_class_entry *php_driver_ssl_builder_ce = NULL; static int -file_get_contents(char *path, char **output, int *len TSRMLS_DC) +file_get_contents(char *path, char **output, size_t *len) { -#if PHP_MAJOR_VERSION >= 7 - zend_string *str; php_stream *stream = php_stream_open_wrapper(path, "rb", USE_PATH|REPORT_ERRORS, NULL); -#else - php_stream *stream = php_stream_open_wrapper(path, "rb", - USE_PATH|REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); -#endif if (!stream) { - zend_throw_exception_ex(php_driver_runtime_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_runtime_exception_ce, 0, "The path '%s' doesn't exist or is not readable", path); return 0; } -#if PHP_MAJOR_VERSION >= 7 - str = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); + zend_string *str = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); if (str) { - *output = estrndup(str->val, str->len); - *len = str->len; + *output = estrndup(ZSTR_VAL(str), ZSTR_LEN(str)); + *len = ZSTR_LEN(str); zend_string_release(str); } else { php_stream_close(stream); return 0; } -#else - *len = php_stream_copy_to_mem(stream, output, PHP_STREAM_COPY_ALL, 0); -#endif php_stream_close(stream); return 1; @@ -60,7 +50,7 @@ file_get_contents(char *path, char **output, int *len TSRMLS_DC) PHP_METHOD(SSLOptionsBuilder, build) { php_driver_ssl *ssl = NULL; - int len; + size_t len; char *contents; CassError rc; @@ -78,7 +68,7 @@ PHP_METHOD(SSLOptionsBuilder, build) for (i = 0; i < builder->trusted_certs_cnt; i++) { path = builder->trusted_certs[i]; - if (!file_get_contents(path, &contents, &len TSRMLS_CC)) + if (!file_get_contents(path, &contents, &len)) return; rc = cass_ssl_add_trusted_cert_n(ssl->ssl, contents, len); @@ -88,7 +78,7 @@ PHP_METHOD(SSLOptionsBuilder, build) } if (builder->client_cert) { - if (!file_get_contents(builder->client_cert, &contents, &len TSRMLS_CC)) + if (!file_get_contents(builder->client_cert, &contents, &len)) return; rc = cass_ssl_set_cert_n(ssl->ssl, contents, len); @@ -97,7 +87,7 @@ PHP_METHOD(SSLOptionsBuilder, build) } if (builder->private_key) { - if (!file_get_contents(builder->private_key, &contents, &len TSRMLS_CC)) + if (!file_get_contents(builder->private_key, &contents, &len)) return; rc = cass_ssl_set_private_key(ssl->ssl, contents, builder->passphrase); @@ -108,29 +98,28 @@ PHP_METHOD(SSLOptionsBuilder, build) PHP_METHOD(SSLOptionsBuilder, withTrustedCerts) { - zval readable; - php5to7_zval_args args = NULL; + zval *args = NULL; int argc = 0, i; php_driver_ssl_builder *builder = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+ ", &args, &argc) == FAILURE) { return; } for (i = 0; i < argc; i++) { - zval *path = PHP5TO7_ZVAL_ARG(args[i]); + zval *path = &args[i]; + zval readable; if (Z_TYPE_P(path) != IS_STRING) { - throw_invalid_argument(path, "path", "a path to a trusted cert file" TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(args); + throw_invalid_argument(path, "path", "a path to a trusted cert file"); + return; } - php_stat(Z_STRVAL_P(path), Z_STRLEN_P(path), FS_IS_R, &readable TSRMLS_CC); + php_stat(Z_STR_P(path), FS_IS_R, &readable); - if (PHP5TO7_ZVAL_IS_FALSE_P(&readable)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + if (Z_TYPE(readable) == IS_FALSE) { + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "The path '%s' doesn't exist or is not readable", Z_STRVAL_P(path)); - PHP5TO7_MAYBE_EFREE(args); return; } } @@ -149,21 +138,20 @@ PHP_METHOD(SSLOptionsBuilder, withTrustedCerts) builder->trusted_certs = ecalloc(argc, sizeof(char *)); for (i = 0; i < argc; i++) { - zval *path = PHP5TO7_ZVAL_ARG(args[i]); + zval *path = &args[i]; builder->trusted_certs[i] = estrndup(Z_STRVAL_P(path), Z_STRLEN_P(path)); } - PHP5TO7_MAYBE_EFREE(args); RETURN_ZVAL(getThis(), 1, 0); } PHP_METHOD(SSLOptionsBuilder, withVerifyFlags) { - long flags; + zend_long flags; php_driver_ssl_builder *builder = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) { return; } @@ -177,18 +165,18 @@ PHP_METHOD(SSLOptionsBuilder, withVerifyFlags) PHP_METHOD(SSLOptionsBuilder, withClientCert) { char *client_cert; - php5to7_size client_cert_len; + size_t client_cert_len; zval readable; php_driver_ssl_builder *builder = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &client_cert, &client_cert_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &client_cert, &client_cert_len) == FAILURE) { return; } - php_stat(client_cert, client_cert_len, FS_IS_R, &readable TSRMLS_CC); + php_stat(zend_string_init(client_cert, client_cert_len, 0), FS_IS_R, &readable); - if (PHP5TO7_ZVAL_IS_FALSE_P(&readable)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + if (Z_TYPE(readable) == IS_FALSE) { + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "The path '%s' doesn't exist or is not readable", client_cert); return; } @@ -207,18 +195,18 @@ PHP_METHOD(SSLOptionsBuilder, withPrivateKey) { char *private_key; char *passphrase = NULL; - php5to7_size private_key_len, passphrase_len; + size_t private_key_len, passphrase_len; zval readable; php_driver_ssl_builder *builder = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &private_key, &private_key_len, &passphrase, &passphrase_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &private_key, &private_key_len, &passphrase, &passphrase_len) == FAILURE) { return; } - php_stat(private_key, private_key_len, FS_IS_R, &readable TSRMLS_CC); + php_stat(zend_string_init(private_key, private_key_len, 0), FS_IS_R, &readable); - if (PHP5TO7_ZVAL_IS_FALSE_P(&readable)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + if (Z_TYPE(readable) == IS_FALSE) { + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "The path '%s' doesn't exist or is not readable", private_key); return; } @@ -272,28 +260,66 @@ static zend_function_entry php_driver_ssl_builder_methods[] = { static zend_object_handlers php_driver_ssl_builder_handlers; +#if PHP_VERSION_ID >= 80000 static HashTable * -php_driver_ssl_builder_properties(zval *object TSRMLS_DC) +php_driver_ssl_builder_properties(zend_object *object) +{ + HashTable *props = zend_std_get_properties(object); + return props; +} +#else +static HashTable * +php_driver_ssl_builder_properties(zval *object TSRMLS_CC) { HashTable *props = zend_std_get_properties(object TSRMLS_CC); - return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_ssl_builder_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_ssl_builder_compare(zval *obj1, zval *obj2) +#endif { if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 static void -php_driver_ssl_builder_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_ssl_builder_free(zend_object *object) { - php_driver_ssl_builder *self = PHP5TO7_ZEND_OBJECT_GET(ssl_builder, object); + php_driver_ssl_builder *self = (php_driver_ssl_builder *) ((char *) (object) - XtOffsetOf(php_driver_ssl_builder, std)); + if (self->trusted_certs) { + int i; + + for (i = 0; i < self->trusted_certs_cnt; i++) + efree(self->trusted_certs[i]); + + efree(self->trusted_certs); + } + + if (self->client_cert) + efree(self->client_cert); + + if (self->private_key) + efree(self->private_key); + + if (self->passphrase) + efree(self->passphrase); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_ssl_builder_free(void *object TSRMLS_DC) +{ + php_driver_ssl_builder *self = (php_driver_ssl_builder *) object; if (self->trusted_certs) { int i; @@ -313,14 +339,37 @@ php_driver_ssl_builder_free(php5to7_zend_object_free *object TSRMLS_DC) efree(self->passphrase); zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_ssl_builder_new(zend_class_entry *ce) +{ + php_driver_ssl_builder *self = ecalloc(1, sizeof(php_driver_ssl_builder) + zend_object_properties_size(ce)); -static php5to7_zend_object + self->flags = 0; + self->trusted_certs = NULL; + self->trusted_certs_cnt = 0; + self->client_cert = NULL; + self->private_key = NULL; + self->passphrase = NULL; + + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_ssl_builder_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_ssl_builder_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_ssl_builder *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(ssl_builder, ce); + zend_object_value retval; + php_driver_ssl_builder *self; + + self = (php_driver_ssl_builder *) ecalloc(1, sizeof(php_driver_ssl_builder)); self->flags = 0; self->trusted_certs = NULL; @@ -329,8 +378,17 @@ php_driver_ssl_builder_new(zend_class_entry *ce TSRMLS_DC) self->private_key = NULL; self->passphrase = NULL; - PHP5TO7_ZEND_OBJECT_INIT(ssl_builder, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_ssl_builder_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_ssl_builder_handlers; + + return retval; } +#endif void php_driver_define_SSLOptionsBuilder(TSRMLS_D) { @@ -338,10 +396,20 @@ void php_driver_define_SSLOptionsBuilder(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\SSLOptions\\Builder", php_driver_ssl_builder_methods); php_driver_ssl_builder_ce = zend_register_internal_class(&ce TSRMLS_CC); - php_driver_ssl_builder_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + php_driver_ssl_builder_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_ssl_builder_ce->create_object = php_driver_ssl_builder_new; memcpy(&php_driver_ssl_builder_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_ssl_builder_handlers.get_properties = php_driver_ssl_builder_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_ssl_builder_handlers.offset = XtOffsetOf(php_driver_ssl_builder, std); + php_driver_ssl_builder_handlers.free_obj = php_driver_ssl_builder_free; + php_driver_ssl_builder_handlers.get_properties = php_driver_ssl_builder_properties; + php_driver_ssl_builder_handlers.compare = php_driver_ssl_builder_compare; + php_driver_ssl_builder_handlers.clone_obj = NULL; +#else + php_driver_ssl_builder_handlers.get_properties = php_driver_ssl_builder_properties; php_driver_ssl_builder_handlers.compare_objects = php_driver_ssl_builder_compare; -} + php_driver_ssl_builder_handlers.clone_obj = NULL; +#endif +} \ No newline at end of file diff --git a/ext/src/SSLOptions/Builder.dep b/ext/src/SSLOptions/Builder.dep new file mode 100644 index 000000000..af97699e3 --- /dev/null +++ b/ext/src/SSLOptions/Builder.dep @@ -0,0 +1,98 @@ +src/SSLOptions/Builder.lo: \ + /home/agabadounir/php-cassandra/ext/src/SSLOptions/Builder.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h /usr/include/php/20230831/ext/standard/php_filestat.h diff --git a/ext/src/Schema.dep b/ext/src/Schema.dep new file mode 100644 index 000000000..993e5b8fb --- /dev/null +++ b/ext/src/Schema.dep @@ -0,0 +1,96 @@ +src/Schema.lo: /home/agabadounir/php-cassandra/ext/src/Schema.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Session.dep b/ext/src/Session.dep new file mode 100644 index 000000000..cf2218e00 --- /dev/null +++ b/ext/src/Session.dep @@ -0,0 +1,96 @@ +src/Session.lo: /home/agabadounir/php-cassandra/ext/src/Session.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Set.c b/ext/src/Set.c index 58882e99b..172a3f2c6 100644 --- a/ext/src/Set.c +++ b/ext/src/Set.c @@ -24,20 +24,20 @@ zend_class_entry *php_driver_set_ce = NULL; int -php_driver_set_add(php_driver_set *set, zval *object TSRMLS_DC) +php_driver_set_add(php_driver_set *set, zval *object) { php_driver_set_entry *entry; php_driver_type *type; if (Z_TYPE_P(object) == IS_NULL) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Invalid value: null is not supported inside sets"); return 0; } - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(set->type)); + type = PHP_DRIVER_GET_TYPE(&set->type); - if (!php_driver_validate_object(object, PHP5TO7_ZVAL_MAYBE_P(type->data.set.value_type) TSRMLS_CC)) { + if (!php_driver_validate_object(object, &type->data.set.value_type)) { return 0; } @@ -45,7 +45,7 @@ php_driver_set_add(php_driver_set *set, zval *object TSRMLS_DC) if (entry == NULL) { set->dirty = 1; entry = (php_driver_set_entry *) emalloc(sizeof(php_driver_set_entry)); - PHP5TO7_ZVAL_COPY(PHP5TO7_ZVAL_MAYBE_P(entry->value), object); + ZVAL_COPY(&entry->value, object); HASH_ADD_ZVAL(set->entries, value, entry); } @@ -53,15 +53,15 @@ php_driver_set_add(php_driver_set *set, zval *object TSRMLS_DC) } static int -php_driver_set_del(php_driver_set *set, zval *object TSRMLS_DC) +php_driver_set_del(php_driver_set *set, zval *object) { php_driver_set_entry *entry; php_driver_type *type; int result = 0; - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(set->type)); + type = PHP_DRIVER_GET_TYPE(&set->type); - if (!php_driver_validate_object(object, PHP5TO7_ZVAL_MAYBE_P(type->data.set.value_type) TSRMLS_CC)) { + if (!php_driver_validate_object(object, &type->data.set.value_type)) { return 0; } @@ -81,15 +81,15 @@ php_driver_set_del(php_driver_set *set, zval *object TSRMLS_DC) } static int -php_driver_set_has(php_driver_set *set, zval *object TSRMLS_DC) +php_driver_set_has(php_driver_set *set, zval *object) { php_driver_set_entry *entry; php_driver_type *type; int result = 0; - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(set->type)); + type = PHP_DRIVER_GET_TYPE(&set->type); - if (!php_driver_validate_object(object, PHP5TO7_ZVAL_MAYBE_P(type->data.set.value_type) TSRMLS_CC)) { + if (!php_driver_validate_object(object, &type->data.set.value_type)) { return 0; } @@ -102,14 +102,14 @@ php_driver_set_has(php_driver_set *set, zval *object TSRMLS_DC) } static void -php_driver_set_populate(php_driver_set *set, zval *array TSRMLS_DC) +php_driver_set_populate(php_driver_set *set, zval *array) { php_driver_set_entry *curr, *temp; HASH_ITER(hh, set->entries, curr, temp) { - if (add_next_index_zval(array, PHP5TO7_ZVAL_MAYBE_P(curr->value)) != SUCCESS) { + if (add_next_index_zval(array, &curr->value) != SUCCESS) { break; } - Z_TRY_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(curr->value)); + Z_TRY_ADDREF_P(&curr->value); } } @@ -119,22 +119,22 @@ PHP_METHOD(Set, __construct) php_driver_set *self; zval *type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &type) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &type) == FAILURE) return; self = PHP_DRIVER_GET_SET(getThis()); if (Z_TYPE_P(type) == IS_STRING) { CassValueType value_type; - if (!php_driver_value_type(Z_STRVAL_P(type), &value_type TSRMLS_CC)) + if (!php_driver_value_type(Z_STRVAL_P(type), &value_type)) return; - self->type = php_driver_type_set_from_value_type(value_type TSRMLS_CC); + self->type = php_driver_type_set_from_value_type(value_type); } else if (Z_TYPE_P(type) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(type), php_driver_type_ce TSRMLS_CC)) { - if (!php_driver_type_validate(type, "type" TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(type), php_driver_type_ce)) { + if (!php_driver_type_validate(type, "type")) { return; } - self->type = php_driver_type_set(type TSRMLS_CC); + self->type = php_driver_type_set(type); Z_ADDREF_P(type); } else { INVALID_ARGUMENT(type, "a string or an instance of " PHP_DRIVER_NAMESPACE "\\Type"); @@ -146,7 +146,7 @@ PHP_METHOD(Set, __construct) PHP_METHOD(Set, type) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->type), 1, 0); + RETURN_ZVAL(&self->type, 1, 0); } /* }}} */ @@ -156,7 +156,7 @@ PHP_METHOD(Set, values) php_driver_set *set = NULL; array_init(return_value); set = PHP_DRIVER_GET_SET(getThis()); - php_driver_set_populate(set, return_value TSRMLS_CC); + php_driver_set_populate(set, return_value); } /* }}} */ @@ -166,12 +166,12 @@ PHP_METHOD(Set, add) php_driver_set *self = NULL; zval *object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &object) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &object) == FAILURE) return; self = PHP_DRIVER_GET_SET(getThis()); - if (php_driver_set_add(self, object TSRMLS_CC)) + if (php_driver_set_add(self, object)) RETURN_TRUE; RETURN_FALSE; @@ -184,12 +184,12 @@ PHP_METHOD(Set, remove) php_driver_set *self = NULL; zval *object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &object) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &object) == FAILURE) return; self = PHP_DRIVER_GET_SET(getThis()); - if (php_driver_set_del(self, object TSRMLS_CC)) + if (php_driver_set_del(self, object)) RETURN_TRUE; RETURN_FALSE; @@ -202,12 +202,12 @@ PHP_METHOD(Set, has) php_driver_set *self = NULL; zval *object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &object) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &object) == FAILURE) return; self = PHP_DRIVER_GET_SET(getThis()); - if (php_driver_set_has(self, object TSRMLS_CC)) + if (php_driver_set_has(self, object)) RETURN_TRUE; RETURN_FALSE; @@ -215,6 +215,10 @@ PHP_METHOD(Set, has) /* }}} */ /* {{{ Set::count() */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Set, count) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); @@ -223,15 +227,23 @@ PHP_METHOD(Set, count) /* }}} */ /* {{{ Set::current() */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Set, current) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); if (self->iter_curr != NULL) - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->iter_curr->value), 1, 0); + RETURN_ZVAL(&self->iter_curr->value, 1, 0); } /* }}} */ /* {{{ Set::key() */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_key, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Set, key) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); @@ -240,6 +252,10 @@ PHP_METHOD(Set, key) /* }}} */ /* {{{ Set::next() */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_next, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Set, next) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); @@ -250,6 +266,10 @@ PHP_METHOD(Set, next) /* }}} */ /* {{{ Set::valid() */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Set, valid) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); @@ -258,6 +278,10 @@ PHP_METHOD(Set, valid) /* }}} */ /* {{{ Set::rewind() */ +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_rewind, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() +#endif PHP_METHOD(Set, rewind) { php_driver_set *self = PHP_DRIVER_GET_SET(getThis()); @@ -286,51 +310,114 @@ static zend_function_entry php_driver_set_methods[] = { PHP_ME(Set, has, arginfo_one, ZEND_ACC_PUBLIC) PHP_ME(Set, remove, arginfo_one, ZEND_ACC_PUBLIC) /* Countable */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Set, count, arginfo_count, ZEND_ACC_PUBLIC) +#else PHP_ME(Set, count, arginfo_none, ZEND_ACC_PUBLIC) +#endif /* Iterator */ +#if PHP_VERSION_ID >= 80100 + PHP_ME(Set, current, arginfo_current, ZEND_ACC_PUBLIC) +#else PHP_ME(Set, current, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Set, key, arginfo_key, ZEND_ACC_PUBLIC) +#else PHP_ME(Set, key, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Set, next, arginfo_next, ZEND_ACC_PUBLIC) +#else PHP_ME(Set, next, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Set, valid, arginfo_valid, ZEND_ACC_PUBLIC) +#else PHP_ME(Set, valid, arginfo_none, ZEND_ACC_PUBLIC) +#endif +#if PHP_VERSION_ID >= 80100 + PHP_ME(Set, rewind, arginfo_rewind, ZEND_ACC_PUBLIC) +#else PHP_ME(Set, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; -static php_driver_value_handlers php_driver_set_handlers; +static zend_object_handlers php_driver_set_handlers; + +#if PHP_VERSION_ID >= 80000 +static int +php_driver_bucket_data_compare(Bucket *a, Bucket *b) +{ + return php_driver_data_compare(&a->val, &b->val); +} static HashTable * -php_driver_set_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_set_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else +static HashTable * +php_driver_set_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif -static HashTable * -php_driver_set_properties(zval *object TSRMLS_DC) +#if PHP_VERSION_ID >= 80000 +static HashTable* +php_driver_set_properties(zend_object* object) { - php5to7_zval values; + zval values; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_set* self = PHP_DRIVER_GET_SET(&obj_zval); + HashTable* props = zend_std_get_properties(object); - php_driver_set *self = PHP_DRIVER_GET_SET(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + zend_hash_update(props, zend_string_init("type", 4, 0), &self->type); + Z_TRY_ADDREF_P(&self->type); + array_init(&values); + php_driver_set_populate(self, &values); + zend_hash_sort(Z_ARRVAL(values), php_driver_bucket_data_compare, 1); + zend_hash_update(props, zend_string_init("values", 6, 0), &values); - PHP5TO7_ZEND_HASH_UPDATE(props, - "type", sizeof("type"), - PHP5TO7_ZVAL_MAYBE_P(self->type), sizeof(zval)); - Z_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(self->type)); + return props; +} +#else +static HashTable* +php_driver_set_properties(zval* object TSRMLS_DC) +{ + zval* values; + php_driver_set* self = PHP_DRIVER_GET_SET(object); + HashTable* props = zend_std_get_properties(object TSRMLS_CC); - PHP5TO7_ZVAL_MAYBE_MAKE(values); - array_init(PHP5TO7_ZVAL_MAYBE_P(values)); - php_driver_set_populate(self , PHP5TO7_ZVAL_MAYBE_P(values) TSRMLS_CC); - PHP5TO7_ZEND_HASH_SORT(Z_ARRVAL_P(PHP5TO7_ZVAL_MAYBE_P(values)), php_driver_data_compare, 1); - PHP5TO7_ZEND_HASH_UPDATE(props, "values", sizeof("values"), PHP5TO7_ZVAL_MAYBE_P(values), sizeof(zval)); + zend_hash_update(props, "type", sizeof("type"), &self->type, sizeof(zval), NULL); + Z_ADDREF_P(&self->type); - return props; + MAKE_STD_ZVAL(values); + array_init(values); + php_driver_set_populate(self, values TSRMLS_CC); + zend_hash_sort(Z_ARRVAL_P(values), php_driver_data_compare, 1 TSRMLS_CC); + zend_hash_update(props, "values", sizeof("values"), values, sizeof(zval), NULL); + + return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_set_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_set_compare(zval *obj1, zval *obj2) +#endif { php_driver_set_entry *curr, *temp; php_driver_set *set1; @@ -345,10 +432,14 @@ php_driver_set_compare(zval *obj1, zval *obj2 TSRMLS_DC) set1 = PHP_DRIVER_GET_SET(obj1); set2 = PHP_DRIVER_GET_SET(obj2); - type1 = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(set1->type)); - type2 = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(set2->type)); + type1 = PHP_DRIVER_GET_TYPE(&set1->type); + type2 = PHP_DRIVER_GET_TYPE(&set2->type); +#if PHP_VERSION_ID < 80000 result = php_driver_type_compare(type1, type2 TSRMLS_CC); +#else + result = php_driver_type_compare(type1, type2); +#endif if (result != 0) return result; if (HASH_COUNT(set1->entries) != HASH_COUNT(set2->entries)) { @@ -357,7 +448,7 @@ php_driver_set_compare(zval *obj1, zval *obj2 TSRMLS_DC) HASH_ITER(hh, set1->entries, curr, temp) { php_driver_set_entry *entry; - HASH_FIND_ZVAL(set2->entries, PHP5TO7_ZVAL_MAYBE_P(curr->value), entry); + HASH_FIND_ZVAL(set2->entries, &curr->value, entry); if (entry == NULL) { return 1; } @@ -366,6 +457,7 @@ php_driver_set_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 0; } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_set_hash_value(zval *obj TSRMLS_DC) { @@ -376,7 +468,7 @@ php_driver_set_hash_value(zval *obj TSRMLS_DC) if (!self->dirty) return self->hashv; HASH_ITER(hh, self->entries, curr, temp) { - hashv = php_driver_combine_hash(hashv, php_driver_value_hash(PHP5TO7_ZVAL_MAYBE_P(curr->value) TSRMLS_CC)); + hashv = php_driver_combine_hash(hashv, php_driver_value_hash(&curr->value TSRMLS_CC)); } self->hashv = hashv; @@ -384,11 +476,13 @@ php_driver_set_hash_value(zval *obj TSRMLS_DC) return hashv; } +#endif +#if PHP_VERSION_ID >= 80000 static void -php_driver_set_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_set_free(zend_object *object) { - php_driver_set *self = PHP5TO7_ZEND_OBJECT_GET(set, object); + php_driver_set *self = (php_driver_set *) ((char *) (object) - zend_object_handlers_offset(object->handlers)); php_driver_set_entry *curr, *temp; HASH_ITER(hh, self->entries, curr, temp) { @@ -397,25 +491,75 @@ php_driver_set_free(php5to7_zend_object_free *object TSRMLS_DC) efree(curr); } - PHP5TO7_ZVAL_MAYBE_DESTROY(self->type); + if (!Z_ISUNDEF(self->type)) { + zval_ptr_dtor(&self->type); + } + + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_set_free(void *object TSRMLS_DC) +{ + php_driver_set *self = (php_driver_set *) object; + php_driver_set_entry *curr, *temp; + + HASH_ITER(hh, self->entries, curr, temp) { + zval_ptr_dtor(&curr->value); + HASH_DEL(self->entries, curr); + efree(curr); + } + + zval_ptr_dtor(&self->type); zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_set_new(zend_class_entry *ce) +{ + php_driver_set *self = ecalloc(1, sizeof(php_driver_set) + zend_object_properties_size(ce)); + + self->entries = self->iter_curr = self->iter_temp = NULL; + self->iter_index = 0; + self->dirty = 1; + ZVAL_UNDEF(&self->type); + + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + + self->std.handlers = &php_driver_set_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_set_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_set *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(set, ce); + zend_object_value retval; + php_driver_set *self; + + self = (php_driver_set *) ecalloc(1, sizeof(php_driver_set)); self->entries = self->iter_curr = self->iter_temp = NULL; self->iter_index = 0; self->dirty = 1; - PHP5TO7_ZVAL_UNDEF(self->type); + ZVAL_UNDEF(&self->type); + + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); - PHP5TO7_ZEND_OBJECT_INIT(set, self, ce); + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_set_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_set_handlers; + + return retval; } +#endif void php_driver_define_Set(TSRMLS_D) { @@ -423,17 +567,27 @@ void php_driver_define_Set(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Set", php_driver_set_methods); php_driver_set_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_set_ce TSRMLS_CC, 1, php_driver_value_ce); + php_driver_set_ce->create_object = php_driver_set_new; + php_driver_set_ce->ce_flags |= ZEND_ACC_FINAL; + zend_class_implements(php_driver_set_ce, 1, php_driver_value_ce); + +#if PHP_VERSION_ID >= 80000 + memcpy(&php_driver_set_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + php_driver_set_handlers.offset = XtOffsetOf(php_driver_set, std); + php_driver_set_handlers.free_obj = php_driver_set_free; + php_driver_set_handlers.get_gc = php_driver_set_gc; + php_driver_set_handlers.compare = php_driver_set_compare; + php_driver_set_handlers.clone_obj = NULL; + zend_class_implements(php_driver_set_ce, 2, zend_ce_countable, zend_ce_iterator); +#else memcpy(&php_driver_set_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_set_handlers.std.get_properties = php_driver_set_properties; + php_driver_set_handlers.get_properties = php_driver_set_properties; + php_driver_set_handlers.compare_objects = php_driver_set_compare; + php_driver_set_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_set_handlers.std.get_gc = php_driver_set_gc; + php_driver_set_handlers.get_gc = php_driver_set_gc; #endif - php_driver_set_handlers.std.compare_objects = php_driver_set_compare; - php_driver_set_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; - php_driver_set_ce->create_object = php_driver_set_new; - zend_class_implements(php_driver_set_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); - php_driver_set_handlers.hash_value = php_driver_set_hash_value; - php_driver_set_handlers.std.clone_obj = NULL; -} + zend_class_implements(php_driver_set_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); +#endif +} \ No newline at end of file diff --git a/ext/src/Set.dep b/ext/src/Set.dep new file mode 100644 index 000000000..be33907a2 --- /dev/null +++ b/ext/src/Set.dep @@ -0,0 +1,97 @@ +src/Set.lo: /home/agabadounir/php-cassandra/ext/src/Set.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/collections.h util/hash.h util/uthash.h \ + util/types.h /usr/include/php/20230831/Zend/zend_smart_str.h src/Set.h diff --git a/ext/src/SimpleStatement.c b/ext/src/SimpleStatement.c index 7aea053d0..7877fa412 100644 --- a/ext/src/SimpleStatement.c +++ b/ext/src/SimpleStatement.c @@ -24,7 +24,7 @@ PHP_METHOD(SimpleStatement, __construct) zval *cql = NULL; php_driver_statement *self = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &cql) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &cql) == FAILURE) { return; } @@ -48,27 +48,54 @@ static zend_function_entry php_driver_simple_statement_methods[] = { static zend_object_handlers php_driver_simple_statement_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_simple_statement_properties(zend_object *object) +{ + HashTable *props = zend_std_get_properties(object); + return props; +} +#else static HashTable * php_driver_simple_statement_properties(zval *object TSRMLS_DC) { HashTable *props = zend_std_get_properties(object TSRMLS_CC); - return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_simple_statement_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_simple_statement_compare(zval *obj1, zval *obj2) +#endif { if (Z_OBJCE_P(obj1) != Z_OBJCE_P(obj2)) return 1; /* different classes */ - return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj1); + return Z_OBJ_HANDLE_P(obj1) != Z_OBJ_HANDLE_P(obj2); } +#if PHP_VERSION_ID >= 80000 +static void +php_driver_simple_statement_free(zend_object *object) +{ + php_driver_statement *self = (php_driver_statement *) ((char *) (object) - XtOffsetOf(php_driver_statement, std)); + + if (self->data.simple.cql) { + efree(self->data.simple.cql); + self->data.simple.cql = NULL; + } + + zend_object_std_dtor(&self->std); +} +#else static void -php_driver_simple_statement_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_simple_statement_free(void *object TSRMLS_DC) { - php_driver_statement *self = PHP5TO7_ZEND_OBJECT_GET(statement, object); + php_driver_statement *self = (php_driver_statement *) object; if (self->data.simple.cql) { efree(self->data.simple.cql); @@ -76,20 +103,48 @@ php_driver_simple_statement_free(php5to7_zend_object_free *object TSRMLS_DC) } zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_simple_statement_new(zend_class_entry *ce) +{ + php_driver_statement *self = ecalloc(1, sizeof(php_driver_statement) + zend_object_properties_size(ce)); + + self->type = PHP_DRIVER_SIMPLE_STATEMENT; + self->data.simple.cql = NULL; + + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_simple_statement_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_simple_statement_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_statement *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(statement, ce); + zend_object_value retval; + php_driver_statement *self; + + self = (php_driver_statement *) ecalloc(1, sizeof(php_driver_statement)); self->type = PHP_DRIVER_SIMPLE_STATEMENT; self->data.simple.cql = NULL; - PHP5TO7_ZEND_OBJECT_INIT_EX(statement, simple_statement, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_simple_statement_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_simple_statement_handlers; + + return retval; } +#endif void php_driver_define_SimpleStatement(TSRMLS_D) { @@ -97,12 +152,25 @@ void php_driver_define_SimpleStatement(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\SimpleStatement", php_driver_simple_statement_methods); php_driver_simple_statement_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_simple_statement_ce TSRMLS_CC, 1, php_driver_statement_ce); - php_driver_simple_statement_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + zend_class_implements(php_driver_simple_statement_ce, 1, php_driver_statement_ce); + php_driver_simple_statement_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_simple_statement_ce->create_object = php_driver_simple_statement_new; memcpy(&php_driver_simple_statement_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_simple_statement_handlers.get_properties = php_driver_simple_statement_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_simple_statement_handlers.offset = XtOffsetOf(php_driver_statement, std); + php_driver_simple_statement_handlers.free_obj = php_driver_simple_statement_free; + php_driver_simple_statement_handlers.get_properties = php_driver_simple_statement_properties; + php_driver_simple_statement_handlers.compare = php_driver_simple_statement_compare; + php_driver_simple_statement_handlers.clone_obj = NULL; +#else + php_driver_simple_statement_handlers.get_properties = php_driver_simple_statement_properties; + #if PHP_VERSION_ID >= 80000 + php_driver_simple_statement_handlers.compare = php_driver_simple_statement_compare; +#else php_driver_simple_statement_handlers.compare_objects = php_driver_simple_statement_compare; +#endif php_driver_simple_statement_handlers.clone_obj = NULL; -} +#endif +} \ No newline at end of file diff --git a/ext/src/SimpleStatement.dep b/ext/src/SimpleStatement.dep new file mode 100644 index 000000000..de20a0eef --- /dev/null +++ b/ext/src/SimpleStatement.dep @@ -0,0 +1,97 @@ +src/SimpleStatement.lo: \ + /home/agabadounir/php-cassandra/ext/src/SimpleStatement.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h diff --git a/ext/src/Smallint.c b/ext/src/Smallint.c index b817e6658..ca9ac1caf 100644 --- a/ext/src/Smallint.c +++ b/ext/src/Smallint.c @@ -28,25 +28,25 @@ zend_class_entry *php_driver_smallint_ce = NULL; static int -to_double(zval *result, php_driver_numeric *smallint TSRMLS_DC) +to_double(zval *result, php_driver_numeric *smallint) { ZVAL_DOUBLE(result, (double) smallint->data.smallint.value); return SUCCESS; } static int -to_long(zval *result, php_driver_numeric *smallint TSRMLS_DC) +to_long(zval *result, php_driver_numeric *smallint) { - ZVAL_LONG(result, (php5to7_long) smallint->data.smallint.value); + ZVAL_LONG(result, (zend_long) smallint->data.smallint.value); return SUCCESS; } static int -to_string(zval *result, php_driver_numeric *smallint TSRMLS_DC) +to_string(zval *result, php_driver_numeric *smallint) { char *string; spprintf(&string, 0, "%d", smallint->data.smallint.value); - PHP5TO7_ZVAL_STRING(result, string); + ZVAL_STRING(result, string); efree(string); return SUCCESS; } @@ -58,11 +58,11 @@ php_driver_smallint_init(INTERNAL_FUNCTION_PARAMETERS) zval *value; cass_int32_t number; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } - if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_smallint_ce TSRMLS_CC)) { + if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_smallint_ce)) { self = PHP_DRIVER_GET_NUMERIC(getThis()); } else { object_init_ex(return_value, php_driver_smallint_ce); @@ -70,7 +70,7 @@ php_driver_smallint_init(INTERNAL_FUNCTION_PARAMETERS) } if (Z_TYPE_P(value) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(value), php_driver_smallint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(value), php_driver_smallint_ce)) { php_driver_numeric *other = PHP_DRIVER_GET_NUMERIC(value); self->data.smallint.value = other->data.smallint.value; } else { @@ -78,7 +78,7 @@ php_driver_smallint_init(INTERNAL_FUNCTION_PARAMETERS) number = (cass_int32_t) Z_LVAL_P(value); if (number < INT16_MIN || number > INT16_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -32768 and 32767, %ld given", Z_LVAL_P(value)); return; } @@ -86,28 +86,23 @@ php_driver_smallint_init(INTERNAL_FUNCTION_PARAMETERS) number = (cass_int32_t) Z_DVAL_P(value); if (number < INT16_MIN || number > INT16_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -32768 and 32767, %g given", Z_DVAL_P(value)); return; } } else if (Z_TYPE_P(value) == IS_STRING) { if (!php_driver_parse_int(Z_STRVAL_P(value), Z_STRLEN_P(value), - &number TSRMLS_CC)) { - - // If the parsing function fails, it would have set an exception. If it's - // a range error, the error message would be wrong because the parsing - // function supports all 32-bit values, so the "valid" range it reports would - // be too large for Smallint. Reset the exception in that case. + &number)) { if (errno == ERANGE) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -32768 and 32767, %s given", Z_STRVAL_P(value)); } return; } if (number < INT16_MIN || number > INT16_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -32768 and 32767, %s given", Z_STRVAL_P(value)); return; } @@ -127,20 +122,23 @@ PHP_METHOD(Smallint, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Smallint::__toString() */ PHP_METHOD(Smallint, __toString) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_string(return_value, self TSRMLS_CC); + to_string(return_value, self); } /* }}} */ /* {{{ Smallint::type() */ PHP_METHOD(Smallint, type) { - php5to7_zval type = php_driver_type_scalar(CASS_VALUE_TYPE_SMALL_INT TSRMLS_CC); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(type), 1, 1); + zval type = php_driver_type_scalar(CASS_VALUE_TYPE_SMALL_INT); + RETURN_ZVAL(&type, 1, 1); } /* }}} */ @@ -149,7 +147,7 @@ PHP_METHOD(Smallint, value) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_long(return_value, self TSRMLS_CC); + to_long(return_value, self); } /* }}} */ @@ -161,12 +159,12 @@ PHP_METHOD(Smallint, add) php_driver_numeric *smallint; php_driver_numeric *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &addend) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &addend) == FAILURE) { return; } if (Z_TYPE_P(addend) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(addend), php_driver_smallint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(addend), php_driver_smallint_ce)) { self = PHP_DRIVER_GET_NUMERIC(getThis()); smallint = PHP_DRIVER_GET_NUMERIC(addend); @@ -175,7 +173,7 @@ PHP_METHOD(Smallint, add) result->data.smallint.value = self->data.smallint.value + smallint->data.smallint.value; if (result->data.smallint.value - smallint->data.smallint.value != self->data.smallint.value) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Sum is out of range"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Sum is out of range"); return; } } else { @@ -190,12 +188,12 @@ PHP_METHOD(Smallint, sub) zval *difference; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &difference) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &difference) == FAILURE) { return; } if (Z_TYPE_P(difference) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(difference), php_driver_smallint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(difference), php_driver_smallint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *smallint = PHP_DRIVER_GET_NUMERIC(difference); @@ -204,7 +202,7 @@ PHP_METHOD(Smallint, sub) result->data.smallint.value = self->data.smallint.value - smallint->data.smallint.value; if (result->data.smallint.value + smallint->data.smallint.value != self->data.smallint.value) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Difference is out of range"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Difference is out of range"); return; } } else { @@ -219,12 +217,12 @@ PHP_METHOD(Smallint, mul) zval *multiplier; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &multiplier) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &multiplier) == FAILURE) { return; } if (Z_TYPE_P(multiplier) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(multiplier), php_driver_smallint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(multiplier), php_driver_smallint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *smallint = PHP_DRIVER_GET_NUMERIC(multiplier); @@ -234,7 +232,7 @@ PHP_METHOD(Smallint, mul) result->data.smallint.value = self->data.smallint.value * smallint->data.smallint.value; if (smallint->data.smallint.value != 0 && result->data.smallint.value / smallint->data.smallint.value != self->data.smallint.value) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Product is out of range"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Product is out of range"); return; } } else { @@ -249,12 +247,12 @@ PHP_METHOD(Smallint, div) zval *divisor; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &divisor) == FAILURE) { return; } if (Z_TYPE_P(divisor) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(divisor), php_driver_smallint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(divisor), php_driver_smallint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *smallint = PHP_DRIVER_GET_NUMERIC(divisor); @@ -262,7 +260,7 @@ PHP_METHOD(Smallint, div) result = PHP_DRIVER_GET_NUMERIC(return_value); if (smallint->data.smallint.value == 0) { - zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0 TSRMLS_CC, "Cannot divide by zero"); + zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0, "Cannot divide by zero"); return; } @@ -279,12 +277,12 @@ PHP_METHOD(Smallint, mod) zval *divisor; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &divisor) == FAILURE) { return; } if (Z_TYPE_P(divisor) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(divisor), php_driver_smallint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(divisor), php_driver_smallint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *smallint = PHP_DRIVER_GET_NUMERIC(divisor); @@ -292,7 +290,7 @@ PHP_METHOD(Smallint, mod) result = PHP_DRIVER_GET_NUMERIC(return_value); if (smallint->data.smallint.value == 0) { - zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0 TSRMLS_CC, "Cannot modulo by zero"); + zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0, "Cannot modulo by zero"); return; } @@ -310,7 +308,7 @@ PHP_METHOD(Smallint, abs) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.smallint.value == INT16_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value doesn't exist"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value doesn't exist"); return; } @@ -327,7 +325,7 @@ PHP_METHOD(Smallint, neg) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.smallint.value == INT16_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value doesn't exist"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value doesn't exist"); return; } @@ -344,7 +342,7 @@ PHP_METHOD(Smallint, sqrt) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.smallint.value < 0) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Cannot take a square root of a negative number"); } @@ -359,7 +357,7 @@ PHP_METHOD(Smallint, toInt) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_long(return_value, self TSRMLS_CC); + to_long(return_value, self); } /* }}} */ @@ -368,7 +366,7 @@ PHP_METHOD(Smallint, toDouble) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_double(return_value, self TSRMLS_CC); + to_double(return_value, self); } /* }}} */ @@ -405,7 +403,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_smallint_methods[] = { PHP_ME(Smallint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Smallint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Smallint, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Smallint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Smallint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Smallint, add, arginfo_num, ZEND_ACC_PUBLIC) @@ -423,37 +421,75 @@ static zend_function_entry php_driver_smallint_methods[] = { PHP_FE_END }; -static php_driver_value_handlers php_driver_smallint_handlers; +static zend_object_handlers php_driver_smallint_handlers; +#if PHP_VERSION_ID >= 80000 static HashTable * -php_driver_smallint_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_smallint_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else +static HashTable * +php_driver_smallint_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_smallint_properties(zend_object *object) +{ + zval type; + zval value; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zval); + HashTable *props = zend_std_get_properties(object); + type = php_driver_type_scalar(CASS_VALUE_TYPE_SMALL_INT); + zend_hash_update(props, zend_string_init("type", 4, 0), &type); + + to_string(&value, self); + zend_hash_update(props, zend_string_init("value", 5, 0), &value); + + return props; +} +#else static HashTable * php_driver_smallint_properties(zval *object TSRMLS_DC) { - php5to7_zval type; - php5to7_zval value; + zval* type; + zval* value; php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); HashTable *props = zend_std_get_properties(object TSRMLS_CC); - type = php_driver_type_scalar(CASS_VALUE_TYPE_SMALL_INT TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + MAKE_STD_ZVAL(type); + *type = php_driver_type_scalar(CASS_VALUE_TYPE_SMALL_INT TSRMLS_CC); + zend_hash_update(props, "type", sizeof("type"), &type, sizeof(zval), NULL); - PHP5TO7_ZVAL_MAYBE_MAKE(value); - to_string(PHP5TO7_ZVAL_MAYBE_P(value), self TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "value", sizeof("value"), PHP5TO7_ZVAL_MAYBE_P(value), sizeof(zval)); + MAKE_STD_ZVAL(value); + to_string(value, self TSRMLS_CC); + zend_hash_update(props, "value", sizeof("value"), &value, sizeof(zval), NULL); return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_smallint_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_smallint_compare(zval *obj1, zval *obj2) +#endif { php_driver_numeric *smallint1 = NULL; php_driver_numeric *smallint2 = NULL; @@ -472,13 +508,37 @@ php_driver_smallint_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 1; } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_smallint_hash_value(zval *obj TSRMLS_DC) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(obj); return 31 * 17 + self->data.smallint.value; } +#endif + +#if PHP_VERSION_ID >= 80000 +static int +php_driver_smallint_cast(zend_object *object, zval *retval, int type) +{ + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zval); + + switch (type) { + case IS_LONG: + return to_long(retval, self); + case IS_DOUBLE: + return to_double(retval, self); + case IS_STRING: + return to_string(retval, self); + default: + return FAILURE; + } + return SUCCESS; +} +#else static int php_driver_smallint_cast(zval *object, zval *retval, int type TSRMLS_DC) { @@ -497,26 +557,60 @@ php_driver_smallint_cast(zval *object, zval *retval, int type TSRMLS_DC) return SUCCESS; } +#endif +#if PHP_VERSION_ID >= 80000 static void -php_driver_smallint_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_smallint_free(zend_object *object) { - php_driver_numeric *self = PHP5TO7_ZEND_OBJECT_GET(numeric, object); - + php_driver_numeric *self = (php_driver_numeric *) ((char *) (object) - XtOffsetOf(php_driver_numeric, std)); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_smallint_free(void *object TSRMLS_DC) +{ + php_driver_numeric *self = (php_driver_numeric *) object; zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_smallint_new(zend_class_entry *ce) +{ + php_driver_numeric *self = ecalloc(1, sizeof(php_driver_numeric) + zend_object_properties_size(ce)); + + self->type = PHP_DRIVER_SMALLINT; + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_smallint_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_smallint_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_numeric *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(numeric, ce); + zend_object_value retval; + php_driver_numeric *self; + + self = (php_driver_numeric *) ecalloc(1, sizeof(php_driver_numeric)); self->type = PHP_DRIVER_SMALLINT; - PHP5TO7_ZEND_OBJECT_INIT_EX(numeric, smallint, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_smallint_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_smallint_handlers; + + return retval; } +#endif void php_driver_define_Smallint(TSRMLS_D) { @@ -524,17 +618,28 @@ void php_driver_define_Smallint(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Smallint", php_driver_smallint_methods); php_driver_smallint_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_smallint_ce TSRMLS_CC, 2, php_driver_value_ce, php_driver_numeric_ce); - php_driver_smallint_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + zend_class_implements(php_driver_smallint_ce, 2, php_driver_value_ce, php_driver_numeric_ce); + php_driver_smallint_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_smallint_ce->create_object = php_driver_smallint_new; memcpy(&php_driver_smallint_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_smallint_handlers.std.get_properties = php_driver_smallint_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_smallint_handlers.offset = XtOffsetOf(php_driver_numeric, std); + php_driver_smallint_handlers.free_obj = php_driver_smallint_free; + php_driver_smallint_handlers.get_properties = php_driver_smallint_properties; + php_driver_smallint_handlers.get_gc = php_driver_smallint_gc; + php_driver_smallint_handlers.compare = php_driver_smallint_compare; + php_driver_smallint_handlers.cast_object = php_driver_smallint_cast; + php_driver_smallint_handlers.clone_obj = NULL; +#else + php_driver_smallint_handlers.get_properties = php_driver_smallint_properties; + php_driver_smallint_handlers.compare_objects = php_driver_smallint_compare; + php_driver_smallint_handlers.cast_object = php_driver_smallint_cast; + php_driver_smallint_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_smallint_handlers.std.get_gc = php_driver_smallint_gc; + php_driver_smallint_handlers.get_gc = php_driver_smallint_gc; #endif - php_driver_smallint_handlers.std.compare_objects = php_driver_smallint_compare; - php_driver_smallint_handlers.std.cast_object = php_driver_smallint_cast; - php_driver_smallint_handlers.hash_value = php_driver_smallint_hash_value; +#endif } diff --git a/ext/src/Smallint.dep b/ext/src/Smallint.dep new file mode 100644 index 000000000..9325ae6e9 --- /dev/null +++ b/ext/src/Smallint.dep @@ -0,0 +1,98 @@ +src/Smallint.lo: /home/agabadounir/php-cassandra/ext/src/Smallint.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Statement.dep b/ext/src/Statement.dep new file mode 100644 index 000000000..aa9171b1b --- /dev/null +++ b/ext/src/Statement.dep @@ -0,0 +1,96 @@ +src/Statement.lo: /home/agabadounir/php-cassandra/ext/src/Statement.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Table.dep b/ext/src/Table.dep new file mode 100644 index 000000000..a459c5f68 --- /dev/null +++ b/ext/src/Table.dep @@ -0,0 +1,97 @@ +src/Table.lo: /home/agabadounir/php-cassandra/ext/src/Table.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + util/result.h diff --git a/ext/src/Time.c b/ext/src/Time.c index 39fb4a743..bfe42ab62 100644 --- a/ext/src/Time.c +++ b/ext/src/Time.c @@ -74,15 +74,14 @@ cass_int64_t php_driver_time_now_ns() { #endif static int -to_string(zval *result, php_driver_time *time TSRMLS_DC) -{ +to_string(zval *result, php_driver_time *time) { char *string; #ifdef WIN32 spprintf(&string, 0, "%I64d", (long long int) time->time); #else spprintf(&string, 0, "%lld", (long long int) time->time); #endif - PHP5TO7_ZVAL_STRING(result, string); + ZVAL_STRING(result, string); efree(string); return SUCCESS; } @@ -93,11 +92,11 @@ php_driver_time_init(INTERNAL_FUNCTION_PARAMETERS) zval *nanoseconds = NULL; php_driver_time *self; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", &nanoseconds) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &nanoseconds) == FAILURE) { return; } - if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_time_ce TSRMLS_CC)) { + if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_time_ce)) { self = PHP_DRIVER_GET_TIME(getThis()); } else { object_init_ex(return_value, php_driver_time_ce); @@ -111,7 +110,7 @@ php_driver_time_init(INTERNAL_FUNCTION_PARAMETERS) self->time = Z_LVAL_P(nanoseconds); } else if (Z_TYPE_P(nanoseconds) == IS_STRING) { if (!php_driver_parse_bigint(Z_STRVAL_P(nanoseconds), Z_STRLEN_P(nanoseconds), - &self->time TSRMLS_CC)) { + &self->time)) { return; } } else { @@ -134,8 +133,8 @@ PHP_METHOD(Time, __construct) /* {{{ Time::type() */ PHP_METHOD(Time, type) { - php5to7_zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TIME TSRMLS_CC); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(type), 1, 1); + zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TIME); + RETURN_ZVAL(&type, 1, 1); } /* }}} */ @@ -152,29 +151,31 @@ PHP_METHOD(Time, fromDateTime) { php_driver_time *self; zval *zdatetime; - php5to7_zval retval; + zval retval; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zdatetime) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zdatetime, php_date_get_date_ce()) == FAILURE) { return; } - zend_call_method_with_0_params(PHP5TO7_ZVAL_MAYBE_ADDR_OF(zdatetime), + zend_call_method_with_0_params(Z_OBJ_P(zdatetime), php_date_get_date_ce(), NULL, "gettimestamp", &retval); - if (!PHP5TO7_ZVAL_IS_UNDEF(retval) && - Z_TYPE_P(PHP5TO7_ZVAL_MAYBE_P(retval)) == IS_LONG) { + if (Z_TYPE(retval) == IS_LONG) { object_init_ex(return_value, php_driver_time_ce); self = PHP_DRIVER_GET_TIME(return_value); - self->time = cass_time_from_epoch(PHP5TO7_Z_LVAL_MAYBE_P(retval)); + self->time = cass_time_from_epoch(Z_LVAL(retval)); zval_ptr_dtor(&retval); return; } } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Time::__toString() */ PHP_METHOD(Time, __toString) { @@ -185,7 +186,7 @@ PHP_METHOD(Time, __toString) } self = PHP_DRIVER_GET_TIME(getThis()); - to_string(return_value, self TSRMLS_CC); + to_string(return_value, self); } /* }}} */ @@ -205,41 +206,79 @@ static zend_function_entry php_driver_time_methods[] = { PHP_ME(Time, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Time, seconds, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Time, fromDateTime, arginfo_datetime, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Time, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Time, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_FE_END }; -static php_driver_value_handlers php_driver_time_handlers; +static zend_object_handlers php_driver_time_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_time_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else static HashTable * -php_driver_time_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_time_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_time_properties(zend_object *object) +{ + zval type; + zval nanoseconds; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_time *self = PHP_DRIVER_GET_TIME(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_TIME); + zend_hash_update(props, zend_string_init("type", 4, 0), &type); + to_string(&nanoseconds, self); + zend_hash_update(props, zend_string_init("nanoseconds", 11, 0), &nanoseconds); + + return props; +} +#else static HashTable * php_driver_time_properties(zval *object TSRMLS_DC) { - php5to7_zval type; - php5to7_zval nanoseconds; + zval* type; + zval* nanoseconds; php_driver_time *self = PHP_DRIVER_GET_TIME(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); - type = php_driver_type_scalar(CASS_VALUE_TYPE_TIME TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + MAKE_STD_ZVAL(type); + *type = php_driver_type_scalar(CASS_VALUE_TYPE_TIME TSRMLS_CC); + zend_hash_update(props, "type", sizeof("type"), &type, sizeof(zval), NULL); - PHP5TO7_ZVAL_MAYBE_MAKE(nanoseconds); - to_string(PHP5TO7_ZVAL_MAYBE_P(nanoseconds), self TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "nanoseconds", sizeof("nanoseconds"), PHP5TO7_ZVAL_MAYBE_P(nanoseconds), sizeof(zval)); + MAKE_STD_ZVAL(nanoseconds); + to_string(nanoseconds, self TSRMLS_CC); + zend_hash_update(props, "nanoseconds", sizeof("nanoseconds"), &nanoseconds, sizeof(zval), NULL); return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_time_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_time_compare(zval *obj1, zval *obj2) +#endif { php_driver_time *time1 = NULL; php_driver_time *time2 = NULL; @@ -252,32 +291,67 @@ php_driver_time_compare(zval *obj1, zval *obj2 TSRMLS_DC) return PHP_DRIVER_COMPARE(time1->time, time2->time); } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_time_hash_value(zval *obj TSRMLS_DC) { php_driver_time *self = PHP_DRIVER_GET_TIME(obj); return php_driver_bigint_hash(self->time); } +#endif +#if PHP_VERSION_ID >= 80000 static void -php_driver_time_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_time_free(zend_object *object) { - php_driver_time *self = PHP5TO7_ZEND_OBJECT_GET(time, object); - + php_driver_time *self = (php_driver_time *) ((char *) (object) - XtOffsetOf(php_driver_time, std)); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_time_free(void *object TSRMLS_DC) +{ + php_driver_time *self = (php_driver_time *) object; zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_time_new(zend_class_entry *ce) +{ + php_driver_time *self = ecalloc(1, sizeof(php_driver_time) + zend_object_properties_size(ce)); + + self->time = 0; + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_time_handlers; -static php5to7_zend_object + return &self->std; +} +#else +static zend_object_value php_driver_time_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_time *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(time, ce); + zend_object_value retval; + php_driver_time *self; + + self = (php_driver_time *) ecalloc(1, sizeof(php_driver_time)); self->time = 0; - PHP5TO7_ZEND_OBJECT_INIT(time, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_time_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_time_handlers; + + return retval; } +#endif void php_driver_define_Time(TSRMLS_D) { @@ -285,15 +359,26 @@ void php_driver_define_Time(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Time", php_driver_time_methods); php_driver_time_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_time_ce TSRMLS_CC, 1, php_driver_value_ce); + zend_class_implements(php_driver_time_ce, 1, php_driver_value_ce); memcpy(&php_driver_time_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_time_handlers.std.get_properties = php_driver_time_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_time_handlers.offset = XtOffsetOf(php_driver_time, std); + php_driver_time_handlers.free_obj = php_driver_time_free; + php_driver_time_handlers.get_properties = php_driver_time_properties; + php_driver_time_handlers.get_gc = php_driver_time_gc; + php_driver_time_handlers.compare = php_driver_time_compare; + php_driver_time_handlers.clone_obj = NULL; +#else + php_driver_time_handlers.get_properties = php_driver_time_properties; + php_driver_time_handlers.compare_objects = php_driver_time_compare; + php_driver_time_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_time_handlers.std.get_gc = php_driver_time_gc; + php_driver_time_handlers.get_gc = php_driver_time_gc; #endif - php_driver_time_handlers.std.compare_objects = php_driver_time_compare; - php_driver_time_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; - php_driver_time_ce->create_object = php_driver_time_new; - php_driver_time_handlers.hash_value = php_driver_time_hash_value; +#endif + + php_driver_time_ce->ce_flags |= ZEND_ACC_FINAL; + php_driver_time_ce->create_object = php_driver_time_new; } diff --git a/ext/src/Time.dep b/ext/src/Time.dep new file mode 100644 index 000000000..2f0019ea9 --- /dev/null +++ b/ext/src/Time.dep @@ -0,0 +1,103 @@ +src/Time.lo: /home/agabadounir/php-cassandra/ext/src/Time.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h util/math.h \ + /usr/include/php/20230831/ext/date/php_date.h \ + /usr/include/php/20230831/ext/date/lib/timelib.h \ + /usr/include/php/20230831/ext/date/lib/timelib_config.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/ext/date/lib/timelib.h diff --git a/ext/src/Timestamp.c b/ext/src/Timestamp.c index ee9447ba1..b0b776491 100644 --- a/ext/src/Timestamp.c +++ b/ext/src/Timestamp.c @@ -30,7 +30,7 @@ php_driver_timestamp_init(INTERNAL_FUNCTION_PARAMETERS) php_driver_timestamp *self; cass_int64_t value = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ll", &seconds, µseconds) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &seconds, µseconds) == FAILURE) { return; } @@ -49,7 +49,7 @@ php_driver_timestamp_init(INTERNAL_FUNCTION_PARAMETERS) value += microseconds / 1000; value += (seconds * 1000); - if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_timestamp_ce TSRMLS_CC)) { + if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_timestamp_ce)) { self = PHP_DRIVER_GET_TIMESTAMP(getThis()); } else { object_init_ex(return_value, php_driver_timestamp_ce); @@ -69,8 +69,8 @@ PHP_METHOD(Timestamp, __construct) /* {{{ Timestamp::type() */ PHP_METHOD(Timestamp, type) { - php5to7_zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMESTAMP TSRMLS_CC); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(type), 1, 1); + zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMESTAMP); + RETURN_ZVAL(&type, 1, 1); } /* }}} */ @@ -92,7 +92,7 @@ PHP_METHOD(Timestamp, microtime) long sec = -1; double usec = 0.0f; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &get_as_float) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &get_as_float) == FAILURE) { return; } @@ -105,7 +105,7 @@ PHP_METHOD(Timestamp, microtime) sec = (long) (self->timestamp / 1000); usec = (double) ((self->timestamp - (sec * 1000)) / 1000.00); spprintf(&ret, 0, "%.8F %ld", usec, sec); - PHP5TO7_RETVAL_STRING(ret); + RETVAL_STRING(ret); efree(ret); } /* }}} */ @@ -126,23 +126,21 @@ PHP_METHOD(Timestamp, toDateTime) self = PHP_DRIVER_GET_TIMESTAMP(getThis()); - PHP5TO7_ZVAL_MAYBE_MAKE(datetime); - php_date_instantiate(php_date_get_date_ce(), datetime TSRMLS_CC); + php_date_instantiate(php_date_get_date_ce(), datetime); -#if PHP_MAJOR_VERSION >= 7 datetime_obj = php_date_obj_from_obj(Z_OBJ_P(datetime)); -#else - datetime_obj = zend_object_store_get_object(datetime TSRMLS_CC); -#endif str_len = spprintf(&str, 0, "@%ld", (long) (self->timestamp / 1000)); - php_date_initialize(datetime_obj, str, str_len, NULL, NULL, 0 TSRMLS_CC); + php_date_initialize(datetime_obj, str, str_len, NULL, NULL, 0); efree(str); RETVAL_ZVAL(datetime, 0, 1); } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Timestamp::__toString() */ PHP_METHOD(Timestamp, __toString) { @@ -156,7 +154,7 @@ PHP_METHOD(Timestamp, __toString) self = PHP_DRIVER_GET_TIMESTAMP(getThis()); spprintf(&ret, 0, "%lld", (long long int) self->timestamp); - PHP5TO7_RETVAL_STRING(ret); + RETVAL_STRING(ret); efree(ret); } /* }}} */ @@ -176,29 +174,67 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_timestamp_methods[] = { PHP_ME(Timestamp, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME(Timestamp, type, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Timestamp, time, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Timestamp, time, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timestamp, microtime, arginfo_microtime, ZEND_ACC_PUBLIC) - PHP_ME(Timestamp, toDateTime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Timestamp, __toString, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Timestamp, toDateTime, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Timestamp, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_FE_END }; -static php_driver_value_handlers php_driver_timestamp_handlers; +static zend_object_handlers php_driver_timestamp_handlers; +#if PHP_VERSION_ID >= 80000 static HashTable * -php_driver_timestamp_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_timestamp_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else +static HashTable * +php_driver_timestamp_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_timestamp_properties(zend_object *object) +{ + zval type; + zval seconds; + zval microseconds; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_timestamp *self = PHP_DRIVER_GET_TIMESTAMP(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + long sec = (long) (self->timestamp / 1000); + long usec = (long) ((self->timestamp - (sec * 1000)) * 1000); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMESTAMP); + zend_hash_update(props, zend_string_init("type", 4, 0), &type); + + ZVAL_LONG(&seconds, sec); + zend_hash_update(props, zend_string_init("seconds", 7, 0), &seconds); + ZVAL_LONG(µseconds, usec); + zend_hash_update(props, zend_string_init("microseconds", 12, 0), µseconds); + + return props; +} +#else static HashTable * php_driver_timestamp_properties(zval *object TSRMLS_DC) { - php5to7_zval type; - php5to7_zval seconds; - php5to7_zval microseconds; + zval* type; + zval* seconds; + zval* microseconds; php_driver_timestamp *self = PHP_DRIVER_GET_TIMESTAMP(object); HashTable *props = zend_std_get_properties(object TSRMLS_CC); @@ -206,22 +242,29 @@ php_driver_timestamp_properties(zval *object TSRMLS_DC) long sec = (long) (self->timestamp / 1000); long usec = (long) ((self->timestamp - (sec * 1000)) * 1000); - type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMESTAMP TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + MAKE_STD_ZVAL(type); + *type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMESTAMP TSRMLS_CC); + zend_hash_update(props, "type", sizeof("type"), &type, sizeof(zval), NULL); - PHP5TO7_ZVAL_MAYBE_MAKE(seconds); - ZVAL_LONG(PHP5TO7_ZVAL_MAYBE_P(seconds), sec); - PHP5TO7_ZEND_HASH_UPDATE(props, "seconds", sizeof("seconds"), PHP5TO7_ZVAL_MAYBE_P(seconds), sizeof(zval)); + MAKE_STD_ZVAL(seconds); + ZVAL_LONG(seconds, sec); + zend_hash_update(props, "seconds", sizeof("seconds"), &seconds, sizeof(zval), NULL); - PHP5TO7_ZVAL_MAYBE_MAKE(microseconds); - ZVAL_LONG(PHP5TO7_ZVAL_MAYBE_P(microseconds), usec); - PHP5TO7_ZEND_HASH_UPDATE(props, "microseconds", sizeof("microseconds"), PHP5TO7_ZVAL_MAYBE_P(microseconds), sizeof(zval)); + MAKE_STD_ZVAL(microseconds); + ZVAL_LONG(microseconds, usec); + zend_hash_update(props, "microseconds", sizeof("microseconds"), µseconds, sizeof(zval), NULL); return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_timestamp_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_timestamp_compare(zval *obj1, zval *obj2) +#endif { php_driver_timestamp *timestamp1 = NULL; php_driver_timestamp *timestamp2 = NULL; @@ -234,30 +277,64 @@ php_driver_timestamp_compare(zval *obj1, zval *obj2 TSRMLS_DC) return PHP_DRIVER_COMPARE(timestamp1->timestamp, timestamp2->timestamp); } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_timestamp_hash_value(zval *obj TSRMLS_DC) { php_driver_timestamp *self = PHP_DRIVER_GET_TIMESTAMP(obj); return php_driver_bigint_hash(self->timestamp); } +#endif +#if PHP_VERSION_ID >= 80000 static void -php_driver_timestamp_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_timestamp_free(zend_object *object) { - php_driver_timestamp *self = PHP5TO7_ZEND_OBJECT_GET(timestamp, object); - + php_driver_timestamp *self = (php_driver_timestamp *) ((char *) (object) - XtOffsetOf(php_driver_timestamp, std)); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_timestamp_free(void *object TSRMLS_DC) +{ + php_driver_timestamp *self = (php_driver_timestamp *) object; zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_timestamp_new(zend_class_entry *ce) +{ + php_driver_timestamp *self = ecalloc(1, sizeof(php_driver_timestamp) + zend_object_properties_size(ce)); -static php5to7_zend_object + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_timestamp_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_timestamp_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_timestamp *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(timestamp, ce); + zend_object_value retval; + php_driver_timestamp *self; + + self = (php_driver_timestamp *) ecalloc(1, sizeof(php_driver_timestamp)); + + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); - PHP5TO7_ZEND_OBJECT_INIT(timestamp, self, ce); + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_timestamp_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_timestamp_handlers; + + return retval; } +#endif void php_driver_define_Timestamp(TSRMLS_D) { @@ -265,16 +342,26 @@ void php_driver_define_Timestamp(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Timestamp", php_driver_timestamp_methods); php_driver_timestamp_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_timestamp_ce TSRMLS_CC, 1, php_driver_value_ce); + zend_class_implements(php_driver_timestamp_ce, 1, php_driver_value_ce); memcpy(&php_driver_timestamp_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_timestamp_handlers.std.get_properties = php_driver_timestamp_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_timestamp_handlers.offset = XtOffsetOf(php_driver_timestamp, std); + php_driver_timestamp_handlers.free_obj = php_driver_timestamp_free; + php_driver_timestamp_handlers.get_properties = php_driver_timestamp_properties; + php_driver_timestamp_handlers.get_gc = php_driver_timestamp_gc; + php_driver_timestamp_handlers.compare = php_driver_timestamp_compare; + php_driver_timestamp_handlers.clone_obj = NULL; +#else + php_driver_timestamp_handlers.get_properties = php_driver_timestamp_properties; + php_driver_timestamp_handlers.compare_objects = php_driver_timestamp_compare; + php_driver_timestamp_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_timestamp_handlers.std.get_gc = php_driver_timestamp_gc; + php_driver_timestamp_handlers.get_gc = php_driver_timestamp_gc; #endif - php_driver_timestamp_handlers.std.compare_objects = php_driver_timestamp_compare; - php_driver_timestamp_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; - php_driver_timestamp_ce->create_object = php_driver_timestamp_new; - php_driver_timestamp_handlers.hash_value = php_driver_timestamp_hash_value; - php_driver_timestamp_handlers.std.clone_obj = NULL; +#endif + + php_driver_timestamp_ce->ce_flags |= ZEND_ACC_FINAL; + php_driver_timestamp_ce->create_object = php_driver_timestamp_new; } diff --git a/ext/src/Timestamp.dep b/ext/src/Timestamp.dep new file mode 100644 index 000000000..cf0b4def7 --- /dev/null +++ b/ext/src/Timestamp.dep @@ -0,0 +1,103 @@ +src/Timestamp.lo: /home/agabadounir/php-cassandra/ext/src/Timestamp.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h \ + /usr/include/php/20230831/ext/date/php_date.h \ + /usr/include/php/20230831/ext/date/lib/timelib.h \ + /usr/include/php/20230831/ext/date/lib/timelib_config.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/main/php_version.h diff --git a/ext/src/TimestampGenerator.dep b/ext/src/TimestampGenerator.dep new file mode 100644 index 000000000..09f5608b7 --- /dev/null +++ b/ext/src/TimestampGenerator.dep @@ -0,0 +1,97 @@ +src/TimestampGenerator.lo: \ + /home/agabadounir/php-cassandra/ext/src/TimestampGenerator.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/TimestampGenerator/Monotonic.c b/ext/src/TimestampGenerator/Monotonic.c index 946d1e646..f20231ce5 100644 --- a/ext/src/TimestampGenerator/Monotonic.c +++ b/ext/src/TimestampGenerator/Monotonic.c @@ -26,26 +26,60 @@ static zend_function_entry php_driver_timestamp_gen_monotonic_methods[] = { static zend_object_handlers php_driver_timestamp_gen_monotonic_handlers; +#if PHP_VERSION_ID >= 80000 static void -php_driver_timestamp_gen_monotonic_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_timestamp_gen_monotonic_free(zend_object *object) { - php_driver_timestamp_gen *self = PHP5TO7_ZEND_OBJECT_GET(timestamp_gen, object); - + php_driver_timestamp_gen *self = (php_driver_timestamp_gen *) ((char *) (object) - XtOffsetOf(php_driver_timestamp_gen, std)); + cass_timestamp_gen_free(self->gen); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_timestamp_gen_monotonic_free(void *object TSRMLS_DC) +{ + php_driver_timestamp_gen *self = (php_driver_timestamp_gen *) object; cass_timestamp_gen_free(self->gen); - zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_timestamp_gen_monotonic_new(zend_class_entry *ce) +{ + php_driver_timestamp_gen *self = ecalloc(1, sizeof(php_driver_timestamp_gen) + zend_object_properties_size(ce)); -static php5to7_zend_object + self->gen = cass_timestamp_gen_monotonic_new(); + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_timestamp_gen_monotonic_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_timestamp_gen_monotonic_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_timestamp_gen *self = PHP5TO7_ZEND_OBJECT_ECALLOC(timestamp_gen, ce); + zend_object_value retval; + php_driver_timestamp_gen *self; + + self = (php_driver_timestamp_gen *) ecalloc(1, sizeof(php_driver_timestamp_gen)); self->gen = cass_timestamp_gen_monotonic_new(); - PHP5TO7_ZEND_OBJECT_INIT_EX(timestamp_gen, timestamp_gen_monotonic, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_timestamp_gen_monotonic_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_timestamp_gen_monotonic_handlers; + + return retval; } +#endif void php_driver_define_TimestampGeneratorMonotonic(TSRMLS_D) { @@ -53,9 +87,14 @@ void php_driver_define_TimestampGeneratorMonotonic(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\TimestampGenerator\\Monotonic", php_driver_timestamp_gen_monotonic_methods); php_driver_timestamp_gen_monotonic_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_timestamp_gen_monotonic_ce TSRMLS_CC, 1, php_driver_timestamp_gen_ce); - php_driver_timestamp_gen_monotonic_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + zend_class_implements(php_driver_timestamp_gen_monotonic_ce, 1, php_driver_timestamp_gen_ce); + php_driver_timestamp_gen_monotonic_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_timestamp_gen_monotonic_ce->create_object = php_driver_timestamp_gen_monotonic_new; memcpy(&php_driver_timestamp_gen_monotonic_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); -} + +#if PHP_VERSION_ID >= 80000 + php_driver_timestamp_gen_monotonic_handlers.offset = XtOffsetOf(php_driver_timestamp_gen, std); + php_driver_timestamp_gen_monotonic_handlers.free_obj = php_driver_timestamp_gen_monotonic_free; +#endif +} \ No newline at end of file diff --git a/ext/src/TimestampGenerator/Monotonic.dep b/ext/src/TimestampGenerator/Monotonic.dep new file mode 100644 index 000000000..798c59353 --- /dev/null +++ b/ext/src/TimestampGenerator/Monotonic.dep @@ -0,0 +1,99 @@ +src/TimestampGenerator/Monotonic.lo: \ + /home/agabadounir/php-cassandra/ext/src/TimestampGenerator/Monotonic.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/TimestampGenerator/ServerSide.c b/ext/src/TimestampGenerator/ServerSide.c index 9cda95ccf..9f3fe57f8 100644 --- a/ext/src/TimestampGenerator/ServerSide.c +++ b/ext/src/TimestampGenerator/ServerSide.c @@ -26,26 +26,60 @@ static zend_function_entry php_driver_timestamp_gen_server_side_methods[] = { static zend_object_handlers php_driver_timestamp_gen_server_side_handlers; +#if PHP_VERSION_ID >= 80000 static void -php_driver_timestamp_gen_server_side_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_timestamp_gen_server_side_free(zend_object *object) { - php_driver_timestamp_gen *self = PHP5TO7_ZEND_OBJECT_GET(timestamp_gen, object); - + php_driver_timestamp_gen *self = (php_driver_timestamp_gen *) ((char *) (object) - XtOffsetOf(php_driver_timestamp_gen, std)); + cass_timestamp_gen_free(self->gen); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_timestamp_gen_server_side_free(void *object TSRMLS_DC) +{ + php_driver_timestamp_gen *self = (php_driver_timestamp_gen *) object; cass_timestamp_gen_free(self->gen); - zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_timestamp_gen_server_side_new(zend_class_entry *ce) +{ + php_driver_timestamp_gen *self = ecalloc(1, sizeof(php_driver_timestamp_gen) + zend_object_properties_size(ce)); -static php5to7_zend_object + self->gen = cass_timestamp_gen_server_side_new(); + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_timestamp_gen_server_side_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_timestamp_gen_server_side_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_timestamp_gen *self = PHP5TO7_ZEND_OBJECT_ECALLOC(timestamp_gen, ce); + zend_object_value retval; + php_driver_timestamp_gen *self; + + self = (php_driver_timestamp_gen *) ecalloc(1, sizeof(php_driver_timestamp_gen)); self->gen = cass_timestamp_gen_server_side_new(); - PHP5TO7_ZEND_OBJECT_INIT_EX(timestamp_gen, timestamp_gen_server_side, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_timestamp_gen_server_side_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_timestamp_gen_server_side_handlers; + + return retval; } +#endif void php_driver_define_TimestampGeneratorServerSide(TSRMLS_D) { @@ -53,9 +87,14 @@ void php_driver_define_TimestampGeneratorServerSide(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\TimestampGenerator\\ServerSide", php_driver_timestamp_gen_server_side_methods); php_driver_timestamp_gen_server_side_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_timestamp_gen_server_side_ce TSRMLS_CC, 1, php_driver_timestamp_gen_ce); - php_driver_timestamp_gen_server_side_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + zend_class_implements(php_driver_timestamp_gen_server_side_ce, 1, php_driver_timestamp_gen_ce); + php_driver_timestamp_gen_server_side_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_timestamp_gen_server_side_ce->create_object = php_driver_timestamp_gen_server_side_new; memcpy(&php_driver_timestamp_gen_server_side_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); -} + +#if PHP_VERSION_ID >= 80000 + php_driver_timestamp_gen_server_side_handlers.offset = XtOffsetOf(php_driver_timestamp_gen, std); + php_driver_timestamp_gen_server_side_handlers.free_obj = php_driver_timestamp_gen_server_side_free; +#endif +} \ No newline at end of file diff --git a/ext/src/TimestampGenerator/ServerSide.dep b/ext/src/TimestampGenerator/ServerSide.dep new file mode 100644 index 000000000..03067c50d --- /dev/null +++ b/ext/src/TimestampGenerator/ServerSide.dep @@ -0,0 +1,99 @@ +src/TimestampGenerator/ServerSide.lo: \ + /home/agabadounir/php-cassandra/ext/src/TimestampGenerator/ServerSide.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Timeuuid.c b/ext/src/Timeuuid.c index 0b4832fae..9366cfdbd 100644 --- a/ext/src/Timeuuid.c +++ b/ext/src/Timeuuid.c @@ -31,11 +31,11 @@ php_driver_timeuuid_init(INTERNAL_FUNCTION_PARAMETERS) zval *param; int version; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", ¶m) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", ¶m) == FAILURE) { return; } - if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_timeuuid_ce TSRMLS_CC)) { + if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_timeuuid_ce)) { self = PHP_DRIVER_GET_UUID(getThis()); } else { object_init_ex(return_value, php_driver_timeuuid_ce); @@ -44,30 +44,30 @@ php_driver_timeuuid_init(INTERNAL_FUNCTION_PARAMETERS) if (ZEND_NUM_ARGS() == 0) { - php_driver_uuid_generate_time(&self->uuid TSRMLS_CC); + php_driver_uuid_generate_time(&self->uuid); } else { switch (Z_TYPE_P(param)) { case IS_LONG: if (Z_LVAL_P(param) < 0) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, "Timestamp must be a positive integer, %d given", Z_LVAL_P(param)); + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Timestamp must be a positive integer, %ld given", Z_LVAL_P(param)); return; } - php_driver_uuid_generate_from_time(Z_LVAL_P(param), &self->uuid TSRMLS_CC); + php_driver_uuid_generate_from_time(Z_LVAL_P(param), &self->uuid); break; case IS_STRING: if (cass_uuid_from_string(Z_STRVAL_P(param), &self->uuid) != CASS_OK) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, "Invalid UUID: '%.*s'", Z_STRLEN_P(param), Z_STRVAL_P(param)); + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Invalid UUID: '%.*s'", (int) Z_STRLEN_P(param), Z_STRVAL_P(param)); return; } version = cass_uuid_version(self->uuid); if (version != 1) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, "UUID must be of type 1, type %d given", version); + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "UUID must be of type 1, type %d given", version); } break; default: - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, "Invalid argument - integer or string expected"); + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Invalid argument - integer or string expected"); } } @@ -80,6 +80,9 @@ PHP_METHOD(Timeuuid, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Timeuuid::__toString() */ PHP_METHOD(Timeuuid, __toString) { @@ -88,15 +91,15 @@ PHP_METHOD(Timeuuid, __toString) cass_uuid_string(self->uuid, string); - PHP5TO7_RETVAL_STRING(string); + RETURN_STRING(string); } /* }}} */ /* {{{ Timeuuid::type() */ PHP_METHOD(Timeuuid, type) { - php5to7_zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMEUUID TSRMLS_CC); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(type), 1, 1); + zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMEUUID); + RETURN_ZVAL(&type, 1, 1); } /* }}} */ @@ -108,7 +111,7 @@ PHP_METHOD(Timeuuid, uuid) cass_uuid_string(self->uuid, string); - PHP5TO7_RETVAL_STRING(string); + RETURN_STRING(string); } /* }}} */ @@ -145,17 +148,12 @@ PHP_METHOD(Timeuuid, toDateTime) self = PHP_DRIVER_GET_UUID(getThis()); - PHP5TO7_ZVAL_MAYBE_MAKE(datetime); - php_date_instantiate(php_date_get_date_ce(), datetime TSRMLS_CC); + php_date_instantiate(php_date_get_date_ce(), datetime); -#if PHP_MAJOR_VERSION >= 7 datetime_obj = php_date_obj_from_obj(Z_OBJ_P(datetime)); -#else - datetime_obj = zend_object_store_get_object(datetime TSRMLS_CC); -#endif str_len = spprintf(&str, 0, "@%ld", (long) (cass_uuid_timestamp(self->uuid) / 1000)); - php_date_initialize(datetime_obj, str, str_len, NULL, NULL, 0 TSRMLS_CC); + php_date_initialize(datetime_obj, str, str_len, NULL, NULL, 0); efree(str); RETVAL_ZVAL(datetime, 0, 0); @@ -171,7 +169,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_timeuuid_methods[] = { PHP_ME(Timeuuid, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Timeuuid, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Timeuuid, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Timeuuid, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timeuuid, uuid, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timeuuid, version, arginfo_none, ZEND_ACC_PUBLIC) @@ -180,45 +178,90 @@ static zend_function_entry php_driver_timeuuid_methods[] = { PHP_FE_END }; -static php_driver_value_handlers php_driver_timeuuid_handlers; +static zend_object_handlers php_driver_timeuuid_handlers; +#if PHP_VERSION_ID >= 80000 static HashTable * -php_driver_timeuuid_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_timeuuid_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else +static HashTable * +php_driver_timeuuid_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_timeuuid_properties(zend_object *object) +{ + char string[CASS_UUID_STRING_LENGTH]; + zval type; + zval uuid; + zval version; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_uuid *self = PHP_DRIVER_GET_UUID(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMEUUID); + zend_hash_update(props, zend_string_init("type", 4, 0), &type); + + cass_uuid_string(self->uuid, string); + + ZVAL_STRING(&uuid, string); + zend_hash_update(props, zend_string_init("uuid", 4, 0), &uuid); + ZVAL_LONG(&version, (long) cass_uuid_version(self->uuid)); + zend_hash_update(props, zend_string_init("version", 7, 0), &version); + + return props; +} +#else static HashTable * php_driver_timeuuid_properties(zval *object TSRMLS_DC) { char string[CASS_UUID_STRING_LENGTH]; - php5to7_zval type; - php5to7_zval uuid; - php5to7_zval version; + zval* type; + zval* uuid; + zval* version; php_driver_uuid *self = PHP_DRIVER_GET_UUID(object); HashTable *props = zend_std_get_properties(object TSRMLS_CC); - type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMEUUID TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + MAKE_STD_ZVAL(type); + *type = php_driver_type_scalar(CASS_VALUE_TYPE_TIMEUUID TSRMLS_CC); + zend_hash_update(props, "type", sizeof("type"), &type, sizeof(zval), NULL); cass_uuid_string(self->uuid, string); - PHP5TO7_ZVAL_MAYBE_MAKE(uuid); - PHP5TO7_ZVAL_STRING(PHP5TO7_ZVAL_MAYBE_P(uuid), string); - PHP5TO7_ZEND_HASH_UPDATE(props, "uuid", sizeof("uuid"), PHP5TO7_ZVAL_MAYBE_P(uuid), sizeof(zval)); + MAKE_STD_ZVAL(uuid); + ZVAL_STRING(uuid, string, 1); + zend_hash_update(props, "uuid", sizeof("uuid"), &uuid, sizeof(zval), NULL); - PHP5TO7_ZVAL_MAYBE_MAKE(version); - ZVAL_LONG(PHP5TO7_ZVAL_MAYBE_P(version), (long) cass_uuid_version(self->uuid)); - PHP5TO7_ZEND_HASH_UPDATE(props, "version", sizeof("version"), PHP5TO7_ZVAL_MAYBE_P(version), sizeof(zval)); + MAKE_STD_ZVAL(version); + ZVAL_LONG(version, (long) cass_uuid_version(self->uuid)); + zend_hash_update(props, "version", sizeof("version"), &version, sizeof(zval), NULL); return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_timeuuid_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_timeuuid_compare(zval *obj1, zval *obj2) +#endif { php_driver_uuid *uuid1 = NULL; php_driver_uuid *uuid2 = NULL; @@ -237,6 +280,7 @@ php_driver_timeuuid_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 0; } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_timeuuid_hash_value(zval *obj TSRMLS_DC) { @@ -244,24 +288,57 @@ php_driver_timeuuid_hash_value(zval *obj TSRMLS_DC) return php_driver_combine_hash(php_driver_bigint_hash(self->uuid.time_and_version), php_driver_bigint_hash(self->uuid.clock_seq_and_node)); } +#endif +#if PHP_VERSION_ID >= 80000 static void -php_driver_timeuuid_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_timeuuid_free(zend_object *object) { - php_driver_uuid *self = PHP5TO7_ZEND_OBJECT_GET(uuid, object); - + php_driver_uuid *self = (php_driver_uuid *) ((char *) (object) - XtOffsetOf(php_driver_uuid, std)); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_timeuuid_free(void *object TSRMLS_DC) +{ + php_driver_uuid *self = (php_driver_uuid *) object; zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif + +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_timeuuid_new(zend_class_entry *ce) +{ + php_driver_uuid *self = ecalloc(1, sizeof(php_driver_uuid) + zend_object_properties_size(ce)); -static php5to7_zend_object + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_timeuuid_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_timeuuid_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_uuid *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(uuid, ce); + zend_object_value retval; + php_driver_uuid *self; + + self = (php_driver_uuid *) ecalloc(1, sizeof(php_driver_uuid)); + + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_timeuuid_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_timeuuid_handlers; - PHP5TO7_ZEND_OBJECT_INIT_EX(uuid, timeuuid, self, ce); + return retval; } +#endif void php_driver_define_Timeuuid(TSRMLS_D) @@ -270,16 +347,26 @@ php_driver_define_Timeuuid(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Timeuuid", php_driver_timeuuid_methods); php_driver_timeuuid_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_timeuuid_ce TSRMLS_CC, 2, php_driver_value_ce, php_driver_uuid_interface_ce); + zend_class_implements(php_driver_timeuuid_ce, 2, php_driver_value_ce, php_driver_uuid_interface_ce); memcpy(&php_driver_timeuuid_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_timeuuid_handlers.std.get_properties = php_driver_timeuuid_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_timeuuid_handlers.offset = XtOffsetOf(php_driver_uuid, std); + php_driver_timeuuid_handlers.free_obj = php_driver_timeuuid_free; + php_driver_timeuuid_handlers.get_properties = php_driver_timeuuid_properties; + php_driver_timeuuid_handlers.get_gc = php_driver_timeuuid_gc; + php_driver_timeuuid_handlers.compare = php_driver_timeuuid_compare; + php_driver_timeuuid_handlers.clone_obj = NULL; +#else + php_driver_timeuuid_handlers.get_properties = php_driver_timeuuid_properties; + php_driver_timeuuid_handlers.compare_objects = php_driver_timeuuid_compare; + php_driver_timeuuid_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_timeuuid_handlers.std.get_gc = php_driver_timeuuid_gc; + php_driver_timeuuid_handlers.get_gc = php_driver_timeuuid_gc; #endif - php_driver_timeuuid_handlers.std.compare_objects = php_driver_timeuuid_compare; - php_driver_timeuuid_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; - php_driver_timeuuid_ce->create_object = php_driver_timeuuid_new; - php_driver_timeuuid_handlers.hash_value = php_driver_timeuuid_hash_value; - php_driver_timeuuid_handlers.std.clone_obj = NULL; -} +#endif + + php_driver_timeuuid_ce->ce_flags |= ZEND_ACC_FINAL; + php_driver_timeuuid_ce->create_object = php_driver_timeuuid_new; +} \ No newline at end of file diff --git a/ext/src/Timeuuid.dep b/ext/src/Timeuuid.dep new file mode 100644 index 000000000..06d9b0415 --- /dev/null +++ b/ext/src/Timeuuid.dep @@ -0,0 +1,103 @@ +src/Timeuuid.lo: /home/agabadounir/php-cassandra/ext/src/Timeuuid.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h util/uuid_gen.h \ + /usr/include/php/20230831/ext/date/php_date.h \ + /usr/include/php/20230831/ext/date/lib/timelib.h \ + /usr/include/php/20230831/ext/date/lib/timelib_config.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/main/php_version.h diff --git a/ext/src/Tinyint.c b/ext/src/Tinyint.c index b7326dabe..d19403c66 100644 --- a/ext/src/Tinyint.c +++ b/ext/src/Tinyint.c @@ -28,25 +28,25 @@ zend_class_entry *php_driver_tinyint_ce = NULL; static int -to_double(zval *result, php_driver_numeric *tinyint TSRMLS_DC) +to_double(zval *result, php_driver_numeric *tinyint) { ZVAL_DOUBLE(result, (double) tinyint->data.tinyint.value); return SUCCESS; } static int -to_long(zval *result, php_driver_numeric *tinyint TSRMLS_DC) +to_long(zval *result, php_driver_numeric *tinyint) { - ZVAL_LONG(result, (php5to7_long) tinyint->data.tinyint.value); + ZVAL_LONG(result, (zend_long) tinyint->data.tinyint.value); return SUCCESS; } static int -to_string(zval *result, php_driver_numeric *tinyint TSRMLS_DC) +to_string(zval *result, php_driver_numeric *tinyint) { char *string; spprintf(&string, 0, "%d", tinyint->data.tinyint.value); - PHP5TO7_ZVAL_STRING(result, string); + ZVAL_STRING(result, string); efree(string); return SUCCESS; } @@ -58,11 +58,11 @@ php_driver_tinyint_init(INTERNAL_FUNCTION_PARAMETERS) zval *value; cass_int32_t number; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } - if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_tinyint_ce TSRMLS_CC)) { + if (getThis() && instanceof_function(Z_OBJCE_P(getThis()), php_driver_tinyint_ce)) { self = PHP_DRIVER_GET_NUMERIC(getThis()); } else { object_init_ex(return_value, php_driver_tinyint_ce); @@ -70,7 +70,7 @@ php_driver_tinyint_init(INTERNAL_FUNCTION_PARAMETERS) } if (Z_TYPE_P(value) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(value), php_driver_tinyint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(value), php_driver_tinyint_ce)) { php_driver_numeric *other = PHP_DRIVER_GET_NUMERIC(value); self->data.tinyint.value = other->data.tinyint.value; } else { @@ -78,7 +78,7 @@ php_driver_tinyint_init(INTERNAL_FUNCTION_PARAMETERS) number = (cass_int32_t) Z_LVAL_P(value); if (number < INT8_MIN || number > INT8_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -128 and 127, %ld given", Z_LVAL_P(value)); return; } @@ -86,33 +86,28 @@ php_driver_tinyint_init(INTERNAL_FUNCTION_PARAMETERS) number = (cass_int32_t) Z_DVAL_P(value); if (number < INT8_MIN || number > INT8_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -128 and 127, %g given", Z_DVAL_P(value)); return; } } else if (Z_TYPE_P(value) == IS_STRING) { if (!php_driver_parse_int(Z_STRVAL_P(value), Z_STRLEN_P(value), - &number TSRMLS_CC)) { - // If the parsing function fails, it would have set an exception. If it's - // a range error, the error message would be wrong because the parsing - // function supports all 32-bit values, so the "valid" range it reports would - // be too large for Tinyint. Reset the exception in that case. - + &number)) { if (errno == ERANGE) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -128 and 127, %s given", Z_STRVAL_P(value)); } return; } if (number < INT8_MIN || number > INT8_MAX) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "value must be between -128 and 127, %s given", Z_STRVAL_P(value)); return; } } else { INVALID_ARGUMENT(value, "a long, a double, a numeric string or a " \ - PHP_DRIVER_NAMESPACE "\\Tinyint"); + PHP_DRIVER_NAMESPACE "\Tinyint"); } self->data.tinyint.value = (cass_int8_t) number; } @@ -125,20 +120,23 @@ PHP_METHOD(Tinyint, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Tinyint::__toString() */ PHP_METHOD(Tinyint, __toString) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_string(return_value, self TSRMLS_CC); + to_string(return_value, self); } /* }}} */ /* {{{ Tinyint::type() */ PHP_METHOD(Tinyint, type) { - php5to7_zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TINY_INT TSRMLS_CC); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(type), 1, 1); + zval type = php_driver_type_scalar(CASS_VALUE_TYPE_TINY_INT); + RETURN_ZVAL(&type, 1, 1); } /* }}} */ @@ -147,7 +145,7 @@ PHP_METHOD(Tinyint, value) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_long(return_value, self TSRMLS_CC); + to_long(return_value, self); } /* }}} */ @@ -159,12 +157,12 @@ PHP_METHOD(Tinyint, add) php_driver_numeric *tinyint; php_driver_numeric *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &addend) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &addend) == FAILURE) { return; } if (Z_TYPE_P(addend) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(addend), php_driver_tinyint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(addend), php_driver_tinyint_ce)) { self = PHP_DRIVER_GET_NUMERIC(getThis()); tinyint = PHP_DRIVER_GET_NUMERIC(addend); @@ -173,11 +171,11 @@ PHP_METHOD(Tinyint, add) result->data.tinyint.value = self->data.tinyint.value + tinyint->data.tinyint.value; if (result->data.tinyint.value - tinyint->data.tinyint.value != self->data.tinyint.value) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Sum is out of range"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Sum is out of range"); return; } } else { - INVALID_ARGUMENT(addend, "a " PHP_DRIVER_NAMESPACE "\\Tinyint"); + INVALID_ARGUMENT(addend, "a " PHP_DRIVER_NAMESPACE "\Tinyint"); } } /* }}} */ @@ -188,12 +186,12 @@ PHP_METHOD(Tinyint, sub) zval *difference; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &difference) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &difference) == FAILURE) { return; } if (Z_TYPE_P(difference) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(difference), php_driver_tinyint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(difference), php_driver_tinyint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *tinyint = PHP_DRIVER_GET_NUMERIC(difference); @@ -202,11 +200,11 @@ PHP_METHOD(Tinyint, sub) result->data.tinyint.value = self->data.tinyint.value - tinyint->data.tinyint.value; if (result->data.tinyint.value + tinyint->data.tinyint.value != self->data.tinyint.value) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Difference is out of range"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Difference is out of range"); return; } } else { - INVALID_ARGUMENT(difference, "a " PHP_DRIVER_NAMESPACE "\\Tinyint"); + INVALID_ARGUMENT(difference, "a " PHP_DRIVER_NAMESPACE "\Tinyint"); } } /* }}} */ @@ -217,12 +215,12 @@ PHP_METHOD(Tinyint, mul) zval *multiplier; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &multiplier) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &multiplier) == FAILURE) { return; } if (Z_TYPE_P(multiplier) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(multiplier), php_driver_tinyint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(multiplier), php_driver_tinyint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *tinyint = PHP_DRIVER_GET_NUMERIC(multiplier); @@ -232,11 +230,11 @@ PHP_METHOD(Tinyint, mul) result->data.tinyint.value = self->data.tinyint.value * tinyint->data.tinyint.value; if (tinyint->data.tinyint.value != 0 && result->data.tinyint.value / tinyint->data.tinyint.value != self->data.tinyint.value) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Product is out of range"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Product is out of range"); return; } } else { - INVALID_ARGUMENT(multiplier, "a " PHP_DRIVER_NAMESPACE "\\Tinyint"); + INVALID_ARGUMENT(multiplier, "a " PHP_DRIVER_NAMESPACE "\Tinyint"); } } /* }}} */ @@ -247,12 +245,12 @@ PHP_METHOD(Tinyint, div) zval *divisor; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &divisor) == FAILURE) { return; } if (Z_TYPE_P(divisor) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(divisor), php_driver_tinyint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(divisor), php_driver_tinyint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *tinyint = PHP_DRIVER_GET_NUMERIC(divisor); @@ -260,13 +258,13 @@ PHP_METHOD(Tinyint, div) result = PHP_DRIVER_GET_NUMERIC(return_value); if (tinyint->data.tinyint.value == 0) { - zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0 TSRMLS_CC, "Cannot divide by zero"); + zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0, "Cannot divide by zero"); return; } result->data.tinyint.value = self->data.tinyint.value / tinyint->data.tinyint.value; } else { - INVALID_ARGUMENT(divisor, "a " PHP_DRIVER_NAMESPACE "\\Tinyint"); + INVALID_ARGUMENT(divisor, "a " PHP_DRIVER_NAMESPACE "\Tinyint"); } } /* }}} */ @@ -277,12 +275,12 @@ PHP_METHOD(Tinyint, mod) zval *divisor; php_driver_numeric *result = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &divisor) == FAILURE) { return; } if (Z_TYPE_P(divisor) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(divisor), php_driver_tinyint_ce TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(divisor), php_driver_tinyint_ce)) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); php_driver_numeric *tinyint = PHP_DRIVER_GET_NUMERIC(divisor); @@ -290,13 +288,13 @@ PHP_METHOD(Tinyint, mod) result = PHP_DRIVER_GET_NUMERIC(return_value); if (tinyint->data.tinyint.value == 0) { - zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0 TSRMLS_CC, "Cannot modulo by zero"); + zend_throw_exception_ex(php_driver_divide_by_zero_exception_ce, 0, "Cannot modulo by zero"); return; } result->data.tinyint.value = self->data.tinyint.value % tinyint->data.tinyint.value; } else { - INVALID_ARGUMENT(divisor, "a " PHP_DRIVER_NAMESPACE "\\Tinyint"); + INVALID_ARGUMENT(divisor, "a " PHP_DRIVER_NAMESPACE "\Tinyint"); } } /* }}} */ @@ -308,7 +306,7 @@ PHP_METHOD(Tinyint, abs) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.tinyint.value == INT8_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value doesn't exist"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value doesn't exist"); return; } @@ -325,7 +323,7 @@ PHP_METHOD(Tinyint, neg) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.tinyint.value == INT8_MIN) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, "Value doesn't exist"); + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Value doesn't exist"); return; } @@ -342,7 +340,7 @@ PHP_METHOD(Tinyint, sqrt) php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); if (self->data.tinyint.value < 0) { - zend_throw_exception_ex(php_driver_range_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_range_exception_ce, 0, "Cannot take a square root of a negative number"); return; } @@ -358,7 +356,7 @@ PHP_METHOD(Tinyint, toInt) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_long(return_value, self TSRMLS_CC); + to_long(return_value, self); } /* }}} */ @@ -367,7 +365,7 @@ PHP_METHOD(Tinyint, toDouble) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(getThis()); - to_double(return_value, self TSRMLS_CC); + to_double(return_value, self); } /* }}} */ @@ -404,7 +402,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_tinyint_methods[] = { PHP_ME(Tinyint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Tinyint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tinyint, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Tinyint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Tinyint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Tinyint, add, arginfo_num, ZEND_ACC_PUBLIC) @@ -422,37 +420,75 @@ static zend_function_entry php_driver_tinyint_methods[] = { PHP_FE_END }; -static php_driver_value_handlers php_driver_tinyint_handlers; +static zend_object_handlers php_driver_tinyint_handlers; +#if PHP_VERSION_ID >= 80000 static HashTable * -php_driver_tinyint_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_tinyint_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else +static HashTable * +php_driver_tinyint_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_tinyint_properties(zend_object *object) +{ + zval type; + zval value; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zval); + HashTable *props = zend_std_get_properties(object); + type = php_driver_type_scalar(CASS_VALUE_TYPE_TINY_INT); + zend_hash_update(props, zend_string_init("type", 4, 0), &type); + + to_string(&value, self); + zend_hash_update(props, zend_string_init("value", 5, 0), &value); + + return props; +} +#else static HashTable * php_driver_tinyint_properties(zval *object TSRMLS_DC) { - php5to7_zval type; - php5to7_zval value; + zval* type; + zval* value; php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); HashTable *props = zend_std_get_properties(object TSRMLS_CC); - type = php_driver_type_scalar(CASS_VALUE_TYPE_TINY_INT TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "type", sizeof("type"), PHP5TO7_ZVAL_MAYBE_P(type), sizeof(zval)); + MAKE_STD_ZVAL(type); + *type = php_driver_type_scalar(CASS_VALUE_TYPE_TINY_INT TSRMLS_CC); + zend_hash_update(props, "type", sizeof("type"), &type, sizeof(zval), NULL); - PHP5TO7_ZVAL_MAYBE_MAKE(value); - to_string(PHP5TO7_ZVAL_MAYBE_P(value), self TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "value", sizeof("value"), PHP5TO7_ZVAL_MAYBE_P(value), sizeof(zval)); + MAKE_STD_ZVAL(value); + to_string(value, self TSRMLS_CC); + zend_hash_update(props, "value", sizeof("value"), &value, sizeof(zval), NULL); return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_tinyint_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_tinyint_compare(zval *obj1, zval *obj2) +#endif { php_driver_numeric *tinyint1 = NULL; php_driver_numeric *tinyint2 = NULL; @@ -471,13 +507,37 @@ php_driver_tinyint_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 1; } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_tinyint_hash_value(zval *obj TSRMLS_DC) { php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(obj); return 31 * 17 + self->data.tinyint.value; } +#endif + +#if PHP_VERSION_ID >= 80000 +static int +php_driver_tinyint_cast(zend_object *object, zval *retval, int type) +{ + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zval); + + switch (type) { + case IS_LONG: + return to_long(retval, self); + case IS_DOUBLE: + return to_double(retval, self); + case IS_STRING: + return to_string(retval, self); + default: + return FAILURE; + } + return SUCCESS; +} +#else static int php_driver_tinyint_cast(zval *object, zval *retval, int type TSRMLS_DC) { @@ -496,26 +556,60 @@ php_driver_tinyint_cast(zval *object, zval *retval, int type TSRMLS_DC) return SUCCESS; } +#endif +#if PHP_VERSION_ID >= 80000 static void -php_driver_tinyint_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_tinyint_free(zend_object *object) { - php_driver_numeric *self = PHP5TO7_ZEND_OBJECT_GET(numeric, object); - + php_driver_numeric *self = (php_driver_numeric *) ((char *) (object) - XtOffsetOf(php_driver_numeric, std)); + zend_object_std_dtor(&self->std); +} +#else +static void +php_driver_tinyint_free(void *object TSRMLS_DC) +{ + php_driver_numeric *self = (php_driver_numeric *) object; zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); } +#endif -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_tinyint_new(zend_class_entry *ce) +{ + php_driver_numeric *self = ecalloc(1, sizeof(php_driver_numeric) + zend_object_properties_size(ce)); + + self->type = PHP_DRIVER_TINYINT; + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_tinyint_handlers; + + return &self->std; +} +#else +static zend_object_value php_driver_tinyint_new(zend_class_entry *ce TSRMLS_DC) { - php_driver_numeric *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(numeric, ce); + zend_object_value retval; + php_driver_numeric *self; + + self = (php_driver_numeric *) ecalloc(1, sizeof(php_driver_numeric)); self->type = PHP_DRIVER_TINYINT; - PHP5TO7_ZEND_OBJECT_INIT_EX(numeric, tinyint, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_tinyint_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_tinyint_handlers; + + return retval; } +#endif void php_driver_define_Tinyint(TSRMLS_D) { @@ -523,17 +617,28 @@ void php_driver_define_Tinyint(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Tinyint", php_driver_tinyint_methods); php_driver_tinyint_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_tinyint_ce TSRMLS_CC, 2, php_driver_value_ce, php_driver_numeric_ce); - php_driver_tinyint_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; + zend_class_implements(php_driver_tinyint_ce, 2, php_driver_value_ce, php_driver_numeric_ce); + php_driver_tinyint_ce->ce_flags |= ZEND_ACC_FINAL; php_driver_tinyint_ce->create_object = php_driver_tinyint_new; memcpy(&php_driver_tinyint_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_tinyint_handlers.std.get_properties = php_driver_tinyint_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_tinyint_handlers.offset = XtOffsetOf(php_driver_numeric, std); + php_driver_tinyint_handlers.free_obj = php_driver_tinyint_free; + php_driver_tinyint_handlers.get_properties = php_driver_tinyint_properties; + php_driver_tinyint_handlers.get_gc = php_driver_tinyint_gc; + php_driver_tinyint_handlers.compare = php_driver_tinyint_compare; + php_driver_tinyint_handlers.cast_object = php_driver_tinyint_cast; + php_driver_tinyint_handlers.clone_obj = NULL; +#else + php_driver_tinyint_handlers.get_properties = php_driver_tinyint_properties; + php_driver_tinyint_handlers.compare_objects = php_driver_tinyint_compare; + php_driver_tinyint_handlers.cast_object = php_driver_tinyint_cast; + php_driver_tinyint_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_tinyint_handlers.std.get_gc = php_driver_tinyint_gc; + php_driver_tinyint_handlers.get_gc = php_driver_tinyint_gc; #endif - php_driver_tinyint_handlers.std.compare_objects = php_driver_tinyint_compare; - php_driver_tinyint_handlers.std.cast_object = php_driver_tinyint_cast; - php_driver_tinyint_handlers.hash_value = php_driver_tinyint_hash_value; +#endif } diff --git a/ext/src/Tinyint.dep b/ext/src/Tinyint.dep new file mode 100644 index 000000000..2cddd428f --- /dev/null +++ b/ext/src/Tinyint.dep @@ -0,0 +1,98 @@ +src/Tinyint.lo: /home/agabadounir/php-cassandra/ext/src/Tinyint.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Tuple.c b/ext/src/Tuple.c index 661688395..02acfd74d 100644 --- a/ext/src/Tuple.c +++ b/ext/src/Tuple.c @@ -28,45 +28,39 @@ zend_class_entry *php_driver_tuple_ce = NULL; void -php_driver_tuple_set(php_driver_tuple *tuple, ulong index, zval *object TSRMLS_DC) +php_driver_tuple_set(php_driver_tuple *tuple, zend_ulong index, zval *object) { - PHP5TO7_ZEND_HASH_INDEX_UPDATE(&tuple->values, index, object, sizeof(zval *)); + zend_hash_index_update(&tuple->values, index, object); Z_TRY_ADDREF_P(object); tuple->dirty = 1; } static void -php_driver_tuple_populate(php_driver_tuple *tuple, zval *array TSRMLS_DC) +php_driver_tuple_populate(php_driver_tuple *tuple, zval *array) { - php5to7_ulong index; + zend_ulong index; php_driver_type *type; - php5to7_zval *current; - php5to7_zval null; + zval *current; + zval null; - PHP5TO7_ZVAL_MAYBE_MAKE(null); - ZVAL_NULL(PHP5TO7_ZVAL_MAYBE_P(null)); + ZVAL_NULL(&null); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(tuple->type)); + type = PHP_DRIVER_GET_TYPE(&tuple->type); - PHP5TO7_ZEND_HASH_FOREACH_NUM_KEY_VAL(&type->data.tuple.types, index, current) { - php5to7_zval *value = NULL; - (void) current; - if (PHP5TO7_ZEND_HASH_INDEX_FIND(&tuple->values, index, value)) { - if (add_next_index_zval(array, PHP5TO7_ZVAL_MAYBE_DEREF(value)) == SUCCESS) - Z_TRY_ADDREF_P(PHP5TO7_ZVAL_MAYBE_DEREF(value)); + ZEND_HASH_FOREACH_NUM_KEY_VAL(&type->data.tuple.types, index, current) { + zval *value = NULL; + if ((value = zend_hash_index_find(&tuple->values, index))) { + if (add_next_index_zval(array, value) == SUCCESS) + Z_TRY_ADDREF_P(value); else break; } else { - if (add_next_index_zval(array, PHP5TO7_ZVAL_MAYBE_P(null)) == SUCCESS) - Z_TRY_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(null)); + if (add_next_index_zval(array, &null) == SUCCESS) + Z_TRY_ADDREF_P(&null); else break; } - } PHP5TO7_ZEND_HASH_FOREACH_END(&type->data.tuple.types); - -#if PHP_MAJOR_VERSION < 7 - zval_ptr_dtor(&null); -#endif + } ZEND_HASH_FOREACH_END(); } /* {{{ Tuple::__construct(types) */ @@ -75,37 +69,37 @@ PHP_METHOD(Tuple, __construct) php_driver_tuple *self; php_driver_type *type; HashTable *types; - php5to7_zval *current; + zval *current; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "h", &types) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "h", &types) == FAILURE) { return; } self = PHP_DRIVER_GET_TUPLE(getThis()); - self->type = php_driver_type_tuple(TSRMLS_C); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + self->type = php_driver_type_tuple(); + type = PHP_DRIVER_GET_TYPE(&self->type); - PHP5TO7_ZEND_HASH_FOREACH_VAL(types, current) { - zval *sub_type = PHP5TO7_ZVAL_MAYBE_DEREF(current); - php5to7_zval scalar_type; + ZEND_HASH_FOREACH_VAL(types, current) { + zval *sub_type = current; + zval scalar_type; if (Z_TYPE_P(sub_type) == IS_STRING) { CassValueType value_type; - if (!php_driver_value_type(Z_STRVAL_P(sub_type), &value_type TSRMLS_CC)) { + if (!php_driver_value_type(Z_STRVAL_P(sub_type), &value_type)) { return; } - scalar_type = php_driver_type_scalar(value_type TSRMLS_CC); + scalar_type = php_driver_type_scalar(value_type); if (!php_driver_type_tuple_add(type, - PHP5TO7_ZVAL_MAYBE_P(scalar_type) TSRMLS_CC)) { + &scalar_type)) { return; } } else if (Z_TYPE_P(sub_type) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(sub_type), php_driver_type_ce TSRMLS_CC)) { - if (!php_driver_type_validate(sub_type, "type" TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(sub_type), php_driver_type_ce)) { + if (!php_driver_type_validate(sub_type, "type")) { return; } if (php_driver_type_tuple_add(type, - sub_type TSRMLS_CC)) { + sub_type)) { Z_ADDREF_P(sub_type); } else { return; @@ -114,7 +108,7 @@ PHP_METHOD(Tuple, __construct) INVALID_ARGUMENT(sub_type, "a string or an instance of " PHP_DRIVER_NAMESPACE "\\Type"); } - } PHP5TO7_ZEND_HASH_FOREACH_END(types); + } ZEND_HASH_FOREACH_END(); } /* }}} */ @@ -122,7 +116,7 @@ PHP_METHOD(Tuple, __construct) PHP_METHOD(Tuple, type) { php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->type), 1, 0); + RETURN_ZVAL(&self->type, 1, 0); } /* {{{ Tuple::values() */ @@ -131,7 +125,7 @@ PHP_METHOD(Tuple, values) php_driver_tuple *self = NULL; array_init(return_value); self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_tuple_populate(self, return_value TSRMLS_CC); + php_driver_tuple_populate(self, return_value); } /* }}} */ @@ -139,30 +133,30 @@ PHP_METHOD(Tuple, values) PHP_METHOD(Tuple, set) { php_driver_tuple *self = NULL; - long index; + zend_long index; php_driver_type *type; - php5to7_zval *sub_type; + zval *sub_type; zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", &index, &value) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "lz", &index, &value) == FAILURE) return; self = PHP_DRIVER_GET_TUPLE(getThis()); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + type = PHP_DRIVER_GET_TYPE(&self->type); if (index < 0 || index >= zend_hash_num_elements(&type->data.tuple.types)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Index out of bounds"); return; } - if (!PHP5TO7_ZEND_HASH_INDEX_FIND(&type->data.tuple.types, index, sub_type) || + if (!(sub_type = zend_hash_index_find(&type->data.tuple.types, index)) || !php_driver_validate_object(value, - PHP5TO7_ZVAL_MAYBE_DEREF(sub_type) TSRMLS_CC)) { + sub_type)) { return; } - php_driver_tuple_set(self, index, value TSRMLS_CC); + php_driver_tuple_set(self, index, value); } /* }}} */ @@ -170,24 +164,24 @@ PHP_METHOD(Tuple, set) PHP_METHOD(Tuple, get) { php_driver_tuple *self = NULL; - long index; + zend_long index; php_driver_type *type; - php5to7_zval *value; + zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) return; self = PHP_DRIVER_GET_TUPLE(getThis()); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + type = PHP_DRIVER_GET_TYPE(&self->type); if (index < 0 || index >= zend_hash_num_elements(&type->data.tuple.types)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Index out of bounds"); return; } - if (PHP5TO7_ZEND_HASH_INDEX_FIND(&self->values, index, value)) { - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_DEREF(value), 1, 0); + if ((value = zend_hash_index_find(&self->values, index))) { + RETURN_ZVAL(value, 1, 0); } } /* }}} */ @@ -196,7 +190,7 @@ PHP_METHOD(Tuple, get) PHP_METHOD(Tuple, count) { php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_type *type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + php_driver_type *type = PHP_DRIVER_GET_TYPE(&self->type); RETURN_LONG(zend_hash_num_elements(&type->data.tuple.types)); } /* }}} */ @@ -204,14 +198,14 @@ PHP_METHOD(Tuple, count) /* {{{ Tuple::current() */ PHP_METHOD(Tuple, current) { - php5to7_ulong index; + zend_ulong index; php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_type *type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + php_driver_type *type = PHP_DRIVER_GET_TYPE(&self->type); - if (PHP5TO7_ZEND_HASH_GET_CURRENT_KEY_EX(&type->data.tuple.types, NULL, &index, &self->pos) == HASH_KEY_IS_LONG) { - php5to7_zval *value; - if (PHP5TO7_ZEND_HASH_INDEX_FIND(&self->values, index, value)) { - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_DEREF(value), 1, 0); + if (zend_hash_get_current_key_ex(&type->data.tuple.types, NULL, &index, &self->pos) == HASH_KEY_IS_LONG) { + zval *value; + if ((value = zend_hash_index_find(&self->values, index))) { + RETURN_ZVAL(value, 1, 0); } } } @@ -220,10 +214,10 @@ PHP_METHOD(Tuple, current) /* {{{ Tuple::key() */ PHP_METHOD(Tuple, key) { - php5to7_ulong index; + zend_ulong index; php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_type *type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); - if (PHP5TO7_ZEND_HASH_GET_CURRENT_KEY_EX(&type->data.tuple.types, NULL, &index, &self->pos) == HASH_KEY_IS_LONG) { + php_driver_type *type = PHP_DRIVER_GET_TYPE(&self->type); + if (zend_hash_get_current_key_ex(&type->data.tuple.types, NULL, &index, &self->pos) == HASH_KEY_IS_LONG) { RETURN_LONG(index); } } @@ -233,7 +227,7 @@ PHP_METHOD(Tuple, key) PHP_METHOD(Tuple, next) { php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_type *type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + php_driver_type *type = PHP_DRIVER_GET_TYPE(&self->type); zend_hash_move_forward_ex(&type->data.tuple.types, &self->pos); } /* }}} */ @@ -242,7 +236,7 @@ PHP_METHOD(Tuple, next) PHP_METHOD(Tuple, valid) { php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_type *type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + php_driver_type *type = PHP_DRIVER_GET_TYPE(&self->type); RETURN_BOOL(zend_hash_has_more_elements_ex(&type->data.tuple.types, &self->pos) == SUCCESS); } /* }}} */ @@ -251,81 +245,168 @@ PHP_METHOD(Tuple, valid) PHP_METHOD(Tuple, rewind) { php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(getThis()); - php_driver_type *type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + php_driver_type *type = PHP_DRIVER_GET_TYPE(&self->type); zend_hash_internal_pointer_reset_ex(&type->data.tuple.types, &self->pos); } /* }}} */ -ZEND_BEGIN_ARG_INFO_EX(arginfo__construct, 0, ZEND_RETURN_VALUE, 1) +#if PHP_VERSION_ID >= 80100 +/* Typed arginfo for PHP 8.1+ */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_none, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bool, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_type_tuple, 0, 0, PHP_DRIVER_NAMESPACE "\\Type\\Tuple", 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mixed, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_key_maybe, 0, 0, MAY_BE_LONG|MAY_BE_NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_construct_types, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, types, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set, 0, 2, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +ZEND_END_ARG_INFO() +#else +/* Legacy arginfo without return types */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_construct_types, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, types) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, 0, ZEND_RETURN_VALUE, 2) + ZEND_ARG_INFO(0, index) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_index, 0, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_get, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_tuple_methods[] = { - PHP_ME(Tuple, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Tuple, type, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, values, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, set, arginfo_value, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, get, arginfo_index, ZEND_ACC_PUBLIC) +#if PHP_VERSION_ID >= 80100 + PHP_ME(Tuple, __construct, arginfo_construct_types, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(Tuple, type, arginfo_type_tuple, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, values, arginfo_array, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, set, arginfo_set, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, get, arginfo_get, ZEND_ACC_PUBLIC) /* Countable */ - PHP_ME(Tuple, count, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, count, arginfo_count, ZEND_ACC_PUBLIC) /* Iterator */ - PHP_ME(Tuple, current, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, key, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, next, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, valid, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Tuple, rewind, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, current, arginfo_mixed, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, key, arginfo_key_maybe, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, next, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, valid, arginfo_bool, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#else + PHP_ME(Tuple, __construct, arginfo_construct_types, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(Tuple, type, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, values, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, set, arginfo_set, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, get, arginfo_get, ZEND_ACC_PUBLIC) + /* Countable */ + PHP_ME(Tuple, count, arginfo_none, ZEND_ACC_PUBLIC) + /* Iterator */ + PHP_ME(Tuple, current, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, key, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, next, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, valid, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tuple, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; -static php_driver_value_handlers php_driver_tuple_handlers; +static zend_object_handlers php_driver_tuple_handlers; +#if PHP_VERSION_ID >= 80000 static HashTable * -php_driver_tuple_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_tuple_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else +static HashTable * +php_driver_tuple_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_tuple_properties(zend_object *object) +#else static HashTable * php_driver_tuple_properties(zval *object TSRMLS_DC) +#endif { - php5to7_zval values; + zval values; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); - php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(&obj_zval); +#if PHP_VERSION_ID >= 80000 + HashTable *props = zend_std_get_properties(object); +#else + HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif - PHP5TO7_ZEND_HASH_UPDATE(props, - "type", sizeof("type"), - PHP5TO7_ZVAL_MAYBE_P(self->type), sizeof(zval)); - Z_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(self->type)); +#if PHP_VERSION_ID >= 80000 + zend_hash_update(props, zend_string_init("type", 4, 0), &self->type); + Z_TRY_ADDREF_P(&self->type); +#else + zend_hash_update(props, "type", sizeof("type"), &self->type, sizeof(zval), NULL); + Z_ADDREF_P(&self->type); +#endif - PHP5TO7_ZVAL_MAYBE_MAKE(values); - array_init(PHP5TO7_ZVAL_MAYBE_P(values)); - php_driver_tuple_populate(self, PHP5TO7_ZVAL_MAYBE_P(values) TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "values", sizeof("values"), PHP5TO7_ZVAL_MAYBE_P(values), sizeof(zval)); + array_init(&values); + php_driver_tuple_populate(self, &values); +#if PHP_VERSION_ID >= 80000 + zend_hash_update(props, zend_string_init("values", 6, 0), &values); +#else + zend_hash_update(props, "values", sizeof("values"), values, sizeof(zval), NULL); +#endif return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_tuple_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_tuple_compare(zval *obj1, zval *obj2) +#endif { HashPosition pos1; HashPosition pos2; - php5to7_zval *current1; - php5to7_zval *current2; + zval *current1; + zval *current2; php_driver_tuple *tuple1; php_driver_tuple *tuple2; php_driver_type *type1; @@ -338,10 +419,14 @@ php_driver_tuple_compare(zval *obj1, zval *obj2 TSRMLS_DC) tuple1 = PHP_DRIVER_GET_TUPLE(obj1); tuple2 = PHP_DRIVER_GET_TUPLE(obj2); - type1 = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(tuple1->type)); - type2 = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(tuple2->type)); + type1 = PHP_DRIVER_GET_TYPE(&tuple1->type); + type2 = PHP_DRIVER_GET_TYPE(&tuple2->type); +#if PHP_VERSION_ID < 80000 result = php_driver_type_compare(type1, type2 TSRMLS_CC); +#else + result = php_driver_type_compare(type1, type2); +#endif if (result != 0) return result; if (zend_hash_num_elements(&tuple1->values) != zend_hash_num_elements(&tuple2->values)) { @@ -351,10 +436,15 @@ php_driver_tuple_compare(zval *obj1, zval *obj2 TSRMLS_DC) zend_hash_internal_pointer_reset_ex(&tuple1->values, &pos1); zend_hash_internal_pointer_reset_ex(&tuple2->values, &pos2); - while (PHP5TO7_ZEND_HASH_GET_CURRENT_DATA_EX(&tuple1->values, current1, &pos1) && - PHP5TO7_ZEND_HASH_GET_CURRENT_DATA_EX(&tuple2->values, current2, &pos2)) { - result = php_driver_value_compare(PHP5TO7_ZVAL_MAYBE_DEREF(current1), - PHP5TO7_ZVAL_MAYBE_DEREF(current2) TSRMLS_CC); + while ((current1 = zend_hash_get_current_data_ex(&tuple1->values, &pos1)) && + (current2 = zend_hash_get_current_data_ex(&tuple2->values, &pos2))) { +#if PHP_VERSION_ID < 80000 + result = php_driver_value_compare(current1, + current2 TSRMLS_CC); +#else + result = php_driver_value_compare(current1, + current2); +#endif if (result != 0) return result; zend_hash_move_forward_ex(&tuple1->values, &pos1); zend_hash_move_forward_ex(&tuple2->values, &pos2); @@ -363,19 +453,24 @@ php_driver_tuple_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 0; } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_tuple_hash_value(zval *obj TSRMLS_DC) +#else +unsigned +php_driver_tuple_hash_value(zval *obj) +#endif { - php5to7_zval *current; + zval *current; unsigned hashv = 0; php_driver_tuple *self = PHP_DRIVER_GET_TUPLE(obj); if (!self->dirty) return self->hashv; - PHP5TO7_ZEND_HASH_FOREACH_VAL(&self->values, current) { + ZEND_HASH_FOREACH_VAL(&self->values, current) { hashv = php_driver_combine_hash(hashv, - php_driver_value_hash(PHP5TO7_ZVAL_MAYBE_DEREF(current) TSRMLS_CC)); - } PHP5TO7_ZEND_HASH_FOREACH_END(&self->values); + php_driver_value_hash(current)); + } ZEND_HASH_FOREACH_END(); self->hashv = hashv; self->dirty = 0; @@ -383,35 +478,71 @@ php_driver_tuple_hash_value(zval *obj TSRMLS_DC) return hashv; } +#if PHP_VERSION_ID >= 80000 +static void +php_driver_tuple_free(zend_object *object) +#else static void -php_driver_tuple_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_tuple_free(void *object TSRMLS_DC) +#endif { - php_driver_tuple *self = - PHP5TO7_ZEND_OBJECT_GET(tuple, object); - +#if PHP_VERSION_ID >= 80000 + php_driver_tuple *self = (php_driver_tuple *) ((char *) (object) - XtOffsetOf(php_driver_tuple, std)); +#else + php_driver_tuple *self = (php_driver_tuple *) object; +#endif zend_hash_destroy(&self->values); - PHP5TO7_ZVAL_MAYBE_DESTROY(self->type); - + zval_ptr_dtor(&self->type); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); +#endif } -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_tuple_new(zend_class_entry *ce) +#else +static zend_object_value php_driver_tuple_new(zend_class_entry *ce TSRMLS_DC) +#endif { - php_driver_tuple *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(tuple, ce); +#if PHP_VERSION_ID >= 80000 + php_driver_tuple *self = ecalloc(1, sizeof(php_driver_tuple) + zend_object_properties_size(ce)); zend_hash_init(&self->values, 0, NULL, ZVAL_PTR_DTOR, 0); -#if PHP_MAJOR_VERSION >= 7 self->pos = HT_INVALID_IDX; + self->dirty = 1; + ZVAL_UNDEF(&self->type); + + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_tuple_handlers; + + return &self->std; #else + zend_object_value retval; + php_driver_tuple *self; + + self = (php_driver_tuple *) ecalloc(1, sizeof(php_driver_tuple)); + + zend_hash_init(&self->values, 0, NULL, ZVAL_PTR_DTOR, 0); self->pos = NULL; -#endif self->dirty = 1; - PHP5TO7_ZVAL_UNDEF(self->type); + ZVAL_UNDEF(&self->type); + + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); - PHP5TO7_ZEND_OBJECT_INIT(tuple, self, ce); + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_tuple_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_tuple_handlers; + + return retval; +#endif } void php_driver_define_Tuple(TSRMLS_D) @@ -420,17 +551,28 @@ void php_driver_define_Tuple(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Tuple", php_driver_tuple_methods); php_driver_tuple_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_tuple_ce TSRMLS_CC, 1, php_driver_value_ce); + zend_class_implements(php_driver_tuple_ce, 1, php_driver_value_ce); memcpy(&php_driver_tuple_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_tuple_handlers.std.get_properties = php_driver_tuple_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_tuple_handlers.offset = XtOffsetOf(php_driver_tuple, std); + php_driver_tuple_handlers.free_obj = php_driver_tuple_free; + php_driver_tuple_handlers.get_properties = php_driver_tuple_properties; + php_driver_tuple_handlers.get_gc = php_driver_tuple_gc; + php_driver_tuple_handlers.compare = php_driver_tuple_compare; + php_driver_tuple_handlers.clone_obj = NULL; + zend_class_implements(php_driver_tuple_ce, 2, zend_ce_countable, zend_ce_iterator); +#else + php_driver_tuple_handlers.get_properties = php_driver_tuple_properties; + php_driver_tuple_handlers.compare_objects = php_driver_tuple_compare; + php_driver_tuple_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_tuple_handlers.std.get_gc = php_driver_tuple_gc; + php_driver_tuple_handlers.get_gc = php_driver_tuple_gc; #endif - php_driver_tuple_handlers.std.compare_objects = php_driver_tuple_compare; - php_driver_tuple_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; - php_driver_tuple_ce->create_object = php_driver_tuple_new; + php_driver_tuple_handlers.hash_value = php_driver_tuple_hash_value; zend_class_implements(php_driver_tuple_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); +#endif - php_driver_tuple_handlers.hash_value = php_driver_tuple_hash_value; - php_driver_tuple_handlers.std.clone_obj = NULL; -} + php_driver_tuple_ce->ce_flags |= ZEND_ACC_FINAL; + php_driver_tuple_ce->create_object = php_driver_tuple_new; +} \ No newline at end of file diff --git a/ext/src/Tuple.dep b/ext/src/Tuple.dep new file mode 100644 index 000000000..c05a3d4b0 --- /dev/null +++ b/ext/src/Tuple.dep @@ -0,0 +1,99 @@ +src/Tuple.lo: /home/agabadounir/php-cassandra/ext/src/Tuple.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/collections.h util/hash.h util/uthash.h \ + util/types.h /usr/include/php/20230831/Zend/zend_smart_str.h \ + src/Type/Tuple.h src/Tuple.h diff --git a/ext/src/Type.c b/ext/src/Type.c index a68aeabf0..420d24fb8 100644 --- a/ext/src/Type.c +++ b/ext/src/Type.c @@ -193,6 +193,28 @@ PHP_METHOD(Type, map) RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(ztype), 0, 1); } +#if PHP_VERSION_ID >= 80100 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +/* Scalar static factories use this: no params, returns Type */ +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_none, 0, 0, PHP_DRIVER_NAMESPACE "\\Type", 0) +ZEND_END_ARG_INFO() + +/* Return Type for factory methods that take variadic params */ +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_types_return_type, 0, 0, PHP_DRIVER_NAMESPACE "\\Type", 0) + ZEND_ARG_INFO(0, types) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_type, 0, 1, PHP_DRIVER_NAMESPACE "\\Type", 0) + PHP_DRIVER_NAMESPACE_ZEND_ARG_OBJ_INFO(0, type, Type, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map, 0, 2, PHP_DRIVER_NAMESPACE "\\Type", 0) + PHP_DRIVER_NAMESPACE_ZEND_ARG_OBJ_INFO(0, keyType, Type, 0) + PHP_DRIVER_NAMESPACE_ZEND_ARG_OBJ_INFO(0, valueType, Type, 0) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() @@ -208,19 +230,30 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_map, 0, ZEND_RETURN_VALUE, 2) PHP_DRIVER_NAMESPACE_ZEND_ARG_OBJ_INFO(0, keyType, Type, 0) PHP_DRIVER_NAMESPACE_ZEND_ARG_OBJ_INFO(0, valueType, Type, 0) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ABSTRACT_ME(Type, name, arginfo_string) + PHP_ABSTRACT_ME(Type, __toString, arginfo_string) +#else PHP_ABSTRACT_ME(Type, name, arginfo_none) PHP_ABSTRACT_ME(Type, __toString, arginfo_none) +#endif #define XX_SCALAR_METHOD(name, _) PHP_ME(Type, name, arginfo_none, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) PHP_DRIVER_SCALAR_TYPES_MAP(XX_SCALAR_METHOD) #undef XX_SCALAR_METHOD - PHP_ME(Type, collection, arginfo_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) - PHP_ME(Type, set, arginfo_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) - PHP_ME(Type, map, arginfo_map, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) - PHP_ME(Type, tuple, arginfo_types, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) - PHP_ME(Type, userType, arginfo_types, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) + PHP_ME(Type, collection, arginfo_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) + PHP_ME(Type, set, arginfo_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) + PHP_ME(Type, map, arginfo_map, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) +#if PHP_VERSION_ID >= 80100 + PHP_ME(Type, tuple, arginfo_types_return_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) + PHP_ME(Type, userType, arginfo_types_return_type, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) +#else + PHP_ME(Type, tuple, arginfo_types, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) + PHP_ME(Type, userType, arginfo_types, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) +#endif PHP_FE_END }; diff --git a/ext/src/Type.dep b/ext/src/Type.dep new file mode 100644 index 000000000..b410ab6e5 --- /dev/null +++ b/ext/src/Type.dep @@ -0,0 +1,98 @@ +src/Type.lo: /home/agabadounir/php-cassandra/ext/src/Type.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/Type/Tuple.h \ + src/Type/UserType.h diff --git a/ext/src/Type/Collection.c b/ext/src/Type/Collection.c index a85e08487..b19e831db 100644 --- a/ext/src/Type/Collection.c +++ b/ext/src/Type/Collection.c @@ -109,32 +109,77 @@ PHP_METHOD(TypeCollection, create) } } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value_type, 0, 0, PHP_DRIVER_NAMESPACE "\\Type", 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_create_collection, 0, 0, PHP_DRIVER_NAMESPACE "\\Collection", 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_collection_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeCollection, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeCollection, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeCollection, valueType, arginfo_value_type, ZEND_ACC_PUBLIC) + PHP_ME(TypeCollection, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeCollection, create, arginfo_create_collection, ZEND_ACC_PUBLIC) +#else PHP_ME(TypeCollection, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeCollection, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeCollection, valueType, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeCollection, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeCollection, create, arginfo_value, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_collection_handlers; static HashTable * -php_driver_type_collection_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_collection_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_collection_properties(zend_object *object) +{ + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + zend_hash_str_update(props, + "valueType", sizeof("valueType") - 1, + &self->data.collection.value_type); + Z_TRY_ADDREF_P(&self->data.collection.value_type); + + return props; +} +#else static HashTable * php_driver_type_collection_properties(zval *object TSRMLS_DC) { @@ -148,6 +193,7 @@ php_driver_type_collection_properties(zval *object TSRMLS_DC) return props; } +#endif static int php_driver_type_collection_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -166,7 +212,11 @@ php_driver_type_collection_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->data_type) cass_data_type_free(self->data_type); PHP5TO7_ZVAL_MAYBE_DESTROY(self->data.collection.value_type); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -189,11 +239,15 @@ void php_driver_define_TypeCollection(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\Collection", php_driver_type_collection_methods); php_driver_type_collection_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_collection_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_collection_handlers.get_properties = php_driver_type_collection_properties; + php_driver_type_collection_handlers.get_properties = php_driver_type_collection_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_collection_handlers.get_gc = php_driver_type_collection_gc; + php_driver_type_collection_handlers.get_gc = php_driver_type_collection_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_collection_handlers.compare = php_driver_type_collection_compare; +#else php_driver_type_collection_handlers.compare_objects = php_driver_type_collection_compare; +#endif php_driver_type_collection_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_collection_ce->create_object = php_driver_type_collection_new; } diff --git a/ext/src/Type/Collection.dep b/ext/src/Type/Collection.dep new file mode 100644 index 000000000..cf9b081c4 --- /dev/null +++ b/ext/src/Type/Collection.dep @@ -0,0 +1,99 @@ +src/Type/Collection.lo: \ + /home/agabadounir/php-cassandra/ext/src/Type/Collection.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/Collection.h \ + util/collections.h diff --git a/ext/src/Type/Custom.c b/ext/src/Type/Custom.c index f751cb676..3c8272ddd 100644 --- a/ext/src/Type/Custom.c +++ b/ext/src/Type/Custom.c @@ -62,31 +62,74 @@ PHP_METHOD(TypeCustom, create) return; } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value, 0, 0, PHP_DRIVER_NAMESPACE "\\Custom", 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_custom_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeCustom, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeCustom, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeCustom, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeCustom, create, arginfo_value, ZEND_ACC_PUBLIC) +#else PHP_ME(TypeCustom, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeCustom, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeCustom, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeCustom, create, arginfo_value, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_custom_handlers; static HashTable * -php_driver_type_custom_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_custom_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_custom_properties(zend_object *object) +{ + zval name; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + ZVAL_STRING(&name, self->data.custom.class_name); + + zend_hash_str_update(props, + "name", sizeof("name") - 1, + &name); + return props; +} +#else static HashTable * php_driver_type_custom_properties(zval *object TSRMLS_DC) { @@ -103,6 +146,7 @@ php_driver_type_custom_properties(zval *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_P(name), sizeof(zval)); return props; } +#endif static int php_driver_type_custom_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -124,7 +168,11 @@ php_driver_type_custom_free(php5to7_zend_object_free *object TSRMLS_DC) self->data.custom.class_name = NULL; } + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -147,11 +195,17 @@ void php_driver_define_TypeCustom(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\Custom", php_driver_type_custom_methods); php_driver_type_custom_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_custom_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_custom_handlers.get_properties = php_driver_type_custom_properties; + php_driver_type_custom_handlers.get_properties = php_driver_type_custom_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_custom_handlers.get_gc = php_driver_type_custom_gc; + php_driver_type_custom_handlers.get_gc = php_driver_type_custom_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_custom_handlers.compare = php_driver_type_custom_compare; + php_driver_type_custom_handlers.free_obj = php_driver_type_custom_free; +#else php_driver_type_custom_handlers.compare_objects = php_driver_type_custom_compare; + php_driver_type_custom_handlers.free_obj = php_driver_type_custom_free; +#endif php_driver_type_custom_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_custom_ce->create_object = php_driver_type_custom_new; } diff --git a/ext/src/Type/Custom.dep b/ext/src/Type/Custom.dep new file mode 100644 index 000000000..13d95ad39 --- /dev/null +++ b/ext/src/Type/Custom.dep @@ -0,0 +1,98 @@ +src/Type/Custom.lo: /home/agabadounir/php-cassandra/ext/src/Type/Custom.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Type/Map.c b/ext/src/Type/Map.c index 2fd3b2f5d..5a3f3751f 100644 --- a/ext/src/Type/Map.c +++ b/ext/src/Type/Map.c @@ -125,33 +125,84 @@ PHP_METHOD(TypeMap, create) } } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_key_value_type, 0, 0, PHP_DRIVER_NAMESPACE "\\Type", 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_create_map, 0, 0, PHP_DRIVER_NAMESPACE "\\Map", 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_map_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeMap, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeMap, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeMap, keyType, arginfo_key_value_type, ZEND_ACC_PUBLIC) + PHP_ME(TypeMap, valueType, arginfo_key_value_type, ZEND_ACC_PUBLIC) + PHP_ME(TypeMap, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeMap, create, arginfo_create_map, ZEND_ACC_PUBLIC) +#else PHP_ME(TypeMap, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeMap, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeMap, keyType, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeMap, valueType, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeMap, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeMap, create, arginfo_value, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_map_handlers; static HashTable * -php_driver_type_map_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_map_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_map_properties(zend_object *object) +{ + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + zend_hash_str_update(props, + "keyType", sizeof("keyType") - 1, + &self->data.map.key_type); + Z_TRY_ADDREF_P(&self->data.map.key_type); + + zend_hash_str_update(props, + "valueType", sizeof("valueType") - 1, + &self->data.map.value_type); + Z_TRY_ADDREF_P(&self->data.map.value_type); + + return props; +} +#else static HashTable * php_driver_type_map_properties(zval *object TSRMLS_DC) { @@ -170,6 +221,7 @@ php_driver_type_map_properties(zval *object TSRMLS_DC) return props; } +#endif static int php_driver_type_map_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -189,7 +241,11 @@ php_driver_type_map_free(php5to7_zend_object_free *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_DESTROY(self->data.map.key_type); PHP5TO7_ZVAL_MAYBE_DESTROY(self->data.map.value_type); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -214,11 +270,15 @@ void php_driver_define_TypeMap(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\Map", php_driver_type_map_methods); php_driver_type_map_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_map_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_map_handlers.get_properties = php_driver_type_map_properties; + php_driver_type_map_handlers.get_properties = php_driver_type_map_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_map_handlers.get_gc = php_driver_type_map_gc; + php_driver_type_map_handlers.get_gc = php_driver_type_map_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_map_handlers.compare = php_driver_type_map_compare; +#else php_driver_type_map_handlers.compare_objects = php_driver_type_map_compare; +#endif php_driver_type_map_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_map_ce->create_object = php_driver_type_map_new; } diff --git a/ext/src/Type/Map.dep b/ext/src/Type/Map.dep new file mode 100644 index 000000000..16b61bb42 --- /dev/null +++ b/ext/src/Type/Map.dep @@ -0,0 +1,98 @@ +src/Type/Map.lo: /home/agabadounir/php-cassandra/ext/src/Type/Map.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/Map.h diff --git a/ext/src/Type/Scalar.c b/ext/src/Type/Scalar.c index e01ae6259..bc940ac4a 100644 --- a/ext/src/Type/Scalar.c +++ b/ext/src/Type/Scalar.c @@ -65,31 +65,78 @@ PHP_METHOD(TypeScalar, create) php_driver_scalar_init(INTERNAL_FUNCTION_PARAM_PASSTHRU); } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_create_mixed, 0, 0, IS_MIXED, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_scalar_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeScalar, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeScalar, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeScalar, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeScalar, create, arginfo_create_mixed,ZEND_ACC_PUBLIC) +#else PHP_ME(TypeScalar, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeScalar, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeScalar, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeScalar, create, arginfo_value, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_scalar_handlers; static HashTable * -php_driver_type_scalar_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_scalar_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_scalar_properties(zend_object *object) +{ + zval name; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + /* Used for comparison and 'text' is just an alias for 'varchar' */ + CassValueType type = self->type == CASS_VALUE_TYPE_TEXT + ? CASS_VALUE_TYPE_VARCHAR + : self->type; + + ZVAL_STRING(&name, php_driver_scalar_type_name(type)); + zend_hash_str_update(props, + "name", sizeof("name") - 1, + &name); + return props; +} +#else static HashTable * php_driver_type_scalar_properties(zval *object TSRMLS_DC) { @@ -111,6 +158,7 @@ php_driver_type_scalar_properties(zval *object TSRMLS_DC) PHP5TO7_ZVAL_MAYBE_P(name), sizeof(zval)); return props; } +#endif static int php_driver_type_scalar_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -128,7 +176,11 @@ php_driver_type_scalar_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->data_type) cass_data_type_free(self->data_type); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -150,11 +202,15 @@ void php_driver_define_TypeScalar(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\Scalar", php_driver_type_scalar_methods); php_driver_type_scalar_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_scalar_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_scalar_handlers.get_properties = php_driver_type_scalar_properties; + php_driver_type_scalar_handlers.get_properties = php_driver_type_scalar_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_scalar_handlers.get_gc = php_driver_type_scalar_gc; + php_driver_type_scalar_handlers.get_gc = php_driver_type_scalar_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_scalar_handlers.compare = php_driver_type_scalar_compare; +#else php_driver_type_scalar_handlers.compare_objects = php_driver_type_scalar_compare; +#endif php_driver_type_scalar_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_scalar_ce->create_object = php_driver_type_scalar_new; } diff --git a/ext/src/Type/Scalar.dep b/ext/src/Type/Scalar.dep new file mode 100644 index 000000000..8ce81638c --- /dev/null +++ b/ext/src/Type/Scalar.dep @@ -0,0 +1,98 @@ +src/Type/Scalar.lo: /home/agabadounir/php-cassandra/ext/src/Type/Scalar.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/src/Type/Set.c b/ext/src/Type/Set.c index faa2e95e5..ba106c4b0 100644 --- a/ext/src/Type/Set.c +++ b/ext/src/Type/Set.c @@ -101,32 +101,77 @@ PHP_METHOD(TypeSet, create) } } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value_type, 0, 0, PHP_DRIVER_NAMESPACE "\\Type", 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_create_set, 0, 0, PHP_DRIVER_NAMESPACE "\\Set", 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_set_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeSet, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeSet, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeSet, valueType, arginfo_value_type, ZEND_ACC_PUBLIC) + PHP_ME(TypeSet, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeSet, create, arginfo_create_set, ZEND_ACC_PUBLIC) +#else PHP_ME(TypeSet, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeSet, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeSet, valueType, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeSet, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeSet, create, arginfo_value, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_set_handlers; static HashTable * -php_driver_type_set_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_set_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_set_properties(zend_object *object) +{ + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + zend_hash_str_update(props, + "valueType", sizeof("valueType") - 1, + &self->data.set.value_type); + Z_TRY_ADDREF_P(&self->data.set.value_type); + + return props; +} +#else static HashTable * php_driver_type_set_properties(zval *object TSRMLS_DC) { @@ -140,6 +185,7 @@ php_driver_type_set_properties(zval *object TSRMLS_DC) return props; } +#endif static int php_driver_type_set_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -158,7 +204,11 @@ php_driver_type_set_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->data_type) cass_data_type_free(self->data_type); PHP5TO7_ZVAL_MAYBE_DESTROY(self->data.set.value_type); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -182,11 +232,15 @@ void php_driver_define_TypeSet(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\Set", php_driver_type_set_methods); php_driver_type_set_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_set_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_set_handlers.get_properties = php_driver_type_set_properties; + php_driver_type_set_handlers.get_properties = php_driver_type_set_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_set_handlers.get_gc = php_driver_type_set_gc; + php_driver_type_set_handlers.get_gc = php_driver_type_set_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_set_handlers.compare = php_driver_type_set_compare; +#else php_driver_type_set_handlers.compare_objects = php_driver_type_set_compare; +#endif php_driver_type_set_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_set_ce->create_object = php_driver_type_set_new; } diff --git a/ext/src/Type/Set.dep b/ext/src/Type/Set.dep new file mode 100644 index 000000000..f60aa6b80 --- /dev/null +++ b/ext/src/Type/Set.dep @@ -0,0 +1,98 @@ +src/Type/Set.lo: /home/agabadounir/php-cassandra/ext/src/Type/Set.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/Set.h diff --git a/ext/src/Type/Tuple.c b/ext/src/Type/Tuple.c index 816b808da..912abbc4a 100644 --- a/ext/src/Type/Tuple.c +++ b/ext/src/Type/Tuple.c @@ -137,32 +137,80 @@ PHP_METHOD(TypeTuple, create) } } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_create_tuple, 0, 0, PHP_DRIVER_NAMESPACE "\\Tuple", 0) + ZEND_ARG_INFO(0, values) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_values, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, values) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_tuple_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeTuple, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeTuple, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeTuple, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeTuple, types, arginfo_array, ZEND_ACC_PUBLIC) + PHP_ME(TypeTuple, create, arginfo_create_tuple,ZEND_ACC_PUBLIC) +#else PHP_ME(TypeTuple, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeTuple, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeTuple, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeTuple, types, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeTuple, create, arginfo_values, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_tuple_handlers; static HashTable * -php_driver_type_tuple_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_tuple_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_tuple_properties(zend_object *object) +{ + zval types; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + array_init(&types); + zend_hash_copy(Z_ARRVAL(types), &self->data.tuple.types, (copy_ctor_func_t) zval_add_ref); + zend_hash_str_update(props, + "types", sizeof("types") - 1, + &types); + + return props; +} +#else static HashTable * php_driver_type_tuple_properties(zval *object TSRMLS_DC) { @@ -180,6 +228,7 @@ php_driver_type_tuple_properties(zval *object TSRMLS_DC) return props; } +#endif static int php_driver_type_tuple_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -198,7 +247,11 @@ php_driver_type_tuple_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->data_type) cass_data_type_free(self->data_type); zend_hash_destroy(&self->data.tuple.types); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -221,11 +274,15 @@ void php_driver_define_TypeTuple(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\Tuple", php_driver_type_tuple_methods); php_driver_type_tuple_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_tuple_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_tuple_handlers.get_properties = php_driver_type_tuple_properties; + php_driver_type_tuple_handlers.get_properties = php_driver_type_tuple_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_tuple_handlers.get_gc = php_driver_type_tuple_gc; + php_driver_type_tuple_handlers.get_gc = php_driver_type_tuple_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_tuple_handlers.compare = php_driver_type_tuple_compare; +#else php_driver_type_tuple_handlers.compare_objects = php_driver_type_tuple_compare; +#endif php_driver_type_tuple_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_tuple_ce->create_object = php_driver_type_tuple_new; } diff --git a/ext/src/Type/Tuple.dep b/ext/src/Type/Tuple.dep new file mode 100644 index 000000000..3f673bf3f --- /dev/null +++ b/ext/src/Type/Tuple.dep @@ -0,0 +1,99 @@ +src/Type/Tuple.lo: /home/agabadounir/php-cassandra/ext/src/Type/Tuple.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/Tuple.h \ + util/collections.h diff --git a/ext/src/Type/UserType.c b/ext/src/Type/UserType.c index 38393f391..6258cb099 100644 --- a/ext/src/Type/UserType.c +++ b/ext/src/Type/UserType.c @@ -89,7 +89,7 @@ PHP_METHOD(TypeUserType, name) self = PHP_DRIVER_GET_TYPE(getThis()); if (!self->data.udt.type_name) - RETURN_NULL(); + RETURN_STRING(""); PHP5TO7_RETVAL_STRING(self->data.udt.type_name); } @@ -131,7 +131,7 @@ PHP_METHOD(TypeUserType, keyspace) self = PHP_DRIVER_GET_TYPE(getThis()); if (!self->data.udt.keyspace) - RETURN_NULL(); + RETURN_STRING(""); PHP5TO7_RETVAL_STRING(self->data.udt.keyspace); } @@ -231,6 +231,30 @@ PHP_METHOD(TypeUserType, create) } } +#if PHP_VERSION_ID >= 80100 +/* Constructors cannot have return types; use separate untyped arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ctor_none, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_with_name, 0, 1, PHP_DRIVER_NAMESPACE "\\Type\\UserType", 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() + +/* name() and keyspace() now return non-null string to match base Type::name(): string */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_with_keyspace, 0, 1, PHP_DRIVER_NAMESPACE "\\Type\\UserType", 0) + ZEND_ARG_TYPE_INFO(0, keyspace, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_create_udt_value, 0, 0, PHP_DRIVER_NAMESPACE "\\UserTypeValue", 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() +#else ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() @@ -245,8 +269,19 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_keyspace, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, keyspace) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_type_user_type_methods[] = { +#if PHP_VERSION_ID >= 80100 + PHP_ME(TypeUserType, __construct, arginfo_ctor_none, ZEND_ACC_PRIVATE) + PHP_ME(TypeUserType, withName, arginfo_with_name, ZEND_ACC_PUBLIC) + PHP_ME(TypeUserType, name, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeUserType, withKeyspace, arginfo_with_keyspace, ZEND_ACC_PUBLIC) + PHP_ME(TypeUserType, keyspace, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeUserType, __toString, arginfo_string, ZEND_ACC_PUBLIC) + PHP_ME(TypeUserType, types, arginfo_array, ZEND_ACC_PUBLIC) + PHP_ME(TypeUserType, create, arginfo_create_udt_value,ZEND_ACC_PUBLIC) +#else PHP_ME(TypeUserType, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeUserType, withName, arginfo_name, ZEND_ACC_PUBLIC) PHP_ME(TypeUserType, name, arginfo_none, ZEND_ACC_PUBLIC) @@ -255,19 +290,44 @@ static zend_function_entry php_driver_type_user_type_methods[] = { PHP_ME(TypeUserType, __toString, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeUserType, types, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeUserType, create, arginfo_value, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; static zend_object_handlers php_driver_type_user_type_handlers; static HashTable * -php_driver_type_user_type_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_type_user_type_gc(zend_object *object, zval **table, int *n) { *table = NULL; *n = 0; + #if PHP_VERSION_ID >= 80000 + return zend_std_get_properties(object); +#else return zend_std_get_properties(object TSRMLS_CC); +#endif } +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_type_user_type_properties(zend_object *object) +{ + zval types; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_type *self = PHP_DRIVER_GET_TYPE(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + array_init(&types); + zend_hash_copy(Z_ARRVAL(types), &self->data.udt.types, (copy_ctor_func_t) zval_add_ref); + zend_hash_str_update(props, + "types", sizeof("types") - 1, + &types); + + return props; +} +#else static HashTable * php_driver_type_user_type_properties(zval *object TSRMLS_DC) { @@ -285,6 +345,7 @@ php_driver_type_user_type_properties(zval *object TSRMLS_DC) return props; } +#endif static int php_driver_type_user_type_compare(zval *obj1, zval *obj2 TSRMLS_DC) @@ -305,7 +366,11 @@ php_driver_type_user_type_free(php5to7_zend_object_free *object TSRMLS_DC) if (self->data.udt.type_name) efree(self->data.udt.type_name); zend_hash_destroy(&self->data.udt.types); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } @@ -329,11 +394,17 @@ void php_driver_define_TypeUserType(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\Type\\UserType", php_driver_type_user_type_methods); php_driver_type_user_type_ce = php5to7_zend_register_internal_class_ex(&ce, php_driver_type_ce); memcpy(&php_driver_type_user_type_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_type_user_type_handlers.get_properties = php_driver_type_user_type_properties; + php_driver_type_user_type_handlers.get_properties = php_driver_type_user_type_properties; #if PHP_VERSION_ID >= 50400 - php_driver_type_user_type_handlers.get_gc = php_driver_type_user_type_gc; + php_driver_type_user_type_handlers.get_gc = php_driver_type_user_type_gc; #endif + #if PHP_VERSION_ID >= 80000 + php_driver_type_user_type_handlers.compare = php_driver_type_user_type_compare; + php_driver_type_user_type_handlers.free_obj = php_driver_type_user_type_free; +#else php_driver_type_user_type_handlers.compare_objects = php_driver_type_user_type_compare; + php_driver_type_user_type_handlers.free_obj = php_driver_type_user_type_free; +#endif php_driver_type_user_type_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_type_user_type_ce->create_object = php_driver_type_user_type_new; } diff --git a/ext/src/Type/UserType.dep b/ext/src/Type/UserType.dep new file mode 100644 index 000000000..c844960ed --- /dev/null +++ b/ext/src/Type/UserType.dep @@ -0,0 +1,99 @@ +src/Type/UserType.lo: \ + /home/agabadounir/php-cassandra/ext/src/Type/UserType.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/UserTypeValue.h \ + util/collections.h diff --git a/ext/src/UserTypeValue.c b/ext/src/UserTypeValue.c index bac2c75d3..3c1d33e17 100644 --- a/ext/src/UserTypeValue.c +++ b/ext/src/UserTypeValue.c @@ -28,50 +28,38 @@ zend_class_entry *php_driver_user_type_value_ce = NULL; void php_driver_user_type_value_set(php_driver_user_type_value *user_type_value, const char *name, size_t name_length, - zval *object TSRMLS_DC) + zval *object) { - PHP5TO7_ZEND_HASH_UPDATE(&user_type_value->values, - name, name_length + 1, - object, sizeof(zval *)); + zend_hash_str_update(&user_type_value->values, + name, name_length, + object); Z_TRY_ADDREF_P(object); user_type_value->dirty = 1; } static void -php_driver_user_type_value_populate(php_driver_user_type_value *user_type_value, zval *array TSRMLS_DC) +php_driver_user_type_value_populate(php_driver_user_type_value *user_type_value, zval *array) { - char *name; + zend_string *name; php_driver_type *type; - php5to7_zval *current; - php5to7_zval null; + zval *current; + zval null; - PHP5TO7_ZVAL_MAYBE_MAKE(null); - ZVAL_NULL(PHP5TO7_ZVAL_MAYBE_P(null)); + ZVAL_NULL(&null); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(user_type_value->type)); + type = PHP_DRIVER_GET_TYPE(&user_type_value->type); - PHP5TO7_ZEND_HASH_FOREACH_STR_KEY_VAL(&type->data.udt.types, name, current) { - php5to7_zval *value = NULL; - size_t name_len = strlen(name); - (void) current; - if (PHP5TO7_ZEND_HASH_FIND(&user_type_value->values, name, name_len + 1, value)) { - if (PHP5TO7_ADD_ASSOC_ZVAL_EX(array, name, name_len + 1, PHP5TO7_ZVAL_MAYBE_DEREF(value)) == SUCCESS) { - Z_TRY_ADDREF_P(PHP5TO7_ZVAL_MAYBE_DEREF(value)); - } else { - break; - } + ZEND_HASH_FOREACH_STR_KEY_VAL(&type->data.udt.types, name, current) { + zval *value = NULL; + (void)current; + if ((value = zend_hash_find(&user_type_value->values, name))) { + add_assoc_zval_ex(array, ZSTR_VAL(name), ZSTR_LEN(name), value); + Z_TRY_ADDREF_P(value); } else { - if (PHP5TO7_ADD_ASSOC_ZVAL_EX(array, name, name_len + 1, PHP5TO7_ZVAL_MAYBE_P(null)) == SUCCESS) { - Z_TRY_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(null)); - } else { - break; - } + add_assoc_zval_ex(array, ZSTR_VAL(name), ZSTR_LEN(name), &null); + Z_TRY_ADDREF_P(&null); } - } PHP5TO7_ZEND_HASH_FOREACH_END(&type->data.udt.types); - -#if PHP_MAJOR_VERSION < 7 - zval_ptr_dtor(&null); -#endif + } ZEND_HASH_FOREACH_END(); } /* {{{ UserTypeValue::__construct(types) */ @@ -80,24 +68,24 @@ PHP_METHOD(UserTypeValue, __construct) php_driver_user_type_value *self; php_driver_type *type; HashTable *types; - char *name; + zend_string *name; int index = 0; - php5to7_zval *current; + zval *current; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "h", &types) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "h", &types) == FAILURE) { return; } self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); - self->type = php_driver_type_user_type(TSRMLS_C); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + self->type = php_driver_type_user_type(); + type = PHP_DRIVER_GET_TYPE(&self->type); - PHP5TO7_ZEND_HASH_FOREACH_STR_KEY_VAL(types, name, current) { - zval *sub_type = PHP5TO7_ZVAL_MAYBE_DEREF(current); - php5to7_zval scalar_type; + ZEND_HASH_FOREACH_STR_KEY_VAL(types, name, current) { + zval *sub_type = current; + zval scalar_type; if (!name) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Argument %d is not a string", index + 1); return; } @@ -105,31 +93,32 @@ PHP_METHOD(UserTypeValue, __construct) if (Z_TYPE_P(sub_type) == IS_STRING) { CassValueType value_type; - if (!php_driver_value_type(Z_STRVAL_P(sub_type), &value_type TSRMLS_CC)) { + if (!php_driver_value_type(Z_STRVAL_P(sub_type), &value_type)) { return; } - scalar_type = php_driver_type_scalar(value_type TSRMLS_CC); + scalar_type = php_driver_type_scalar(value_type); if (!php_driver_type_user_type_add(type, - name, strlen(name), - PHP5TO7_ZVAL_MAYBE_P(scalar_type) TSRMLS_CC)) { + ZSTR_VAL(name), ZSTR_LEN(name), + &scalar_type)) { return; } } else if (Z_TYPE_P(sub_type) == IS_OBJECT && - instanceof_function(Z_OBJCE_P(sub_type), php_driver_type_ce TSRMLS_CC)) { - if (!php_driver_type_validate(sub_type, "sub_type" TSRMLS_CC)) { + instanceof_function(Z_OBJCE_P(sub_type), php_driver_type_ce)) { + if (!php_driver_type_validate(sub_type, "sub_type")) { return; } if (php_driver_type_user_type_add(type, - name, strlen(name), - sub_type TSRMLS_CC)) { + ZSTR_VAL(name), ZSTR_LEN(name), + sub_type)) { Z_ADDREF_P(sub_type); } else { return; } } else { INVALID_ARGUMENT(sub_type, "a string or an instance of " PHP_DRIVER_NAMESPACE "\\Type"); + return; } - } PHP5TO7_ZEND_HASH_FOREACH_END(types); + } ZEND_HASH_FOREACH_END(); } /* }}} */ @@ -137,7 +126,7 @@ PHP_METHOD(UserTypeValue, __construct) PHP_METHOD(UserTypeValue, type) { php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->type), 1, 0); + RETURN_ZVAL(&self->type, 1, 0); } /* {{{ UserTypeValue::values() */ @@ -147,7 +136,7 @@ PHP_METHOD(UserTypeValue, values) self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); array_init(return_value); - php_driver_user_type_value_populate(self, return_value TSRMLS_CC); + php_driver_user_type_value_populate(self, return_value); } /* }}} */ @@ -156,33 +145,32 @@ PHP_METHOD(UserTypeValue, set) { php_driver_user_type_value *self = NULL; php_driver_type *type; - php5to7_zval *sub_type; + zval *sub_type; char *name; size_t name_length; zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz", &name, &name_length, &value) == FAILURE) return; self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + type = PHP_DRIVER_GET_TYPE(&self->type); - if (!PHP5TO7_ZEND_HASH_FIND(&type->data.udt.types, - name, name_length + 1, - sub_type)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + if (!(sub_type = zend_hash_str_find(&type->data.udt.types, + name, name_length))) { + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Invalid name '%s'", name); return; } if (!php_driver_validate_object(value, - PHP5TO7_ZVAL_MAYBE_DEREF(sub_type) TSRMLS_CC)) { + sub_type)) { return; } - php_driver_user_type_value_set(self, name, name_length, value TSRMLS_CC); + php_driver_user_type_value_set(self, name, name_length, value); } /* }}} */ @@ -191,30 +179,28 @@ PHP_METHOD(UserTypeValue, get) { php_driver_user_type_value *self = NULL; php_driver_type *type; - php5to7_zval *sub_type; + zval *sub_type; char *name; size_t name_length; - php5to7_zval *value; + zval *value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_length) == FAILURE) return; self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); - type = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + type = PHP_DRIVER_GET_TYPE(&self->type); - if (!PHP5TO7_ZEND_HASH_FIND(&type->data.udt.types, - name, name_length + 1, - sub_type)) { - zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, + if (!(sub_type = zend_hash_str_find(&type->data.udt.types, + name, name_length))) { + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0, "Invalid name '%s'", name); return; } - if (PHP5TO7_ZEND_HASH_FIND(&self->values, - name, name_length + 1, - value)) { - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_DEREF(value), 1, 0); + if ((value = zend_hash_str_find(&self->values, + name, name_length))) { + RETURN_ZVAL(value, 1, 0); } } /* }}} */ @@ -225,7 +211,7 @@ PHP_METHOD(UserTypeValue, count) php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); php_driver_type *type = - PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + PHP_DRIVER_GET_TYPE(&self->type); RETURN_LONG(zend_hash_num_elements(&type->data.udt.types)); } /* }}} */ @@ -233,19 +219,15 @@ PHP_METHOD(UserTypeValue, count) /* {{{ UserTypeValue::current() */ PHP_METHOD(UserTypeValue, current) { - php5to7_string key; + zend_string *key; php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); php_driver_type *type = - PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); - if (PHP5TO7_ZEND_HASH_GET_CURRENT_KEY_EX(&type->data.udt.types, &key, NULL, &self->pos) == HASH_KEY_IS_STRING) { - php5to7_zval *value; -#if PHP_MAJOR_VERSION >= 7 - if (PHP5TO7_ZEND_HASH_FIND(&self->values, key->val, key->len + 1, value)) { -#else - if (PHP5TO7_ZEND_HASH_FIND(&self->values, key, strlen(key) + 1, value)) { -#endif - RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_DEREF(value), 1, 0); + PHP_DRIVER_GET_TYPE(&self->type); + if (zend_hash_get_current_key_ex(&type->data.udt.types, &key, NULL, &self->pos) == HASH_KEY_IS_STRING) { + zval *value; + if ((value = zend_hash_find(&self->values, key))) { + RETURN_ZVAL(value, 1, 0); } } } @@ -254,17 +236,13 @@ PHP_METHOD(UserTypeValue, current) /* {{{ UserTypeValue::key() */ PHP_METHOD(UserTypeValue, key) { - php5to7_string key; + zend_string *key; php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); php_driver_type *type = - PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); - if (PHP5TO7_ZEND_HASH_GET_CURRENT_KEY_EX(&type->data.udt.types, &key, NULL, &self->pos) == HASH_KEY_IS_STRING) { -#if PHP_MAJOR_VERSION >= 7 + PHP_DRIVER_GET_TYPE(&self->type); + if (zend_hash_get_current_key_ex(&type->data.udt.types, &key, NULL, &self->pos) == HASH_KEY_IS_STRING) { RETURN_STR(key); -#else - RETURN_STRING(key, 1); -#endif } } /* }}} */ @@ -275,7 +253,7 @@ PHP_METHOD(UserTypeValue, next) php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); php_driver_type *type = - PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + PHP_DRIVER_GET_TYPE(&self->type); zend_hash_move_forward_ex(&type->data.udt.types, &self->pos); } /* }}} */ @@ -286,7 +264,7 @@ PHP_METHOD(UserTypeValue, valid) php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); php_driver_type *type = - PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + PHP_DRIVER_GET_TYPE(&self->type); RETURN_BOOL(zend_hash_has_more_elements_ex(&type->data.udt.types, &self->pos) == SUCCESS); } /* }}} */ @@ -297,81 +275,159 @@ PHP_METHOD(UserTypeValue, rewind) php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(getThis()); php_driver_type *type = - PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(self->type)); + PHP_DRIVER_GET_TYPE(&self->type); zend_hash_internal_pointer_reset_ex(&type->data.udt.types, &self->pos); } /* }}} */ -ZEND_BEGIN_ARG_INFO_EX(arginfo__construct, 0, ZEND_RETURN_VALUE, 1) +#if PHP_VERSION_ID >= 80100 +/* Typed arginfo for PHP 8.1+ */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_none, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_bool, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array, 0, 0, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_count, 0, 0, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_type_user_type, 0, 0, PHP_DRIVER_NAMESPACE "\\Type\\UserType", 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mixed, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_key_maybe_string, 0, 0, MAY_BE_STRING|MAY_BE_NULL) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_construct_types, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, types, IS_ARRAY, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set, 0, 2, IS_VOID, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get, 0, 1, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() +#else +/* Legacy arginfo without return types */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_construct_types, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, types) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, 0, ZEND_RETURN_VALUE, 2) + ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_name, 0, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_get, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +#endif static zend_function_entry php_driver_user_type_value_methods[] = { - PHP_ME(UserTypeValue, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, type, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, values, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, set, arginfo_value, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, get, arginfo_name, ZEND_ACC_PUBLIC) +#if PHP_VERSION_ID >= 80100 + PHP_ME(UserTypeValue, __construct, arginfo_construct_types, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, type, arginfo_type_user_type, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, values, arginfo_array, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, set, arginfo_set, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, get, arginfo_get, ZEND_ACC_PUBLIC) + /* Countable */ + PHP_ME(UserTypeValue, count, arginfo_count, ZEND_ACC_PUBLIC) + /* Iterator */ + PHP_ME(UserTypeValue, current, arginfo_mixed, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, key, arginfo_key_maybe_string,ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, next, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, valid, arginfo_bool, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#else + PHP_ME(UserTypeValue, __construct, arginfo_construct_types, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, type, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, values, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, set, arginfo_set, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, get, arginfo_get, ZEND_ACC_PUBLIC) /* Countable */ - PHP_ME(UserTypeValue, count, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, count, arginfo_none, ZEND_ACC_PUBLIC) /* Iterator */ - PHP_ME(UserTypeValue, current, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, key, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, next, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, valid, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(UserTypeValue, rewind, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, current, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, key, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, next, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, valid, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(UserTypeValue, rewind, arginfo_none, ZEND_ACC_PUBLIC) +#endif PHP_FE_END }; -static php_driver_value_handlers php_driver_user_type_value_handlers; +static zend_object_handlers php_driver_user_type_value_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_user_type_value_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else static HashTable * -php_driver_user_type_value_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_user_type_value_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_user_type_value_properties(zend_object *object) +#else static HashTable * php_driver_user_type_value_properties(zval *object TSRMLS_DC) +#endif { - php5to7_zval values; + zval values; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); - php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(object); + php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(&obj_zval); +#if PHP_VERSION_ID >= 80000 + HashTable *props = zend_std_get_properties(object); +#else HashTable *props = zend_std_get_properties(object TSRMLS_CC); +#endif - PHP5TO7_ZEND_HASH_UPDATE(props, - "type", sizeof("type"), - PHP5TO7_ZVAL_MAYBE_P(self->type), sizeof(zval)); - Z_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(self->type)); + zend_hash_update(props, zend_string_init("type", 4, 0), &self->type); + Z_TRY_ADDREF_P(&self->type); - PHP5TO7_ZVAL_MAYBE_MAKE(values); - array_init(PHP5TO7_ZVAL_MAYBE_P(values)); - php_driver_user_type_value_populate(self, PHP5TO7_ZVAL_MAYBE_P(values) TSRMLS_CC); - PHP5TO7_ZEND_HASH_UPDATE(props, "values", sizeof("values"), PHP5TO7_ZVAL_MAYBE_P(values), sizeof(zval)); + array_init(&values); + php_driver_user_type_value_populate(self, &values); + zend_hash_update(props, zend_string_init("values", 6, 0), &values); return props; } +#if PHP_VERSION_ID < 80000 static int php_driver_user_type_value_compare(zval *obj1, zval *obj2 TSRMLS_DC) +#else +int +php_driver_user_type_value_compare(zval *obj1, zval *obj2) +#endif { HashPosition pos1; HashPosition pos2; - php5to7_zval *current1; - php5to7_zval *current2; + zval *current1; + zval *current2; php_driver_user_type_value *user_type_value1; php_driver_user_type_value *user_type_value2; php_driver_type *type1; @@ -384,10 +440,14 @@ php_driver_user_type_value_compare(zval *obj1, zval *obj2 TSRMLS_DC) user_type_value1 = PHP_DRIVER_GET_USER_TYPE_VALUE(obj1); user_type_value2 = PHP_DRIVER_GET_USER_TYPE_VALUE(obj2); - type1 = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(user_type_value1->type)); - type2 = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(user_type_value2->type)); + type1 = PHP_DRIVER_GET_TYPE(&user_type_value1->type); + type2 = PHP_DRIVER_GET_TYPE(&user_type_value2->type); +#if PHP_VERSION_ID < 80000 result = php_driver_type_compare(type1, type2 TSRMLS_CC); +#else + result = php_driver_type_compare(type1, type2); +#endif if (result != 0) return result; if (zend_hash_num_elements(&user_type_value1->values) != zend_hash_num_elements(&user_type_value2->values)) { @@ -397,10 +457,15 @@ php_driver_user_type_value_compare(zval *obj1, zval *obj2 TSRMLS_DC) zend_hash_internal_pointer_reset_ex(&user_type_value1->values, &pos1); zend_hash_internal_pointer_reset_ex(&user_type_value2->values, &pos2); - while (PHP5TO7_ZEND_HASH_GET_CURRENT_DATA_EX(&user_type_value1->values, current1, &pos1) && - PHP5TO7_ZEND_HASH_GET_CURRENT_DATA_EX(&user_type_value2->values, current2, &pos2)) { - result = php_driver_value_compare(PHP5TO7_ZVAL_MAYBE_DEREF(current1), - PHP5TO7_ZVAL_MAYBE_DEREF(current2) TSRMLS_CC); + while ((current1 = zend_hash_get_current_data_ex(&user_type_value1->values, &pos1)) && + (current2 = zend_hash_get_current_data_ex(&user_type_value2->values, &pos2))) { +#if PHP_VERSION_ID < 80000 + result = php_driver_value_compare(current1, + current2 TSRMLS_CC); +#else + result = php_driver_value_compare(current1, + current2); +#endif if (result != 0) return result; zend_hash_move_forward_ex(&user_type_value1->values, &pos1); zend_hash_move_forward_ex(&user_type_value2->values, &pos2); @@ -409,19 +474,24 @@ php_driver_user_type_value_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 0; } +#if PHP_VERSION_ID < 80000 static unsigned php_driver_user_type_value_hash_value(zval *obj TSRMLS_DC) +#else +unsigned +php_driver_user_type_value_hash_value(zval *obj) +#endif { - php5to7_zval *current; + zval *current; unsigned hashv = 0; php_driver_user_type_value *self = PHP_DRIVER_GET_USER_TYPE_VALUE(obj); if (!self->dirty) return self->hashv; - PHP5TO7_ZEND_HASH_FOREACH_VAL(&self->values, current) { + ZEND_HASH_FOREACH_VAL(&self->values, current) { hashv = php_driver_combine_hash(hashv, - php_driver_value_hash(PHP5TO7_ZVAL_MAYBE_DEREF(current) TSRMLS_CC)); - } PHP5TO7_ZEND_HASH_FOREACH_END(&self->values); + php_driver_value_hash(current TSRMLS_CC)); + } ZEND_HASH_FOREACH_END(); self->hashv = hashv; self->dirty = 0; @@ -429,35 +499,71 @@ php_driver_user_type_value_hash_value(zval *obj TSRMLS_DC) return hashv; } +#if PHP_VERSION_ID >= 80000 +static void +php_driver_user_type_value_free(zend_object *object) +#else static void -php_driver_user_type_value_free(php5to7_zend_object_free *object TSRMLS_DC) +php_driver_user_type_value_free(void *object TSRMLS_DC) +#endif { - php_driver_user_type_value *self = - PHP5TO7_ZEND_OBJECT_GET(user_type_value, object); - +#if PHP_VERSION_ID >= 80000 + php_driver_user_type_value *self = (php_driver_user_type_value *) ((char *) (object) - XtOffsetOf(php_driver_user_type_value, std)); +#else + php_driver_user_type_value *self = (php_driver_user_type_value *) object; +#endif zend_hash_destroy(&self->values); - PHP5TO7_ZVAL_MAYBE_DESTROY(self->type); - + zval_ptr_dtor(&self->type); +#if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); - PHP5TO7_MAYBE_EFREE(self); + efree(self); +#endif } -static php5to7_zend_object +#if PHP_VERSION_ID >= 80000 +static zend_object* +php_driver_user_type_value_new(zend_class_entry *ce) +#else +static zend_object_value php_driver_user_type_value_new(zend_class_entry *ce TSRMLS_DC) +#endif { - php_driver_user_type_value *self = - PHP5TO7_ZEND_OBJECT_ECALLOC(user_type_value, ce); +#if PHP_VERSION_ID >= 80000 + php_driver_user_type_value *self = ecalloc(1, sizeof(php_driver_user_type_value) + zend_object_properties_size(ce)); zend_hash_init(&self->values, 0, NULL, ZVAL_PTR_DTOR, 0); -#if PHP_MAJOR_VERSION >= 7 self->pos = HT_INVALID_IDX; + self->dirty = 1; + ZVAL_UNDEF(&self->type); + + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_user_type_value_handlers; + + return &self->std; #else + zend_object_value retval; + php_driver_user_type_value *self; + + self = (php_driver_user_type_value *) ecalloc(1, sizeof(php_driver_user_type_value)); + + zend_hash_init(&self->values, 0, NULL, ZVAL_PTR_DTOR, 0); self->pos = NULL; -#endif self->dirty = 1; - PHP5TO7_ZVAL_UNDEF(self->type); + ZVAL_UNDEF(&self->type); - PHP5TO7_ZEND_OBJECT_INIT(user_type_value, self, ce); + zend_object_std_init(&self->zval, ce TSRMLS_CC); + object_properties_init(&self->zval, ce TSRMLS_CC); + + retval.handle = zend_objects_store_put(self, + (zend_objects_store_dtor_t) zend_objects_destroy_object, + php_driver_user_type_value_free, NULL TSRMLS_CC); + retval.handlers = &php_driver_user_type_value_handlers; + + return retval; +#endif } void php_driver_define_UserTypeValue(TSRMLS_D) @@ -466,17 +572,28 @@ void php_driver_define_UserTypeValue(TSRMLS_D) INIT_CLASS_ENTRY(ce, PHP_DRIVER_NAMESPACE "\\UserTypeValue", php_driver_user_type_value_methods); php_driver_user_type_value_ce = zend_register_internal_class(&ce TSRMLS_CC); - zend_class_implements(php_driver_user_type_value_ce TSRMLS_CC, 1, php_driver_value_ce); + zend_class_implements(php_driver_user_type_value_ce, 1, php_driver_value_ce); memcpy(&php_driver_user_type_value_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - php_driver_user_type_value_handlers.std.get_properties = php_driver_user_type_value_properties; + +#if PHP_VERSION_ID >= 80000 + php_driver_user_type_value_handlers.offset = XtOffsetOf(php_driver_user_type_value, std); + php_driver_user_type_value_handlers.free_obj = php_driver_user_type_value_free; + php_driver_user_type_value_handlers.get_properties = php_driver_user_type_value_properties; + php_driver_user_type_value_handlers.get_gc = php_driver_user_type_value_gc; + php_driver_user_type_value_handlers.compare = php_driver_user_type_value_compare; + php_driver_user_type_value_handlers.clone_obj = NULL; + zend_class_implements(php_driver_user_type_value_ce, 2, zend_ce_countable, zend_ce_iterator); +#else + php_driver_user_type_value_handlers.get_properties = php_driver_user_type_value_properties; + php_driver_user_type_value_handlers.compare_objects = php_driver_user_type_value_compare; + php_driver_user_type_value_handlers.clone_obj = NULL; #if PHP_VERSION_ID >= 50400 - php_driver_user_type_value_handlers.std.get_gc = php_driver_user_type_value_gc; + php_driver_user_type_value_handlers.get_gc = php_driver_user_type_value_gc; #endif - php_driver_user_type_value_handlers.std.compare_objects = php_driver_user_type_value_compare; - php_driver_user_type_value_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; - php_driver_user_type_value_ce->create_object = php_driver_user_type_value_new; + php_driver_user_type_value_handlers.hash_value = php_driver_user_type_value_hash_value; zend_class_implements(php_driver_user_type_value_ce TSRMLS_CC, 2, spl_ce_Countable, zend_ce_iterator); +#endif - php_driver_user_type_value_handlers.hash_value = php_driver_user_type_value_hash_value; - php_driver_user_type_value_handlers.std.clone_obj = NULL; -} + php_driver_user_type_value_ce->ce_flags |= ZEND_ACC_FINAL; + php_driver_user_type_value_ce->create_object = php_driver_user_type_value_new; +} \ No newline at end of file diff --git a/ext/src/UserTypeValue.dep b/ext/src/UserTypeValue.dep new file mode 100644 index 000000000..70637aedd --- /dev/null +++ b/ext/src/UserTypeValue.dep @@ -0,0 +1,99 @@ +src/UserTypeValue.lo: \ + /home/agabadounir/php-cassandra/ext/src/UserTypeValue.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/collections.h util/hash.h util/uthash.h \ + util/types.h /usr/include/php/20230831/Zend/zend_smart_str.h \ + src/Type/UserType.h src/UserTypeValue.h diff --git a/ext/src/Uuid.c b/ext/src/Uuid.c index af37360f2..f773ffdb6 100644 --- a/ext/src/Uuid.c +++ b/ext/src/Uuid.c @@ -45,7 +45,7 @@ php_driver_uuid_init(INTERNAL_FUNCTION_PARAMETERS) } else { if (cass_uuid_from_string(value, &self->uuid) != CASS_OK) { zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, 0 TSRMLS_CC, - "Invalid UUID: '%.*s'", value_len, value); + "Invalid UUID: '%.*s'", (int)value_len, value); return; } } @@ -58,6 +58,9 @@ PHP_METHOD(Uuid, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Uuid::__toString() */ PHP_METHOD(Uuid, __toString) { @@ -108,7 +111,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_uuid_methods[] = { PHP_ME(Uuid, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Uuid, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Uuid, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Uuid, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Uuid, uuid, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Uuid, version, arginfo_none, ZEND_ACC_PUBLIC) @@ -117,14 +120,52 @@ static zend_function_entry php_driver_uuid_methods[] = { static php_driver_value_handlers php_driver_uuid_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_uuid_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else static HashTable * -php_driver_uuid_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_uuid_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_uuid_properties(zend_object *object) +{ + char string[CASS_UUID_STRING_LENGTH]; + zval type; + zval uuid; + zval version; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_uuid *self = PHP_DRIVER_GET_UUID(&obj_zval); + HashTable *props = zend_std_get_properties(object); + + cass_uuid_string(self->uuid, string); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_UUID); + zend_hash_str_update(props, "type", sizeof("type") - 1, &type); + + ZVAL_STRING(&uuid, string); + zend_hash_str_update(props, "uuid", sizeof("uuid") - 1, &uuid); + + ZVAL_LONG(&version, (long) cass_uuid_version(self->uuid)); + zend_hash_str_update(props, "version", sizeof("version") - 1, &version); + + return props; +} +#else static HashTable * php_driver_uuid_properties(zval *object TSRMLS_DC) { @@ -134,7 +175,7 @@ php_driver_uuid_properties(zval *object TSRMLS_DC) php5to7_zval version; php_driver_uuid *self = PHP_DRIVER_GET_UUID(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); cass_uuid_string(self->uuid, string); @@ -151,7 +192,9 @@ php_driver_uuid_properties(zval *object TSRMLS_DC) return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_uuid_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -171,6 +214,7 @@ php_driver_uuid_compare(zval *obj1, zval *obj2 TSRMLS_DC) return 0; } +#endif static unsigned php_driver_uuid_hash_value(zval *obj TSRMLS_DC) @@ -181,14 +225,20 @@ php_driver_uuid_hash_value(zval *obj TSRMLS_DC) } +#if PHP_VERSION_ID < 80000 static void php_driver_uuid_free(php5to7_zend_object_free *object TSRMLS_DC) { php_driver_uuid *self = PHP5TO7_ZEND_OBJECT_GET(uuid, object); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_uuid_new(zend_class_entry *ce TSRMLS_DC) @@ -196,7 +246,17 @@ php_driver_uuid_new(zend_class_entry *ce TSRMLS_DC) php_driver_uuid *self = PHP5TO7_ZEND_OBJECT_ECALLOC(uuid, ce); - PHP5TO7_ZEND_OBJECT_INIT(uuid, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_uuid_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_uuid_handlers; + return &self->zval; +#endif } void @@ -212,10 +272,13 @@ php_driver_define_Uuid(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_uuid_handlers.std.get_gc = php_driver_uuid_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_uuid_handlers.std.compare_objects = php_driver_uuid_compare; +#endif php_driver_uuid_ce->ce_flags |= PHP5TO7_ZEND_ACC_FINAL; php_driver_uuid_ce->create_object = php_driver_uuid_new; - +#if PHP_VERSION_ID < 80000 php_driver_uuid_handlers.hash_value = php_driver_uuid_hash_value; +#endif php_driver_uuid_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Uuid.dep b/ext/src/Uuid.dep new file mode 100644 index 000000000..e96f04974 --- /dev/null +++ b/ext/src/Uuid.dep @@ -0,0 +1,97 @@ +src/Uuid.lo: /home/agabadounir/php-cassandra/ext/src/Uuid.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h util/uuid_gen.h diff --git a/ext/src/UuidInterface.dep b/ext/src/UuidInterface.dep new file mode 100644 index 000000000..3887a38df --- /dev/null +++ b/ext/src/UuidInterface.dep @@ -0,0 +1,96 @@ +src/UuidInterface.lo: \ + /home/agabadounir/php-cassandra/ext/src/UuidInterface.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Value.dep b/ext/src/Value.dep new file mode 100644 index 000000000..530e638da --- /dev/null +++ b/ext/src/Value.dep @@ -0,0 +1,96 @@ +src/Value.lo: /home/agabadounir/php-cassandra/ext/src/Value.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/src/Varint.c b/ext/src/Varint.c index 1e6adba74..b3a99872d 100644 --- a/ext/src/Varint.c +++ b/ext/src/Varint.c @@ -110,6 +110,9 @@ PHP_METHOD(Varint, __construct) } /* }}} */ +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_tostring, 0, 0, IS_STRING, 0) +ZEND_END_ARG_INFO() + /* {{{ Varint::__toString() */ PHP_METHOD(Varint, __toString) { @@ -352,7 +355,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_driver_varint_methods[] = { PHP_ME(Varint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Varint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Varint, __toString, arginfo_tostring, ZEND_ACC_PUBLIC) PHP_ME(Varint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Varint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Varint, add, arginfo_num, ZEND_ACC_PUBLIC) @@ -370,14 +373,50 @@ static zend_function_entry php_driver_varint_methods[] = { static php_driver_value_handlers php_driver_varint_handlers; +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_varint_gc(zend_object *object, zval **table, int *n) +{ + *table = NULL; + *n = 0; + return zend_std_get_properties(object); +} +#else static HashTable * -php_driver_varint_gc(zval *object, php5to7_zval_gc table, int *n TSRMLS_DC) +php_driver_varint_gc(zval *object, zval **table, int *n) { *table = NULL; *n = 0; return zend_std_get_properties(object TSRMLS_CC); } +#endif + +#if PHP_VERSION_ID >= 80000 +static HashTable * +php_driver_varint_properties(zend_object *object) +{ + char *string; + int string_len; + zval type; + zval value; + zval obj_zval; + ZVAL_OBJ(&obj_zval, object); + + php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(&obj_zval); + HashTable *props = zend_std_get_properties(object); + php_driver_format_integer(self->data.varint.value, &string, &string_len); + + type = php_driver_type_scalar(CASS_VALUE_TYPE_VARINT); + zend_hash_str_update(props, "type", sizeof("type") - 1, &type); + + ZVAL_STRINGL(&value, string, string_len); + efree(string); + zend_hash_str_update(props, "value", sizeof("value") - 1, &value); + + return props; +} +#else static HashTable * php_driver_varint_properties(zval *object TSRMLS_DC) { @@ -387,7 +426,7 @@ php_driver_varint_properties(zval *object TSRMLS_DC) php5to7_zval value; php_driver_numeric *self = PHP_DRIVER_GET_NUMERIC(object); - HashTable *props = zend_std_get_properties(object TSRMLS_CC); + HashTable *props = zend_std_get_properties(object TSRMLS_CC); php_driver_format_integer(self->data.varint.value, &string, &string_len); @@ -401,7 +440,9 @@ php_driver_varint_properties(zval *object TSRMLS_DC) return props; } +#endif +#if PHP_VERSION_ID < 80000 static int php_driver_varint_compare(zval *obj1, zval *obj2 TSRMLS_DC) { @@ -416,6 +457,7 @@ php_driver_varint_compare(zval *obj1, zval *obj2 TSRMLS_DC) return mpz_cmp(varint1->data.varint.value, varint2->data.varint.value); } +#endif static unsigned php_driver_varint_hash_value(zval *obj TSRMLS_DC) @@ -443,6 +485,7 @@ php_driver_varint_cast(zval *object, zval *retval, int type TSRMLS_DC) return SUCCESS; } +#if PHP_VERSION_ID < 80000 static void php_driver_varint_free(php5to7_zend_object_free *object TSRMLS_DC) { @@ -450,9 +493,14 @@ php_driver_varint_free(php5to7_zend_object_free *object TSRMLS_DC) mpz_clear(self->data.varint.value); + #if PHP_VERSION_ID >= 80000 + zend_object_std_dtor(&self->std); +#else zend_object_std_dtor(&self->zval TSRMLS_CC); +#endif PHP5TO7_MAYBE_EFREE(self); } +#endif static php5to7_zend_object php_driver_varint_new(zend_class_entry *ce TSRMLS_DC) @@ -462,7 +510,17 @@ php_driver_varint_new(zend_class_entry *ce TSRMLS_DC) mpz_init(self->data.varint.value); - PHP5TO7_ZEND_OBJECT_INIT_EX(numeric, varint, self, ce); + #if PHP_VERSION_ID >= 80000 + zend_object_std_init(&self->std, ce); + object_properties_init(&self->std, ce); + self->std.handlers = &php_driver_varint_handlers.std; + return &self->std; +#else + zend_object_std_init(&self->zval, ce); + object_properties_init(&self->zval, ce); + self->zval.handlers = &php_driver_varint_handlers; + return &self->zval; +#endif } void php_driver_define_Varint(TSRMLS_D) @@ -480,9 +538,11 @@ void php_driver_define_Varint(TSRMLS_D) #if PHP_VERSION_ID >= 50400 php_driver_varint_handlers.std.get_gc = php_driver_varint_gc; #endif +#if PHP_VERSION_ID < 80000 php_driver_varint_handlers.std.compare_objects = php_driver_varint_compare; +#endif php_driver_varint_handlers.std.cast_object = php_driver_varint_cast; php_driver_varint_handlers.hash_value = php_driver_varint_hash_value; php_driver_varint_handlers.std.clone_obj = NULL; -} +} \ No newline at end of file diff --git a/ext/src/Varint.dep b/ext/src/Varint.dep new file mode 100644 index 000000000..9c73fe3f9 --- /dev/null +++ b/ext/src/Varint.dep @@ -0,0 +1,98 @@ +src/Varint.lo: /home/agabadounir/php-cassandra/ext/src/Varint.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/util/bytes.dep b/ext/util/bytes.dep new file mode 100644 index 000000000..3258e14d2 --- /dev/null +++ b/ext/util/bytes.dep @@ -0,0 +1,97 @@ +util/bytes.lo: /home/agabadounir/php-cassandra/ext/util/bytes.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + util/bytes.h diff --git a/ext/util/collections.dep b/ext/util/collections.dep new file mode 100644 index 000000000..85ecfa681 --- /dev/null +++ b/ext/util/collections.dep @@ -0,0 +1,99 @@ +util/collections.lo: \ + /home/agabadounir/php-cassandra/ext/util/collections.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/bytes.h util/collections.h util/hash.h \ + util/uthash.h util/math.h util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h diff --git a/ext/util/consistency.dep b/ext/util/consistency.dep new file mode 100644 index 000000000..a840f82bd --- /dev/null +++ b/ext/util/consistency.dep @@ -0,0 +1,96 @@ +util/consistency.lo: \ + /home/agabadounir/php-cassandra/ext/util/consistency.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h diff --git a/ext/util/future.dep b/ext/util/future.dep new file mode 100644 index 000000000..812ed2960 --- /dev/null +++ b/ext/util/future.dep @@ -0,0 +1,97 @@ +util/future.lo: /home/agabadounir/php-cassandra/ext/util/future.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h /home/agabadounir/php-cassandra/ext/util/future.h diff --git a/ext/util/hash.c b/ext/util/hash.c index 706c365af..927ec74a3 100644 --- a/ext/util/hash.c +++ b/ext/util/hash.c @@ -113,7 +113,10 @@ php_driver_value_compare(zval* zvalue1, zval* zvalue2 TSRMLS_DC) { case IS_STRING: return zend_binary_zval_strcmp(zvalue1, zvalue2); -#if PHP_MAJOR_VERSION >= 7 +#if PHP_VERSION_ID >= 80000 + case IS_OBJECT: + return Z_OBJ_P(zvalue1)->handlers->compare(zvalue1, zvalue2); +#elif PHP_MAJOR_VERSION >= 7 case IS_OBJECT: return Z_OBJ_P(zvalue1)->handlers->compare_objects(zvalue1, zvalue2 TSRMLS_CC); #else diff --git a/ext/util/hash.dep b/ext/util/hash.dep new file mode 100644 index 000000000..0cf33aa51 --- /dev/null +++ b/ext/util/hash.dep @@ -0,0 +1,97 @@ +util/hash.lo: /home/agabadounir/php-cassandra/ext/util/hash.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/hash.h util/uthash.h diff --git a/ext/util/inet.dep b/ext/util/inet.dep new file mode 100644 index 000000000..67539bf3a --- /dev/null +++ b/ext/util/inet.dep @@ -0,0 +1,97 @@ +util/inet.lo: /home/agabadounir/php-cassandra/ext/util/inet.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/inet.h diff --git a/ext/util/math.dep b/ext/util/math.dep new file mode 100644 index 000000000..2266ad2e8 --- /dev/null +++ b/ext/util/math.dep @@ -0,0 +1,97 @@ +util/math.lo: /home/agabadounir/php-cassandra/ext/util/math.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/math.h diff --git a/ext/util/ref.dep b/ext/util/ref.dep new file mode 100644 index 000000000..cfc3dda0b --- /dev/null +++ b/ext/util/ref.dep @@ -0,0 +1,96 @@ +util/ref.lo: /home/agabadounir/php-cassandra/ext/util/ref.c php_driver.h \ + config.h /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h util/math.h diff --git a/ext/util/result.dep b/ext/util/result.dep new file mode 100644 index 000000000..220a86d7f --- /dev/null +++ b/ext/util/result.dep @@ -0,0 +1,102 @@ +util/result.lo: /home/agabadounir/php-cassandra/ext/util/result.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_types.h /home/agabadounir/php-cassandra/ext/util/result.h \ + /home/agabadounir/php-cassandra/ext/util/math.h \ + /home/agabadounir/php-cassandra/ext/util/collections.h \ + /home/agabadounir/php-cassandra/ext/util/types.h \ + /usr/include/php/20230831/Zend/zend_smart_str.h src/Collection.h \ + src/Map.h src/Set.h src/Tuple.h src/UserTypeValue.h diff --git a/ext/util/types.c b/ext/util/types.c index bef2fa290..e7c4e1fd0 100644 --- a/ext/util/types.c +++ b/ext/util/types.c @@ -519,6 +519,22 @@ php_driver_type_string(php_driver_type *type, smart_str *string TSRMLS_DC) } } +#if PHP_VERSION_ID >= 80000 +static php5to7_zval +php_driver_type_scalar_new(CassValueType type) +{ + php5to7_zval ztype; + php_driver_type *scalar; + + PHP5TO7_ZVAL_MAYBE_MAKE(ztype); + object_init_ex(PHP5TO7_ZVAL_MAYBE_P(ztype), php_driver_type_scalar_ce); + scalar = PHP_DRIVER_GET_TYPE(PHP5TO7_ZVAL_MAYBE_P(ztype)); + scalar->type = type; + scalar->data_type = cass_data_type_new(type); + + return ztype; +} +#else static php5to7_zval php_driver_type_scalar_new(CassValueType type TSRMLS_DC) { @@ -533,6 +549,7 @@ php_driver_type_scalar_new(CassValueType type TSRMLS_DC) return ztype; } +#endif const char * @@ -634,6 +651,29 @@ php_driver_scalar_init(INTERNAL_FUNCTION_PARAMETERS) #define TYPE_CODE(m) type_ ## m +#if PHP_VERSION_ID >= 80000 +php5to7_zval +php_driver_type_scalar(CassValueType type) +{ + php5to7_zval result; + PHP5TO7_ZVAL_UNDEF(result); + +#define XX_SCALAR(name, value) \ + if (value == type) { \ + if (PHP5TO7_ZVAL_IS_UNDEF(PHP_DRIVER_G(TYPE_CODE(name)))) { \ + PHP_DRIVER_G(TYPE_CODE(name)) = php_driver_type_scalar_new(type); \ + } \ + Z_ADDREF_P(PHP5TO7_ZVAL_MAYBE_P(PHP_DRIVER_G(TYPE_CODE(name)))); \ + return PHP_DRIVER_G(TYPE_CODE(name)); \ + } + PHP_DRIVER_SCALAR_TYPES_MAP(XX_SCALAR) +#undef XX_SCALAR + + zend_throw_exception_ex(php_driver_invalid_argument_exception_ce, + 0, "Invalid type"); + return result; +} +#else php5to7_zval php_driver_type_scalar(CassValueType type TSRMLS_DC) { @@ -655,6 +695,8 @@ php_driver_type_scalar(CassValueType type TSRMLS_DC) 0 TSRMLS_CC, "Invalid type"); return result; } +#endif + #undef TYPE_CODE php5to7_zval diff --git a/ext/util/types.dep b/ext/util/types.dep new file mode 100644 index 000000000..ddb23e4cb --- /dev/null +++ b/ext/util/types.dep @@ -0,0 +1,104 @@ +util/types.lo: /home/agabadounir/php-cassandra/ext/util/types.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h php_driver_types.h \ + util/types.h /usr/include/php/20230831/Zend/zend_smart_str.h \ + src/Bigint.h src/Smallint.h src/Tinyint.h src/Blob.h src/Decimal.h \ + src/Duration.h src/Float.h src/Inet.h src/Timestamp.h src/Date.h \ + src/Time.h src/Timeuuid.h src/Uuid.h src/Varint.h src/Type/Tuple.h \ + src/Type/UserType.h diff --git a/ext/util/uuid_gen.dep b/ext/util/uuid_gen.dep new file mode 100644 index 000000000..e23fbb025 --- /dev/null +++ b/ext/util/uuid_gen.dep @@ -0,0 +1,99 @@ +util/uuid_gen.lo: /home/agabadounir/php-cassandra/ext/util/uuid_gen.c \ + php_driver.h config.h \ + /tmp/php-driver-installation/build/include/cassandra.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_version.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/Zend/zend_portability.h \ + /usr/include/php/20230831/Zend/zend_config.h \ + /usr/include/php/20230831/main/../main/php_config.h \ + /usr/include/php/20230831/Zend/../TSRM/TSRM.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_range_check.h \ + /usr/include/php/20230831/Zend/zend_long.h \ + /usr/include/php/20230831/Zend/zend_map_ptr.h \ + /usr/include/php/20230831/Zend/zend_errors.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend.h \ + /usr/include/php/20230831/Zend/zend_alloc_sizes.h \ + /usr/include/php/20230831/Zend/zend_llist.h \ + /usr/include/php/20230831/Zend/zend_string.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/Zend/zend_ast.h \ + /usr/include/php/20230831/Zend/zend_gc.h \ + /usr/include/php/20230831/Zend/zend_hrtime.h \ + /usr/include/php/20230831/Zend/zend_variables.h \ + /usr/include/php/20230831/Zend/zend_iterators.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/Zend/zend_signal.h \ + /usr/include/php/20230831/Zend/zend_max_execution_timer.h \ + /usr/include/php/20230831/Zend/zend_object_handlers.h \ + /usr/include/php/20230831/Zend/zend_operators.h \ + /usr/include/php/20230831/Zend/zend_strtod.h \ + /usr/include/php/20230831/Zend/zend_multiply.h \ + /usr/include/php/20230831/Zend/zend_sort.h \ + /usr/include/php/20230831/main/php_compat.h \ + /usr/include/php/20230831/main/php_config.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_modules.h \ + /usr/include/php/20230831/Zend/zend_compile.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/Zend/zend_globals_macros.h \ + /usr/include/php/20230831/Zend/zend_atomic.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/Zend/zend_ptr_stack.h \ + /usr/include/php/20230831/Zend/zend_objects.h \ + /usr/include/php/20230831/Zend/zend_objects_API.h \ + /usr/include/php/20230831/Zend/zend_float.h \ + /usr/include/php/20230831/Zend/zend_multibyte.h \ + /usr/include/php/20230831/Zend/zend_arena.h \ + /usr/include/php/20230831/Zend/zend_call_stack.h \ + /usr/include/php/20230831/Zend/zend_vm_opcodes.h \ + /usr/include/php/20230831/Zend/zend_build.h \ + /usr/include/php/20230831/Zend/zend_list.h \ + /usr/include/php/20230831/Zend/zend_execute.h \ + /usr/include/php/20230831/Zend/zend_type_info.h \ + /usr/include/php/20230831/main/build-defs.h \ + /usr/include/php/20230831/Zend/zend_hash.h \ + /usr/include/php/20230831/Zend/zend_alloc.h \ + /usr/include/php/20230831/Zend/zend_stack.h \ + /usr/include/php/20230831/main/snprintf.h \ + /usr/include/php/20230831/main/spprintf.h \ + /usr/include/php/20230831/Zend/zend_smart_str_public.h \ + /usr/include/php/20230831/Zend/zend_smart_string_public.h \ + /usr/include/php/20230831/main/php_syslog.h \ + /usr/include/php/20230831/main/php.h \ + /usr/include/php/20230831/main/php_output.h \ + /usr/include/php/20230831/main/php_streams.h \ + /usr/include/php/20230831/Zend/zend_stream.h \ + /usr/include/php/20230831/main/streams/php_stream_context.h \ + /usr/include/php/20230831/main/streams/php_stream_filter_api.h \ + /usr/include/php/20230831/main/streams/php_stream_transport.h \ + /usr/include/php/20230831/main/streams/php_stream_plain_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_glob_wrapper.h \ + /usr/include/php/20230831/main/streams/php_stream_userspace.h \ + /usr/include/php/20230831/main/streams/php_stream_mmap.h \ + /usr/include/php/20230831/main/php_memory_streams.h \ + /usr/include/php/20230831/main/fopen_wrappers.h \ + /usr/include/php/20230831/main/php_globals.h \ + /usr/include/php/20230831/Zend/zend_globals.h \ + /usr/include/php/20230831/main/php_ini.h \ + /usr/include/php/20230831/Zend/zend_ini.h \ + /usr/include/php/20230831/Zend/zend_virtual_cwd.h \ + /usr/include/php/20230831/TSRM/TSRM.h \ + /usr/include/php/20230831/Zend/zend_constants.h \ + /usr/include/php/20230831/main/php_reentrancy.h \ + /usr/include/php/20230831/Zend/zend_exceptions.h \ + /usr/include/php/20230831/Zend/zend_interfaces.h \ + /usr/include/php/20230831/Zend/zend_API.h \ + /usr/include/php/20230831/Zend/zend_types.h \ + /usr/include/php/20230831/ext/spl/spl_iterators.h \ + /usr/include/php/20230831/ext/spl/php_spl.h \ + /usr/include/php/20230831/ext/spl/spl_exceptions.h version.h \ + php_driver_globals.h \ + /usr/include/php/20230831/ext/standard/php_smart_string.h \ + /usr/include/php/20230831/Zend/zend_smart_string.h util/uuid_gen.h diff --git a/install_php_cassandra.sh b/install_php_cassandra.sh new file mode 100644 index 000000000..a69280c7c --- /dev/null +++ b/install_php_cassandra.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +# 🚀 Script d'installation de l'extension PHP Cassandra (build statique) +# Compatible Ubuntu + PHP 8.3 (amd64) + +# 1. Vérification des dépendances système +echo "[1/5] Installation des dépendances système..." +sudo apt-get update +sudo apt-get install -y libuv1 libssl3 zlib1g libstdc++6 libgmp10 + +# 2. Détection du dossier des extensions PHP +echo "[2/5] Détection du dossier d'extensions PHP..." +EXT_DIR=$(php -i | grep ^extension_dir | awk '{print $3}') +echo "Extension_dir détecté : $EXT_DIR" + +# 3. Copie du module cassandra.so +echo "[3/5] Copie de cassandra.so dans $EXT_DIR..." +sudo cp cassandra.so $EXT_DIR/ + +# 4. Création du fichier de configuration et activation +echo "[4/5] Activation de l'extension..." +echo "extension=cassandra.so" | sudo tee /etc/php/8.3/mods-available/cassandra.ini > /dev/null +sudo phpenmod cassandra + +# 5. Redémarrage de PHP / Apache +echo "[5/5] Redémarrage des services PHP..." +if systemctl is-active --quiet apache2; then + sudo systemctl restart apache2 +fi + +if systemctl is-active --quiet php8.3-fpm; then + sudo systemctl restart php8.3-fpm +fi + +echo "✅ Installation terminée ! Vérifiez avec : php -m | grep cassandra" diff --git a/scripts/install-binary.ps1 b/scripts/install-binary.ps1 new file mode 100644 index 000000000..fcf989d0f --- /dev/null +++ b/scripts/install-binary.ps1 @@ -0,0 +1,67 @@ +# Requires: PowerShell 5+, PHP installed and on PATH +# Installer for prebuilt php-cassandra extension (Windows) +# Expects release asset naming scheme like: +# php_cassandra-windows--php-.dll +# Examples: +# php_cassandra-windows-x86_64-php83-nts.dll +# php_cassandra-windows-x86_64-php83-ts.dll + +param( + [string]$Php = "php", + [string]$Repo = "maximeetundi/php-cassandra-driver" +) + +$ErrorActionPreference = 'Stop' + +function Get-PHP-Info { + param([string]$Php) + $extensionDir = & $Php -r "echo ini_get('extension_dir');" + $iniFile = & $Php -r "$f=php_ini_loaded_file(); echo $f?$f:'';" + $majMin = & $Php -r "printf('%d%d', PHP_MAJOR_VERSION, PHP_MINOR_VERSION);" + $zts = & $Php -r "echo ZEND_THREAD_SAFE?'ts':'nts';" + $arch = (Get-CimInstance Win32_OperatingSystem).OSArchitecture + if ($arch -like '*64*') { $arch = 'x86_64' } else { $arch = 'x86' } + return [pscustomobject]@{ + ExtensionDir = $extensionDir + IniFile = $iniFile + MajMin = $majMin + Zts = $zts + Arch = $arch + } +} + +$info = Get-PHP-Info -Php $Php +if (-not $info.ExtensionDir) { throw "extension_dir introuvable (php.ini)." } + +$asset = "php_cassandra-windows-$($info.Arch)-php$($info.MajMin)-$($info.Zts).dll" +$uri = "https://github.com/$Repo/releases/latest/download/$asset" + +Write-Host "[INFO] Téléchargement: $uri" +$temp = New-TemporaryFile +try { + Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile $temp +} catch { + throw "Échec du téléchargement de $asset depuis $uri. Assurez-vous que le binaire existe dans les Releases." +} + +$dest = Join-Path $info.ExtensionDir 'php_cassandra.dll' +New-Item -ItemType Directory -Force -Path $info.ExtensionDir | Out-Null +Copy-Item $temp $dest -Force +Remove-Item $temp -Force +Write-Host "[INFO] Copié dans: $dest" + +if (-not $info.IniFile -or -not (Test-Path $info.IniFile)) { + Write-Warning "php.ini introuvable. Ajoutez manuellement: extension=php_cassandra.dll" + exit 0 +} + +$content = Get-Content -Raw $info.IniFile +if ($content -match '(?im)^\s*extension\s*=\s*php_cassandra\.dll\s*$') { + Write-Host "[INFO] Entrée déjà présente dans $($info.IniFile)" +} else { + Add-Content -Path $info.IniFile -Value "`nextension=php_cassandra.dll`n" + Write-Host "[INFO] Ajouté extension=php_cassandra.dll dans $($info.IniFile)" +} + +Write-Host "[DONE] Validation:" +& $Php -m | Select-String -Pattern '(?i)cassandra' | ForEach-Object { $_.Line } | Write-Host diff --git a/scripts/install-binary.sh b/scripts/install-binary.sh new file mode 100644 index 000000000..aa55ad367 --- /dev/null +++ b/scripts/install-binary.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Installer for prebuilt php-cassandra extension (Linux/macOS) +# Requires prebuilt binaries published on GitHub Releases with naming scheme: +# cassandra-${OS}-${ARCH}-php${PHPVER}-${TS}.so +# Example: cassandra-linux-x86_64-php83-nts.so + +REPO="maximeetundi/php-cassandra-driver" +API_BASE="https://github.com/${REPO}/releases/latest/download" + +php_bin=${PHP_BIN:-php} +ext_dir=$($php_bin -r 'echo ini_get("extension_dir");') +php_ini=$($php_bin -r '$f=php_ini_loaded_file(); echo $f?$f:"";') +php_api=$($php_bin -r 'echo PHP_VERSION_ID;') +php_zts=$($php_bin -r 'echo ZEND_THREAD_SAFE?"ts":"nts";') +php_major_minor=$($php_bin -r 'printf("%d%d", PHP_MAJOR_VERSION, PHP_MINOR_VERSION);') + +if [[ -z "$php_ini" ]]; then + echo "[INFO] Aucun php.ini chargé. J'essaie d'utiliser php --ini pour le localiser..." + php_ini=$($php_bin --ini | awk '/Loaded Configuration File/ {print $NF}') || true +fi + +os=$(uname -s | tr '[:upper:]' '[:lower:]') +arch=$(uname -m) +case "$arch" in + x86_64|amd64) arch=x86_64;; + aarch64|arm64) arch=arm64;; + *) echo "Architecture non supportée: $arch"; exit 1;; + esac + +case "$os" in + linux) ext_name="cassandra-linux-${arch}-php${php_major_minor}-${php_zts}.so";; + darwin) ext_name="cassandra-macos-${arch}-php${php_major_minor}-${php_zts}.so";; + *) echo "OS non supporté: $os"; exit 1;; + esac + +url="${API_BASE}/${ext_name}" + +echo "[INFO] Téléchargement: $url" +tmpfile=$(mktemp) +if command -v curl >/dev/null 2>&1; then + curl -fsSL "$url" -o "$tmpfile" +elif command -v wget >/dev/null 2>&1; then + wget -q "$url" -O "$tmpfile" +else + echo "curl ou wget requis"; exit 1 +fi + +sudo mkdir -p "$ext_dir" +sudo install -m 0644 "$tmpfile" "$ext_dir/cassandra.so" +rm -f "$tmpfile" + +echo "[INFO] Extension installée dans: $ext_dir/cassandra.so" + +if [[ -z "$php_ini" || ! -f "$php_ini" ]]; then + echo "[WARN] php.ini introuvable. Ajoutez manuellement: extension=cassandra.so" + exit 0 +fi + +if grep -qi '^\s*extension\s*=\s*cassandra\.so' "$php_ini"; then + echo "[INFO] Entrée déjà présente dans $php_ini" +else + echo "[INFO] Ajout de extension=cassandra.so dans $php_ini" + printf "\nextension=cassandra.so\n" | sudo tee -a "$php_ini" >/dev/null +fi + +echo "[DONE] php -m | grep cassandra" +$php_bin -m | grep -i cassandra || true diff --git a/support/ssl/regenerate-keys.sh b/support/ssl/regenerate-keys.sh old mode 100755 new mode 100644 diff --git a/test_cassandra.php b/test_cassandra.php new file mode 100644 index 000000000..15dc5b178 --- /dev/null +++ b/test_cassandra.php @@ -0,0 +1,79 @@ +withClientCert($certPath); + $sslBuilder->withPrivateKey($keyPath); + // Facultatif: si vous avez un certificat CA séparé, utilisez ->withTrustedCerts($caPath) + $ssl = $sslBuilder->build(); + + // 5) Construction du cluster + $clusterBuilder = new Cassandra\Cluster\Builder(); + $clusterBuilder->withContactPoints($host); + $clusterBuilder->withPort($port); + $clusterBuilder->withSSL($ssl); + if ($username !== '' && $password !== '') { + $clusterBuilder->withCredentials($username, $password); + } + $cluster = $clusterBuilder->build(); + + echo "Connexion au cluster...\n"; + + // Tenter d'établir une session + $session = $cluster->connect(); + echo "Connexion établie avec succès!\n"; + + // Exécuter une requête simple pour tester + $statement = new Cassandra\SimpleStatement('SELECT release_version FROM system.local'); + $result = $session->execute($statement); + $row = $result->first(); + if ($row && isset($row['release_version'])) { + printf("Version de Cassandra: %s\n", (string) $row['release_version']); + } else { + echo "Aucune version retournée par system.local.\n"; + } + +} catch (Throwable $e) { + fwrite(STDERR, "Erreur lors de la connexion: " . $e->getMessage() . "\n"); + if (method_exists($e, 'getTraceAsString')) { + fwrite(STDERR, $e->getTraceAsString() . "\n"); + } +} finally { + // Fermer proprement la session pour éviter un segfault à la fin du script + if ($session !== null && method_exists($session, 'close')) { + try { $session->close(); } catch (Throwable $t) { /* ignore */ } + } +} +?> \ No newline at end of file