Skip to content

Commit 912ff4f

Browse files
Remove ApplicationAbstract, GoApplication, NodeJsApplication, and several test files
The ApplicationAbstract, GoApplication, NodeJsApplication files along with BootstrapTest, ListenerTest, StatisticsTest, and UpstreamTest were deleted. This major cleanup is part of an effort to simplify the codebase and remove redundant or obsolete code. As a result, the codebase is now leaner and easier to maintain.
2 parents be8fde9 + 9a9e019 commit 912ff4f

File tree

126 files changed

+5966
-1534
lines changed

Some content is hidden

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

126 files changed

+5966
-1534
lines changed

.github/CODE_OF_CONDUCT.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Code of conduct
2+
3+
## PSR-12 Coding Standard
4+
5+
All code must adhere to the [PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/).
6+
7+
## Collaborative atmosphere
8+
9+
Every developer in the project should respect and acknowledge the value of the contributions of others. No form of
10+
bullying or harassment will be tolerated in the project.
11+
12+
## Community Involvement
13+
14+
Actively encouraging participation from developers with different levels of skills is a part of this project's value. We
15+
are all unique in our abilities, and our collective talent contributes to the project's success.
16+
17+
## Confidentiality
18+
19+
On no occasion should you share any sensitive information associated with the project. It includes but is not limited to
20+
user data, secret keys, and passwords.
21+
22+
## Open source
23+
24+
Any code written for the project shall be open-source compatible. It means respect for copyrights, licenses, and
25+
reference to the sources when using codes from other open-source projects.
26+
27+
## Professional Etiquette
28+
29+
Developers shall maintain professionalism in their communication. Any form of unprofessional communication may be
30+
grounds for removal from the project.
31+
32+
## Reporting and conflict resolution
33+
34+
Conflicts should be handled professionally and objectively, without any form of discrimination or personal bias. Please
35+
report any violations of the code of conduct to the project admins.

SECURITY.md renamed to .github/SECURITY.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
## Security Policy
22

33
## Versioning
4+
45
We use [SemVer](https://semver.org/) for versioning. For the versions available, see the tags on this repository.
56

67
## Supported Versions
78

89
| Version | Nginx Unit Capability | Supported |
910
|---------|:----------------------|--------------------|
10-
| 0.6.x | 1.30.0 & 1.31.0 | :white_check_mark: |
11-
| < 0.5.x | 1.30.0 | :x: |
11+
| 0.7.x | 1.32.1 | :white_check_mark: |
12+
| < 0.6.x | - | :x: |
1213

1314
## Vulnerability Report
1415

.github/workflows/deploy_codecov.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy to Codecov
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
coverage_test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.3'
20+
extensions: curl
21+
tools: composer:v2
22+
coverage: xdebug
23+
24+
- name: Install dependencies
25+
run: composer install --prefer-dist --no-progress
26+
27+
- name: Run tests
28+
run: composer test:coverage
29+
30+
- name: Upload coverage reports to Codecov
31+
uses: codecov/codecov-action@v3
32+
env:
33+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ vendor
33
.php-cs-fixer.cache
44
.phpcs-cache
55
composer.lock
6+
coverage.xml

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# CHANGELOG
22

3+
## v0.7.0 - [2024/04/07]
4+
5+
- Now SDK support connection via only address.
6+
- All private fields renamed from `_pattern` to `pattern`
7+
- Some classes become a builders
8+
- Updated PhpTarget class
9+
- Added PhpOptions class
10+
- Update Unit tests
11+
- Added more classes for better support of PHP applications
12+
- Added more classes information
13+
314
## v0.6.0 - [2023/09/13] _Release on Programmer's Day. Happy holiday everyone :)_
415

516
- Rename method in ListenerPass getPassType() to getType()

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [2023] [Pavel Zavadski]
189+
Copyright [2024] [Pavel Zavadski]
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

+48-70
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,81 @@
1-
21
<p align="center">
3-
<img style="text-aligh: center" src="https://15804523-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F77F3kdmGsRkZFelMUJq1%2Ficon%2FnsTZCyEjC1z8LJWkzLro%2F%D1%8B.svg?alt=media&token=ce321f03-8fdf-4c4d-aaef-888183f713f6" width="200" alt="Company logo">
2+
<img style="text-align: center" src="https://15804523-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F77F3kdmGsRkZFelMUJq1%2Ficon%2FnsTZCyEjC1z8LJWkzLro%2F%D1%8B.svg?alt=media&token=ce321f03-8fdf-4c4d-aaef-888183f713f6" width="200" alt="Company logo">
43
</p>
54

65
<p align="center">
76
<b style="font-size: 2rem">PHP SDK for Nginx Unit</b>
87
</p>
98

109
<p align="center">
11-
<a href="https://packagist.org/packages/pavlusha311245/unit-php-sdk"><img src="https://img.shields.io/packagist/v/Pavlusha311245/unit-php-sdk?labelColor=%231e293b&color=%23702963&link=https%3A%2F%2Fpackagist.org%2Fpackages%2Fpavlusha311245%2Funit-php-sdk"></a>
12-
<a href="https://unit-sdk.pavlusha.me/"><img src="https://img.shields.io/website?url=https%3A%2F%2Funit-sdk.pavlusha.me%2F&label=documentation&link=https%3A%2F%2Funit-sdk.pavlusha.me%2F"></a>
10+
<a href="https://packagist.org/packages/pavlusha311245/unit-php-sdk"><img src="https://img.shields.io/packagist/v/Pavlusha311245/unit-php-sdk?labelColor=%231e293b&color=%23702963&link=https%3A%2F%2Fpackagist.org%2Fpackages%2Fpavlusha311245%2Funit-php-sdk" alt="packagist link"></a>
11+
<a href="https://unit-sdk.pavlusha.me/"><img src="https://img.shields.io/website?url=https%3A%2F%2Funit-sdk.pavlusha.me%2F&label=documentation&link=https%3A%2F%2Funit-sdk.pavlusha.me%2F" alt="documentation link"></a>
12+
<img src="https://github.com/Pavlusha311245/nginx-unit-php-sdk/actions/workflows/deploy_codecov.yaml/badge.svg" alt="documentation link">
13+
<a href="https://codecov.io/gh/Pavlusha311245/nginx-unit-php-sdk" >
14+
<img src="https://codecov.io/gh/Pavlusha311245/nginx-unit-php-sdk/graph/badge.svg?token=FGTTDSJ7BX" alt="Codecov dabge"/>
15+
</a>
1316
</p>
1417

15-
## About
16-
17-
SDK allows developers to interact with the Nginx Unit web server through php classes. This project will help embed web server management into your projects
18-
19-
### Supported Versions
20-
21-
| Version | Nginx Unit Capability | Supported |
22-
|---------|:----------------------|--------------------|
23-
| 0.6.x | 1.30.0 & 1.31.0 | :white_check_mark: |
24-
| < 0.4.x | 1.30.0 | :x: |
25-
26-
_THIS PROJECT IN DEVELOPMENT. DON'T USE IT IN PRODUCTION_
18+
## About
2719

28-
## Quick start
20+
SDK allows developers to interact with the Nginx Unit web server through php classes. This project will help embed web
21+
server management into your projects
22+
> This project in development. Don't use it in production. Some features may not work correctly. Please report bugs and issues to the issue tracker.
2923
30-
### Pre-requirements
24+
### Requirements
3125

32-
* [PHP](https://www.php.net/) >= 8.2
33-
* [PHP curl extension](https://www.php.net/manual/en/book.curl.php)
26+
* [PHP](https://www.php.net/) >= 8.3
3427
* [Composer](https://getcomposer.org/) >= 2
35-
* [Nginx unit](https://unit.nginx.org/installation/) >= 1.30.0
36-
37-
### Installation
3828

39-
1. Create folder `mkdir example-php-project`
40-
2. Open folder `cd example-php-project`
41-
3. Crate composer.json file. Example below:
42-
```json
43-
{
44-
"name": "user/example-php-project",
45-
"require": {
46-
"pavlusha311245/unit-php-sdk": "^0.6.0"
47-
},
48-
"autoload": {
49-
"psr-4": {
50-
"User\\ExamplePhpProject\\": "src/"
51-
}
52-
}
53-
}
54-
55-
```
56-
4. Install packages `composer install`
29+
### Supported Versions
5730

58-
Congratulations! You installed package. Now you can use the full power of this SDK.
31+
| Version | Nginx Unit Capability | Supported |
32+
|---------|:----------------------|--------------------|
33+
| 0.7.x | <= 1.32.1 | :white_check_mark: |
34+
| < 0.6.x | - | :x: |
5935

60-
* Create `src/index.php` file
61-
1. `cd src` (`mkdir src` if folder doesn't exist)
62-
2. `touch src/index.php`
63-
3. `nano src/index.php`
64-
* Paste code and change this line `socket: <your socket path to Nginx Unit>` for your configuration
36+
### Quick start
6537

66-
```php
67-
<?php
38+
How to start using the SDK in your project you can find in the [documentation](https://unit-sdk.pavlusha.me/installation).
6839

69-
use UnitPhpSdk\Unit;
40+
### Documentation
7041

71-
require '../vendor/autoload.php';
42+
The Unit SDK offers a wide range of functionality. More examples and detailed information about its features,
43+
installation, and use can be found [in the documentation](https://unit-sdk.pavlusha.me/). Check it out to make the most
44+
of this extensive tool. Happy coding 😊
7245

73-
$unit = new Unit(
74-
socket: <your socket path to Nginx Unit>,
75-
address: 'http://localhost'
76-
);
46+
## Changelog
7747

78-
$unit->getConfig();
79-
```
48+
We regularly update our code base due to new features, bug fixes or performance improvements. More information about
49+
these changes, including version details and update summaries, can be seen [here](CHANGELOG.md).
8050

81-
* Run `php index.php`
51+
## Contributing
8252

83-
### Documentation
53+
We appreciate all forms of contributions from code additions to reporting issues. Our project is open-source and thrives
54+
from the contributions made by our community. More info about how you can contribute to our project, contribution
55+
guidelines, and the whole process can be
56+
read [here](https://docs.github.com/en/get-started/quickstart/contributing-to-projects).
8457

85-
More examples and detailed information can be found [in the documentation](https://unit-sdk.pavlusha.me/)
58+
## Code of Conduct
8659

87-
Happy coding 😊
60+
We want to create a welcoming environment for all of our projects. Our code of conduct outlines our expectations for all
61+
those who participate in our community, as well as the consequences for unacceptable behavior. We invite you to help us
62+
create a safe and positive experience for everyone. More info about our code of conduct can be
63+
found [here](.github/CODE_OF_CONDUCT.md).
8864

89-
## Changelog
65+
## Security Policy
9066

91-
More information about changes you can see [here](CHANGELOG.md)
67+
If you find bugs and vulnerabilities, please
68+
9269

93-
## Contribution
70+
More info [here](.github/SECURITY.md)
9471

95-
More info about contribution you can
96-
read [here](https://docs.github.com/en/get-started/quickstart/contributing-to-projects)
72+
## Support
9773

98-
## Security Policy
74+
<div>
75+
<p>The project is being developed with the support of IDE from JetBrains</p>
76+
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="JetBrains Logo (Main) logo.">
77+
</div>
9978

100-
If you find bugs and vulnerabilities, please
101-
79+
## License
10280

103-
More info [here](SECURITY.md)
81+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

composer.json

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pavlusha311245/unit-php-sdk",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"type": "sdk",
55
"description": "This project allows developers to interact with the Nginx Unit web server through PHP classes",
66
"license": "Apache-2.0",
@@ -19,27 +19,33 @@
1919
],
2020
"scripts": {
2121
"test": [
22-
"./vendor/bin/pest",
23-
"./vendor/bin/phpstan analyse -c phpstan.neon"
22+
"composer test:unit",
23+
"composer test:phpstan"
2424
],
2525
"test:unit": "./vendor/bin/pest",
26+
"test:coverage": "./vendor/bin/pest --coverage --coverage-clover coverage.xml",
2627
"test:phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon",
2728
"lint": "./vendor/bin/php-cs-fixer fix --rules=@PSR12 ."
2829
},
2930
"require": {
30-
"php": ">=8.2",
31-
"friendsofphp/php-cs-fixer": "^3.21",
31+
"php": "^8.3",
32+
"friendsofphp/php-cs-fixer": "^3.46",
33+
"guzzlehttp/guzzle": "^7.8.1",
3234
"ext-curl": "*",
33-
"guzzlehttp/guzzle": "^7.0"
35+
"nesbot/carbon": "^2.72"
3436
},
3537
"require-dev": {
36-
"pestphp/pest": "^2.8",
37-
"phpstan/phpstan": "^1.10"
38+
"pestphp/pest": "^2.26",
39+
"phpstan/phpstan": "^1.10",
40+
"mockery/mockery": "^1.6"
3841
},
3942
"autoload": {
4043
"psr-4": {
4144
"UnitPhpSdk\\": "src/"
42-
}
45+
},
46+
"files": [
47+
"src/helpers.php"
48+
]
4349
},
4450
"autoload-dev": {
4551
"psr-4": {
@@ -51,6 +57,6 @@
5157
"pestphp/pest-plugin": true
5258
}
5359
},
54-
"minimum-stability": "stable",
60+
"minimum-stability": "beta",
5561
"prefer-stable": true
5662
}

docs/SUMMARY.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
* [Config](basic-usage/config/README.md)
1313
* [Listeners](basic-usage/config/listeners.md)
1414
* [Statistics](basic-usage/config/statistics.md)
15+
* [Applications](basic-usage/config/applications.md)
1516
* [Certificates](basic-usage/certificates.md)
1617

1718
## API Reference
1819

19-
* [Open](https://unit-api-ref.pavlusha.me/)
20+
* [Open](https://unit-api-ref.pavlusha.me/index.html)

0 commit comments

Comments
 (0)