Skip to content

Commit

Permalink
Merge pull request #1 from niden/master
Browse files Browse the repository at this point in the history
Proxy PSR13 implementation
  • Loading branch information
niden authored Sep 29, 2022
2 parents 3284797 + be25fdb commit a158efc
Show file tree
Hide file tree
Showing 66 changed files with 8,215 additions and 4 deletions.
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]: "
labels: 'bug, status: unverified'
assignees: ''

---

Questions? Discussions: https://phalcon.io/discussions or Discord: https://phalcon.io/discord

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:

```php
// paste output here
```

> Provide minimal script to reproduce the issue
```php
// paste output here
```

**Expected behavior**
A clear and concise description of what you expected to happen.

```php
// paste code
```

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Details**
- Phalcon version
- PHP Version: (`php -v`)
- Operating System:
- Server: Nginx | Apache | Other
- Other related info (Database, table schema):

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[NFR]: "
labels: new feature request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I am always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Hello!

* Type: bug fix | new feature | code quality | documentation
* Link to issue:

**In raising this pull request, I confirm the following:**

- [ ] I have read and understood the [Contributing Guidelines](https://github.com/phalcon/phalcon/blob/master/CONTRIBUTING.md)
- [ ] I have checked that another pull request for this purpose does not exist
- [ ] I wrote some tests for this PR
- [ ] I have updated the relevant CHANGELOG
- [ ] I have created a PR for the [documentation](https://github.com/phalcon/docs) about this change

Small description of change:

Thanks
107 changes: 107 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# This file is part of Phalcon.
#
# (c) Phalcon Team <[email protected]>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.

name: Phalcon CI

on:
schedule:
- cron: '0 2 * * *' # Daily at 02:00 runs only on default branch
push:
paths-ignore:
- '**.md'
- '**.txt'
pull_request:
workflow_dispatch:

env:
# All versions should be declared here
PHALCON_VERSION: 5.0.2

# For tests
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8

# PHP extensions required by Composer
# (adding phalcon version here until I figure out how to use the variable above)
EXTENSIONS: apcu, gettext, gd, igbinary, imagick, intl, json, mbstring, msgpack, memcached, phalcon-5.0.2, sqlite3, yaml, redis, :memcache

jobs:
phpcs:
name: Validate Tests code style
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Run PHP_CodeSniffer
run: docker run --rm -v $(pwd):/data cytopia/phpcs --standard=./phpcs.xml

build-and-test:
name: tests / PHP-${{ matrix.php }}

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1' ]

steps:
- uses: actions/checkout@v2

- name: Setup platform specific environment
shell: pwsh
run: |
git config --global core.autocrlf false
$SessionSavePath = '/tmp'
Write-Output "SESSION_SAVE_PATH=$SessionSavePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enable_cli=on, session.save_path=${{ env.SESSION_SAVE_PATH }}
tools: pecl, phpize, php-config, composer:v2
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer
run: composer validate --no-check-all --no-check-publish

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup Composer Cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.php }}-

- run: composer install --prefer-dist

- name: Setup Tests
shell: bash
run: |
vendor/bin/codecept build
- name: Run Unit Tests
if: always()
run: vendor/bin/codecept run --coverage-xml=coverage-${{ matrix.php }}.xml --ext DotReporter unit

- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
directory: ./tests/_output/
files: coverage-7.4.xml,coverage-8.0.xml,coverage-8.1.xml
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/cache/
/config/development/
/vendor
.env
Empty file added CHANGELOG.md
Empty file.
25 changes: 25 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributor Covenant Code of Conduct

## TL;DR

Common sense rules. Treat people the same way you want to be treated.

## Detail

This is an open source project. Everyone and anyone is welcome to contribute
to it as much or as little as they want to.

Personal views of contributors have no effect on the project and should be
kept in the personal realm not this project.

It is a requirement to treat other contributors as well as maintainers with
respect, when communicating in the realm of this project. It is OK to agree to
disagree.

## Conflict

If ever conflict arises, please bring it to the attention of the maintainers
privately. You can always find us on our [Discord](https://phalcon.io/discord)
server or you can send us an email at [[email protected]](mailto:[email protected])

The core team maintains the final decision on any conflict that may arise.
24 changes: 24 additions & 0 deletions CODE_OWNERS.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This file is a list of the people responsible for ensuring that patches for a
particular part of Phalcon are reviewed, either by themselves or by someone
else. They are also the gatekeepers for their part of Phalcon, with the final
word on what goes in or not.

The list is sorted by last name and formatted to allow easy grepping and
beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).

The sample of querying command to search PECL keyword:
awk -v RS='' -v ORS='\n\n' '/\nD: .*PECL/' CODE_OWNERS.TXT

N: Anton Vasiliev
E: [email protected]
W:
P:
D: Maintenance and design

N: Nikolaos Dimopoulos
E: [email protected]
W: https://niden.net
P: 0x93F8CA07B9C8C41D
D: Maintenance and design
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing to PSR Proxy

WIP

Phalcon Team
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# proxy-psr13
Package to offer PSR-13 (Link) compatibility with Phalcon classes from the PHP userland
# Phalcon Framework - Proxy PSR-13

[![Phalcon CI][actions_badge]](https://github.com/phalcon/proxy-psr13/actions/workflows/main.yml) [![codecov][codecov_badge]](https://codecov.io/gh/phalcon/proxy-psr13)

Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.

Proxy PSR-13 is a package that offers PSR-13 compatibility with `Phalcon\Html\Link`. Developers that wish to use PSR-13 alongside Phalcon, can use this package which is a wrapper to `Phalcon\Html\Link`.

## Installation

You can install the package using composer

```sh
composer require phalcon/proxy-psr13
```

## Links

### General
* [Official Documentation](https://docs.phalcon.io/)

### Support
* [Forum](https://phalcon.io/forum)
* [Discord](https://phalcon.io/discord)
* [Stack Overflow](https://phalcon.io/so)

### Social Media
* [Telegram](https://phalcon.io/telegram)
* [Gab](https://phalcon.io/gab)
* [LinkedIn](https://phalcon.io/linkedin)
* [MeWe](https://phalcon.io/mewe)
* [Facebook](https://phalcon.io/fb)
* [Twitter](https://phalcon.io/t)


<!-- External links should be here -->
[actions_badge]: https://github.com/phalcon/proxy-psr3/actions/workflows/main.yml/badge.svg
[codecov_badge]: https://codecov.io/gh/phalcon/proxy-psr3/branch/master/graph/badge.svg?token=J2WQtnpAyT

[discord-badge]: https://img.shields.io/discord/310910488152375297?label=Discord&logo=discord&style=flat-square
Empty file added bin/.gitkeep
Empty file.
36 changes: 36 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
actor_suffix: Tester

paths:
# where the modules stored
tests: tests
log: tests/_output
# directory for fixture data
data: tests/_data
# directory for custom modules (helpers)
support: tests/_support
envs: tests/_envs

settings:
colors: true
# Tests (especially functional) can take a lot of memory
# We set a high limit for them by default.
memory_limit: 1024M
lint: true

# name of bootstrap that will be used
# each bootstrap file should be
# inside a suite directory.
bootstrap: _bootstrap.php

coverage:
enabled: true
include:
- src/*

extensions:
enabled:
- Codeception\Extension\RunFailed

params:
# get params from environment vars
#- .env
38 changes: 38 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "phalcon/proxy-psr13",
"description": "Phalcon Framework proxy classes for PSR-16",
"keywords": [
"php",
"framework",
"phalcon",
"psr-13"
],
"license": "MIT",
"require": {
"php": ">=7.4 <9.0",
"psr/link": "^1.0"
},
"autoload": {
"psr-4": {
"Phalcon\\Proxy\\Psr13\\": "src/",
"Phalcon\\Proxy\\Psr13\\Tests\\Fixtures\\": "tests/_data/fixtures/",
"Phalcon\\Proxy\\Psr13\\Tests\\Unit\\": "tests/unit/"
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"require-dev": {
"codeception/codeception": "^4.1",
"codeception/module-asserts": "^2.0",
"codeception/module-filesystem": "^2.0",
"friendsofphp/php-cs-fixer": "^3.7",
"pds/skeleton": "^1.0",
"phalcon/ide-stubs": "^5.0",
"phpstan/phpstan": "^1.4",
"squizlabs/php_codesniffer": "^3.6",
"vimeo/psalm": "^4.22"
}
}
Loading

0 comments on commit a158efc

Please sign in to comment.