Skip to content

Commit cc3746b

Browse files
author
Amin
committed
Initial commit
0 parents  commit cc3746b

28 files changed

+8823
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [php-webrtc]

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: "🐛 Bug Report"
3+
about: Report a reproducible bug in the PHP library
4+
title: "[Bug] "
5+
labels: bug
6+
---
7+
8+
## Description
9+
10+
A clear and concise description of the problem.
11+
12+
## Steps to Reproduce
13+
14+
List the steps to reproduce the behavior:
15+
16+
1. ...
17+
2. ...
18+
3. ...
19+
20+
## Expected Behavior
21+
22+
Describe what you expected to happen.
23+
24+
## Actual Behavior
25+
26+
Describe what actually happened.
27+
28+
## Environment
29+
30+
- PHP version: (e.g., 8.2.5)
31+
- Operating System: (e.g., Ubuntu 22.04, macOS 13)
32+
- Framework (if any): (e.g., Laravel 10, Symfony 6)
33+
- Composer version: (e.g., 2.7.0)
34+
- Additional packages used: (e.g., psr/log, monolog/monolog)
35+
36+
## Additional Context
37+
38+
Add any other context about the problem here, including screenshots, error logs, or related issues if applicable.
39+
40+
## Possible Fix (optional)
41+
42+
Suggest a fix or point to the code that might be related to the issue.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: "🚀 Feature Request"
3+
about: Suggest an enhancement for the PHP library
4+
title: "[Feature] "
5+
labels: enhancement
6+
---
7+
8+
## Feature Description
9+
10+
Clearly and concisely describe the feature you would like to see implemented.
11+
12+
## Use Case / Motivation
13+
14+
What problem does this feature solve or what benefit does it bring to users of the PHP library?
15+
16+
## Related Context
17+
18+
- PHP version(s): (e.g., PHP 8.1, 8.2)
19+
- Frameworks: (e.g., Laravel, Symfony)
20+
- Related packages: (e.g., `psr/log`, `guzzlehttp/guzzle`)
21+
- Environment: (e.g., CLI, web, Swoole, ReactPHP)
22+
23+
## Suggested Implementation (optional)
24+
25+
If you have an idea of how this feature could be implemented, feel free to share it here.

.github/workflows/tests.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: WebRTC TESTS
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up PHP 8.4 with FFI and GMP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 8.4
26+
extensions: ffi, gmp
27+
ini-values: ffi.enable=true
28+
tools: composer:v2
29+
30+
- name: Validate composer.json and composer.lock
31+
run: composer validate --strict
32+
33+
- name: Cache Composer packages
34+
id: composer-cache
35+
uses: actions/cache@v3
36+
with:
37+
path: vendor
38+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-php-
41+
42+
- name: Install dependencies
43+
run: composer install --prefer-dist --no-progress
44+
45+
- name: Install OpenSSL 3.x and srtp on Ubuntu
46+
if: matrix.os == 'ubuntu-latest'
47+
run: |
48+
sudo add-apt-repository -y ppa:ondrej/nginx
49+
sudo apt update
50+
sudo apt install -y libssl-dev openssl libsrtp2-dev
51+
openssl version -v
52+
pkg-config --modversion libsrtp2 || echo "libsrtp2 not found"
53+
54+
- name: Install FFmpeg 7.1.1 with libx264, libopus, libvpx 1.15.0
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y \
58+
autoconf automake build-essential cmake git libtool pkg-config \
59+
yasm nasm wget unzip libssl-dev \
60+
libx264-dev libopus-dev
61+
62+
# Install FFmpeg 7.1.1
63+
wget https://ffmpeg.org/releases/ffmpeg-7.1.1.tar.bz2
64+
tar xjf ffmpeg-7.1.1.tar.bz2
65+
cd ffmpeg-7.1.1
66+
./configure --enable-shared --enable-gpl --enable-libx264 --enable-libopus
67+
make -j$(nproc)
68+
sudo make install
69+
sudo ldconfig
70+
cd ..
71+
72+
# Build and install libvpx
73+
mkdir -p ~/vpx_sources
74+
cd ~/vpx_sources
75+
curl -LO https://github.com/webmproject/libvpx/archive/refs/tags/v1.15.0.tar.gz
76+
tar xzvf v1.15.0.tar.gz
77+
cd libvpx-1.15.0
78+
79+
./configure --prefix=/usr/local --enable-shared --disable-examples
80+
make -j$(nproc)
81+
sudo make install
82+
sudo ldconfig
83+
84+
pkg-config --modversion vpx || echo "libvpx not found"
85+
86+
- name: Check PHP and FFI status
87+
run: |
88+
php -v
89+
php -r "echo 'FFI enabled: ' . (extension_loaded('ffi') ? 'yes' : 'no') . PHP_EOL;"
90+
91+
- name: Run PHPUnit tests
92+
run: vendor/bin/phpunit

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/).
7+
8+
## [1.0.0] - 2025-05-13
9+
10+
### Added
11+
- First release

CODE_OF_CONDUCT.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Code of Conduct - WebRTC
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behaviour that contributes to a positive environment for our
15+
community include:
16+
17+
* Demonstrating empathy and kindness toward other people
18+
* Being respectful of differing opinions, viewpoints, and experiences
19+
* Giving and gracefully accepting constructive feedback
20+
* Accepting responsibility and apologising to those affected by our mistakes,
21+
and learning from the experience
22+
* Focusing on what is best not just for us as individuals, but for the
23+
overall community
24+
25+
Examples of unacceptable behaviour include:
26+
27+
* The use of sexualised language or imagery, and sexual attention or advances
28+
* Trolling, insulting or derogatory comments, and personal or political attacks
29+
* Public or private harassment
30+
* Publishing others' private information, such as a physical or email
31+
address, without their explicit permission
32+
* Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project maintainers are responsible for clarifying and enforcing our standards of
38+
acceptable behaviour and will take appropriate and fair corrective action in
39+
response to any behaviour that they deem inappropriate,
40+
threatening, offensive, or harmful.
41+
42+
Project maintainers have the right and responsibility to remove, edit, or reject
43+
comments, commits, code, wiki edits, issues, and other contributions that are
44+
not aligned to this Code of Conduct, and will
45+
communicate reasons for moderation decisions when appropriate.
46+
47+
## Scope
48+
49+
This Code of Conduct applies within all community spaces, and also applies when
50+
an individual is officially representing the community in public spaces.
51+
Examples of representing our community include using an official e-mail address,
52+
posting via an official social media account, or acting as an appointed
53+
representative at an online or offline event.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behaviour may be
58+
reported to the community leaders responsible for enforcement at <github@aminyazdanpanah.com>.
59+
All complaints will be reviewed and investigated promptly and fairly.
60+
61+
All community leaders are obligated to respect the privacy and security of the
62+
reporter of any incident.
63+
64+
## Enforcement Guidelines
65+
66+
Community leaders will follow these Community Impact Guidelines in determining
67+
the consequences for any action they deem in violation of this Code of Conduct:
68+
69+
### 1. Correction
70+
71+
**Community Impact**: Use of inappropriate language or other behaviour deemed
72+
unprofessional or unwelcome in the community.
73+
74+
**Consequence**: A private, written warning from community leaders, providing
75+
clarity around the nature of the violation and an explanation of why the
76+
behaviour was inappropriate. A public apology may be requested.
77+
78+
### 2. Warning
79+
80+
**Community Impact**: A violation through a single incident or series
81+
of actions.
82+
83+
**Consequence**: A warning with consequences for continued behaviour. No
84+
interaction with the people involved, including unsolicited interaction with
85+
those enforcing the Code of Conduct, for a specified period of time. This
86+
includes avoiding interactions in community spaces as well as external channels
87+
like social media. Violating these terms may lead to a temporary or
88+
permanent ban.
89+
90+
### 3. Temporary Ban
91+
92+
**Community Impact**: A serious violation of community standards, including
93+
sustained inappropriate behaviour.
94+
95+
**Consequence**: A temporary ban from any sort of interaction or public
96+
communication with the community for a specified period of time. No public or
97+
private interaction with the people involved, including unsolicited interaction
98+
with those enforcing the Code of Conduct, is allowed during this period.
99+
Violating these terms may lead to a permanent ban.
100+
101+
### 4. Permanent Ban
102+
103+
**Community Impact**: Demonstrating a pattern of violation of community
104+
standards, including sustained inappropriate behaviour, harassment of an
105+
individual, or aggression toward or disparagement of classes of individuals.
106+
107+
**Consequence**: A permanent ban from any sort of public interaction within
108+
the community.
109+
110+
## Attribution
111+
112+
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
113+
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
114+
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
115+
and was generated by [contributing.md](https://contributing.md/generator).

0 commit comments

Comments
 (0)