Skip to content

Commit

Permalink
Added support for PHP 8 (Thanks to Tankonyako) and config.w32 for Win…
Browse files Browse the repository at this point in the history
…dows platform.
  • Loading branch information
Allyans3 committed Jun 14, 2023
1 parent 1744f2e commit 6d7eb2d
Show file tree
Hide file tree
Showing 23 changed files with 2,235 additions and 36 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## About Protobuf Steam Auth

This package provides the ability to authorize to the Steam using Google Protobuf.
This package provides the ability to authorize to the Steam using Google Protobuf. Support PHP 7+ and PHP 8+.

## Installation

Expand All @@ -27,10 +27,12 @@ composer require allyans3/protobuf-steam-auth
cp -a /vendor/allyans3/protobuf-steam-auth/protobuf-ext .
```

3. Build php extension with next commands:
3. Build php extension with next commands choosing between `php 7` and `php 8` (Thanks to [Tankonyako](https://github.com/Tankonyako)):

```
cd protobuf-ext
cd protobuf-ext/php7 // For PHP 7
cd protobuf-ext/php8 // For PHP 8
phpize
./configure
make
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
}
],
"require": {
"allegro/php-protobuf": "^0.12.4",
"php-curl-class/php-curl-class": ">=8.10.0",
"doctormckay/steam-totp": "^1.0"
"allegro/php-protobuf": "^0.12.4",
"ramsey/uuid": "^4.2",
"tankonyako/php-steam-totp": "dev-master"
},
"autoload": {
"psr-4": {
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions protobuf-ext/php7/config.w32
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG_ENABLE("protobuf", "whether to enable protobuf support", "no");

if (PHP_PROTOBUF != "no") {
EXTENSION("protobuf", "protobuf.c reader.c writer.c");
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions protobuf-ext/php8/config.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dnl $Id$
dnl config.m4 for extension protobuf

PHP_ARG_ENABLE(protobuf, whether to enable protobuf support,
[ --enable-protobuf enable protobuf support])

if test "$PHP_PROTOBUF" != "no"; then
PHP_NEW_EXTENSION(protobuf, protobuf.c reader.c writer.c, $ext_shared)
fi

PHP_C_BIGENDIAN()
5 changes: 5 additions & 0 deletions protobuf-ext/php8/config.w32
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG_ENABLE("protobuf", "whether to enable protobuf support", "no");

if (PHP_PROTOBUF != "no") {
EXTENSION("protobuf", "protobuf.c reader.c writer.c");
}
13 changes: 13 additions & 0 deletions protobuf-ext/php8/php_protobuf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef PROTOBUF_PHP_PHP_PROTOBUF_H
#define PROTOBUF_PHP_PHP_PROTOBUF_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#define PHP_PROTOBUF_VERSION "0.12.3"
#define PHP_PROTOBUF_EXTNAME "protobuf"

extern zend_module_entry protobuf_module_entry;

#endif /* PROTOBUF_PHP_PHP_PROTOBUF_H */
Loading

0 comments on commit 6d7eb2d

Please sign in to comment.