Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

travis build fix and support up to php 8 #201

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cd6b059
travis ci: add php 7.1, 7.2, 7.3, 7.4 and 8.0
zebastian Feb 4, 2021
42fd4f1
Update .travis.yml
zebastian Feb 5, 2021
c371ad3
phing update
zebastian Feb 6, 2021
d303583
Update .travis.yml
zebastian Feb 6, 2021
baaa354
Update composer.json
zebastian Feb 6, 2021
13e3836
Update composer.json
zebastian Feb 6, 2021
f85389e
Update php.ini
zebastian Feb 6, 2021
66a70b3
Update .travis.yml
zebastian Feb 6, 2021
8fb1465
Update composer.json
zebastian Feb 6, 2021
f49f699
Update composer.json
zebastian Feb 6, 2021
f79ebfb
Update composer.json
zebastian Feb 6, 2021
c7e5ad0
Update composer.json
zebastian Feb 6, 2021
07f9b10
Update .travis.yml
zebastian Feb 6, 2021
21e4739
Update composer.json
zebastian Feb 6, 2021
15626b6
Update composer.json
zebastian Feb 6, 2021
796747e
Update .travis.yml
zebastian Feb 6, 2021
9595f75
Update composer.json
zebastian Feb 6, 2021
617f910
Update composer.json
zebastian Feb 6, 2021
b5df186
Update composer.json
zebastian Feb 6, 2021
e5c9aef
Update composer.json
zebastian Feb 6, 2021
2290f26
Update composer.json
zebastian Feb 6, 2021
c8be6e5
Update composer.json
zebastian Feb 6, 2021
6584473
Update .travis.yml
zebastian Feb 6, 2021
5c455ec
test polyfill
zebastian Feb 7, 2021
1e88310
solve merge
zebastian Feb 7, 2021
a124185
travis reenable php8
zebastian Feb 7, 2021
4a630e7
test polyfill
zebastian Feb 7, 2021
9e7fd4f
test
zebastian Feb 7, 2021
6a34a18
test
zebastian Feb 7, 2021
ae6dfd6
test
zebastian Feb 7, 2021
87b8595
test
zebastian Feb 7, 2021
e4759b8
test
zebastian Feb 7, 2021
7b46a2a
test
zebastian Feb 7, 2021
6111e1e
test
zebastian Feb 7, 2021
0ca694a
test
zebastian Feb 7, 2021
403e2bd
test
zebastian Feb 7, 2021
40f85a9
test
zebastian Feb 7, 2021
6963e85
test
zebastian Feb 7, 2021
64bdbe5
test
zebastian Feb 7, 2021
022f078
Update .travis.yml
zebastian Feb 8, 2021
9a27ebe
Update .travis.yml
zebastian Feb 8, 2021
4947601
Update .travis.yml
zebastian Feb 8, 2021
477efea
Create compatibility-php8.sh
zebastian Feb 8, 2021
be057ad
Update compatibility-php8.sh
zebastian Feb 8, 2021
5e2147b
Update compatibility-php8.sh
zebastian Feb 8, 2021
2e3fd1a
Update compatibility-php8.sh
zebastian Feb 8, 2021
0d2fbda
test
zebastian Feb 10, 2021
1aa3122
test
zebastian Feb 10, 2021
d87c54a
Update compatibility-php8.sh
zebastian Feb 10, 2021
ac044b6
Update README.md
zebastian Feb 10, 2021
28b584e
Update Test_Client.php
zebastian Feb 10, 2021
87d2c29
Update Test_Client.php
zebastian Feb 10, 2021
0865756
Update compatibility-php8.sh
zebastian Feb 10, 2021
c305c25
Update Test_Client.php
zebastian Feb 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
language: php
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'

jobs:
include:
- php: 5.4
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
dist: xenial
- php: 7.0
dist: xenial
- php: 7.1
dist: xenial
- php: 7.2
dist: xenial
- php: 7.3
dist: xenial
- php: 7.4
dist: xenial
- php: 8.0
dist: focal

before_script:
- phpenv config-add test/resources/php.ini

install:
- composer install
- composer install || composer install --ignore-platform-reqs
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "8" ]]; then sh test/resources/compatibility-php8.sh; fi

script:
- vendor/bin/phing travis
Expand All @@ -20,4 +37,4 @@ after_script:

addons:
code_climate:
repo_token: 5d81d5163c7f9b810b46451042cb0069d24c91a5887466ba774bf89a56f0187e
repo_token: 5d81d5163c7f9b810b46451042cb0069d24c91a5887466ba774bf89a56f0187e
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

# Introduction

PAMI means PHP Asterisk Manager Interface. As its name suggests its just a
PAMI means PHP Asterisk Manager Interface. As its name suggests its a
set of php classes that will let you issue commands to an ami and/or receive
events, using an observer-listener pattern.

The idea behind this, is to easily implement operator consoles, monitors, etc.
either via SOA or ajax.
The idea behind this, is to easily implement operator consoles, monitors,
real time telephone applications, etc. either via SOA or ajax.

A port for nodejs is available at: http://marcelog.github.com/Nami
A port for erlang is available at: https://github.com/marcelog/erlami
Expand All @@ -28,17 +28,24 @@ A port for erlang is available at: https://github.com/marcelog/erlami

# PHP Versions

## PHP 5
Note: PAMI Requires PHP 5.3+. PHP versions 5.3.9 and 5.3.10 WILL NOT WORK due
to a bug introduced in stream_get_line() in 5.3.9. Please use 5.3.11+ or up
to 5.3.8 (see README.PHP-5.3.9-and-5.3.10).
Also running on 5.4 and 5.5.

## PHP 7
PHP Versions 7.0, 7.1, 7.2, 7.3 and 7.4 are also confirmed working with
the latest version.

## PHP 8
This version is also supported.

# Installing
Add this library to your [Composer](https://packagist.org/) configuration. In
composer.json:
```json
"require": {
"marcelog/pami": "2.*"
}
```sh
composer require marcelog/pami
```

# QuickStart
Expand Down Expand Up @@ -97,7 +104,8 @@ Also, you might want to look at this article: http://marcelog.github.com/article

For an example of using asynchronous AGI with PAMI, see docs/examples/asyncagi

The [march edition](http://sdjournal.org/a-practical-introduction-to-functional-programming-with-php-sdj-issue-released/) of [Software Developer Journal](http://sdjournal.org/) features a complete article about writing telephony applications with PAMI and PAGI.
The [2014 march edition](http://web.archive.org/web/20140625083045/http://sdjournal.org/a-practical-introduction-to-functional-programming-with-php-sdj-issue-released/)
of [Software Developer Journal](http://sdjournal.org/) features a complete article about writing telephony applications with PAMI and PAGI.

# Currently Supported Events

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"psr/log": ">= 1.0.0"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"phpunit/phpunit": "4.8.36",
"monolog/monolog": "1.*",
"squizlabs/php_codesniffer": "2.*",
"squizlabs/php_codesniffer": "2.*|3.*",
"phpdocumentor/phpdocumentor": "2.*",
"phing/phing": "2.*",
"phing/phing": "2.16.3",
"phpmd/phpmd": "2.*",
"satooshi/php-coveralls": "1.0.1",
"evert/phpdoc-md" : "~0.1.1",
"codeclimate/php-test-reporter": "dev-master",
"sebastian/phpcpd": "*",
"sebastian/phpcpd": "2.0.4",
"marcelog/pagi": "2.*"
}
}
2 changes: 1 addition & 1 deletion test/actions/Test_Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @license http://marcelog.github.com/ Apache License 2.0
* @link http://marcelog.github.com/
*/
class Test_Actions extends \PHPUnit_Framework_TestCase
class Test_Actions extends \PHPUnit\Framework\TestCase
{
private $_properties = array();

Expand Down
4 changes: 2 additions & 2 deletions test/client/Test_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function setFgetsMock(array $readValues, $writeValues)
* @license http://marcelog.github.com/ Apache License 2.0
* @link http://marcelog.github.com/
*/
class Test_Client extends \PHPUnit_Framework_TestCase
class Test_Client extends \PHPUnit\Framework\TestCase
{
private $_properties = array();

Expand Down Expand Up @@ -256,7 +256,7 @@ public function can_detect_other_peer()
'connect_timeout' => 10,
'read_timeout' => 10
);
$read = array('Whatever');
$read = array("Whatever");
$write = array();
setFgetsMock($read, $write);
$client = new \PAMI\Client\Impl\ClientImpl($options);
Expand Down
2 changes: 1 addition & 1 deletion test/events/Test_Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @license http://marcelog.github.com/ Apache License 2.0
* @link http://marcelog.github.com/
*/
class Test_Events extends \PHPUnit_Framework_TestCase
class Test_Events extends \PHPUnit\Framework\TestCase
{
private $_properties = array();

Expand Down
18 changes: 18 additions & 0 deletions test/resources/compatibility-php8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

#!/bin/sh

# require new version of phpunit and phpcpd, as the old ones are incompatible with php8
# (note: cannot generally require the new ones as these are not compatible with php 5)
composer require phpunit/phpunit:8.* sebastian/phpcpd:* --ignore-platform-reqs --with-all-dependencies

# disable cpd for now, as newer version fails with duplicated code
sed -i 's/, cpd//g' build.xml

# phpunit compatiblity of new versions (requires return type declaration)
sed -i 's/function setUp()/function setUp() : void/g' test/*/*.php

# phpunit xml compatiblity, delete deprecated flag
sed -i 's/mapTestClassNameToCoveredClassName="false"//g' test/resources/phpunit.xml

# phpunit disable stop on risky, as risky test functions are being used
sed -i 's/stopOnRisky="true"//g' test/resources/phpunit.xml
3 changes: 2 additions & 1 deletion test/resources/php.ini
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
date.timezone = "UTC"
date.timezone = "UTC"
xdebug.mode = "coverage"