Skip to content

Commit 2acbffe

Browse files
authored
Merge pull request #1 from maksimovic/php7-8
PHP 7.2 -> 8.1 compatibility
2 parents 4af8f61 + d81942d commit 2acbffe

50 files changed

Lines changed: 765 additions & 737 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build-test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
12+
name: PHP ${{ matrix.php-versions }} Test
13+
services:
14+
redis:
15+
image: redis
16+
options: >-
17+
--health-cmd "redis-cli ping"
18+
--health-interval 10s
19+
--health-timeout 5s
20+
--health-retries 5
21+
ports:
22+
- 6379:6379
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v3
26+
27+
- name: Install PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php-versions }}
31+
extensions: :redis
32+
33+
- name: Install composer and dependencies
34+
uses: php-actions/composer@v6
35+
36+
- name: PHPUnit Tests
37+
uses: php-actions/phpunit@v3
38+
env:
39+
XDEBUG_MODE: coverage
40+
with:
41+
bootstrap: vendor/autoload.php
42+
configuration: phpunit.xml
43+
php_extensions: xdebug sysvshm pcntl sysvsem sysvmsg redis
44+
version: 9
45+
args: tests --coverage-clover ./coverage.xml
46+
47+
- name: Upload to Codecov
48+
uses: codecov/codecov-action@v3
49+
env:
50+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51+
with:
52+
files: ./coverage.xml
53+
verbose: true

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
.idea/
22
vendor/
3-
composer.lock
3+
composer.lock
4+
.phpunit.result.cache
5+
build/
6+
dump.rdb
7+
.DS_Store

.phan/config.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
use Phan\Issue;
4+
5+
return [
6+
7+
'target_php_version' => null,
8+
'allow_missing_properties' => false,
9+
'null_casts_as_any_type' => true,
10+
'null_casts_as_array' => true,
11+
'array_casts_as_null' => true,
12+
'scalar_implicit_cast' => true,
13+
'scalar_array_key_cast' => true,
14+
'scalar_implicit_partial' => [],
15+
'strict_method_checking' => false,
16+
'strict_object_checking' => false,
17+
'strict_param_checking' => false,
18+
'strict_property_checking' => false,
19+
'strict_return_checking' => false,
20+
'ignore_undeclared_variables_in_global_scope' => false,
21+
'ignore_undeclared_functions_with_known_signatures' => true,
22+
'backward_compatibility_checks' => true, // this is valid for 5.6 -> 7 only
23+
'check_docblock_signature_return_type_match' => true,
24+
'phpdoc_type_mapping' => [],
25+
'dead_code_detection' => false,
26+
'unused_variable_detection' => false,
27+
'redundant_condition_detection' => false,
28+
'assume_real_types_for_internal_functions' => false,
29+
'quick_mode' => false,
30+
'globals_type_map' => [],
31+
'minimum_severity' => Issue::SEVERITY_LOW,
32+
'suppress_issue_types' => [
33+
],
34+
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/|^tests/@',
35+
'exclude_file_list' => [],
36+
'exclude_analysis_directory_list' => [
37+
'vendor/',
38+
],
39+
'enable_include_path_checks' => false,
40+
'processes' => 1,
41+
'analyzed_file_extensions' => [
42+
'php',
43+
],
44+
'autoload_internal_extension_signatures' => [],
45+
'plugins' => [],
46+
'directory_list' => [
47+
'src',
48+
'vendor',
49+
],
50+
'whitelist_issue_types' => [],
51+
'file_list' => [],
52+
];

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.ZH.MD

Lines changed: 0 additions & 128 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
SimpleFork
22
===================
33

4-
[![Join the chat at https://gitter.im/huyanping/simple-fork-php](https://badges.gitter.im/huyanping/simple-fork-php.svg)](https://gitter.im/huyanping/simple-fork-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5-
[![Latest Stable Version](https://poser.pugx.org/jenner/simple_fork/v/stable)](https://packagist.org/packages/jenner/simple_fork)
6-
[![Total Downloads](https://poser.pugx.org/jenner/simple_fork/downloads)](https://packagist.org/packages/jenner/simple_fork)
7-
[![Latest Unstable Version](https://poser.pugx.org/jenner/simple_fork/v/unstable)](https://packagist.org/packages/jenner/simple_fork)
8-
[![License](https://poser.pugx.org/jenner/simple_fork/license)](https://packagist.org/packages/jenner/simple_fork)
9-
[![travis](https://travis-ci.org/huyanping/simple-fork-php.svg)](https://travis-ci.org/huyanping/simple-fork-php)
10-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/huyanping/simple-fork-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/huyanping/simple-fork-php/?branch=master)
11-
[![Code Coverage](https://scrutinizer-ci.com/g/huyanping/simple-fork-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/huyanping/simple-fork-php/?branch=master)
12-
13-
[中文README.MD](https://github.com/huyanping/simple-fork-php/blob/master/README.ZH.MD)
4+
This is a fork of `jenner/simple_fork` compatible with PHP 7.2/3/4/ and 8.0/1/2
5+
6+
[![codecov](https://codecov.io/github/maksimovic/simple-fork-php/graph/badge.svg?token=9kZkI3EaGv)](https://codecov.io/github/maksimovic/simple-fork-php)
7+
![build status](https://github.com/maksimovic/simple-fork-php/actions/workflows/ci.yml/badge.svg)
8+
149
Simple Fork Framework is based on PCNTL extension, the interfaces are like `Thread` and `Runnable` in Java.
1510

1611
Why SimpleFork
@@ -21,17 +16,13 @@ SimpleFork framework provide several interfaces which like Java `Thread` and sol
2116
Require
2217
---------------------
2318
```bash
24-
composer require jenner/simple_fork
25-
```
26-
Or
27-
```php
28-
require '/path/to/simple-fork-php/autoload.php'
19+
composer require maksimovic/simple-fork-php
2920
```
3021

3122
Dependencies
3223
----------------------
3324
must
34-
+ php > 5.3.0
25+
+ php >= 7.2
3526
+ ext-pcntl process control
3627

3728
optional
@@ -89,8 +80,7 @@ method of the sub process is called, it will register the signal
8980
handler automatically.
9081

9182
Examples
92-
-------------------------
93-
More examples in [examples](https://github.com/huyanping/simple-fork-php/tree/master/examples examples) dictionary
83+
-------------------------
9484
**A simple example.**
9585
```php
9686
class TestRunnable implements \Jenner\SimpleFork\Runnable{

autoload.php

Lines changed: 0 additions & 15 deletions
This file was deleted.

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212
"name": "Jenner",
1313
"email": "hypxm@qq.com",
1414
"homepage": "http://www.huyanping.cn"
15+
},
16+
{
17+
"name": "Oliver Maksimovic",
18+
"homepage": "http://github.com/maksimovic"
1519
}
1620
],
1721
"license": "MIT",
1822
"type": "package",
1923
"require": {
20-
"php": ">=5.3.0"
24+
"php": "^7.2 | ^8.0"
25+
},
26+
"require-dev": {
27+
"phpunit/phpunit": "^8.5 || ^9.5"
2128
},
2229
"autoload": {
2330
"psr-4": {

phpunit.xml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
<phpunit bootstrap="vendor/autoload.php">
2-
<testsuites>
3-
<testsuite name="tests">
4-
<directory>tests</directory>
5-
</testsuite>
6-
</testsuites>
7-
</phpunit>
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="build/logs/clover.xml"/>
9+
<html outputDirectory="build/coverage"/>
10+
<text outputFile="php://stdout"/>
11+
</report>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="Package Tests">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<logging/>
19+
</phpunit>

0 commit comments

Comments
 (0)