Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 18ecc7e

Browse files
committed
Merge branch 'V3'
# Conflicts: # CHANGELOG.md # Command/phpFastCacheCommand.php # Resources/config/services.yml # Service/Cache.php # composer.json # composer.lock # src/DataCollector/CacheCollector.php # src/PhpfastcacheBundle.php # src/Resources/views/Collector/cache.html.twig # src/Twig/CacheExtension/Node/CacheNode.php # tests/SyntaxChecker.test.php
2 parents 7e7da04 + 962fbe8 commit 18ecc7e

File tree

69 files changed

+4459
-979
lines changed

Some content is hidden

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

69 files changed

+4459
-979
lines changed

Diff for: .gitattributes

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/tests export-ignore
2+
/bin/ci export-ignore
3+
/.github export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
.gitmodules export-ignore
7+
.travis.yml export-ignore
8+
.scrutinizer.yml export-ignore
9+
.codeclimate.yml export-ignore
10+
CONTRIBUTING.md export-ignore
11+
CODE_OF_CONDUCT.md export-ignore
12+
CODING_GUIDELINE.md export-ignore
13+
phpunit.xml.dist export-ignore
14+
phpcs.xml.dist export-ignore
15+
composer.lock export-ignore

Diff for: .github/CONTRIBUTING.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Contributing to the PhpFastCache Bundle
2+
========================================
3+
4+
Please note that this project is released with a
5+
[Contributor Code of Conduct](http://contributor-covenant.org/version/1/4/).
6+
By participating in this project you agree to abide by its terms.
7+
8+
Reporting Issues
9+
----------------
10+
11+
When reporting issues, please try to be as descriptive as possible, and include
12+
as much relevant information as you can. A step by step guide on how to
13+
reproduce the issue will greatly increase the chances of your issue being
14+
resolved in a timely manner.
15+
16+
Contributing policy
17+
-------------------
18+
19+
Our contributing policy is described in our [Coding Guideline](https://github.com/PHPSocialNetwork/phpfastcache-bundle/blob/V3/CODING_GUIDELINE.md)

Diff for: .github/ISSUE_TEMPLATE.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Configuration:
2+
3+
- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..."
4+
- **PhpFastCache bundle version:** "...replace me (Can be retrieved using constant `\Phpfastcache\Bundle\PhpfastcacheBundle::VERSION`)..."
5+
- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..."
6+
- **PHP version:** "...replace me (Can be retrieved using command line `php -v | sed -n 1p`)..."
7+
- **Operating system:** " ...replace me (You REALLY should know it)... "
8+
9+
#### Issue description:
10+
11+
> ... Your description goes here ...
12+
... You can also read the [wiki](https://github.com/PHPSocialNetwork/phpfastcache-bundle/wiki) ...

Diff for: .travis.yml

+32-29
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1-
#
2-
# This file is part of phpFastCache.
3-
#
4-
# @license MIT License (MIT)
5-
#
6-
# For full copyright and license information, please see the docs/CREDITS.txt file.
7-
#
8-
# @author Khoa Bui (khoaofgod) <[email protected]> http://www.phpfastcache.com
9-
# @author Georges.L (Geolim4) <[email protected]>
10-
#
11-
sudo: false
12-
131
language: php
142

153
services:
16-
- memcached
174
- redis-server
18-
before_script:
19-
- |
20-
if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then
21-
cat var/php/conf/phpfastcache.ini >> /etc/hhvm/php.ini
22-
else
23-
phpenv config-add var/php/conf/phpfastcache.ini
24-
fi
255

266
php:
27-
# - 5.3
28-
# - 5.4
29-
# - 5.5
30-
- 5.6
317
- 7.0
8+
- 7.1
9+
- 7.2
3210
- nightly
33-
- hhvm
11+
12+
env:
13+
global:
14+
- SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
3415

3516
matrix:
3617
fast_finish: true
3718
allow_failures:
3819
- php: nightly
39-
- php: hhvm
20+
- env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
21+
include:
22+
- php: 7.0
23+
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
24+
- php: 7.1
25+
env: SYMFONY_VERSION="3.4.*"
26+
- php: 7.2
27+
env: SYMFONY_VERSION="3.4.*"
28+
- php: nightly
29+
env: SYMFONY_VERSION="3.4.*"
30+
31+
sudo: false
32+
33+
cache:
34+
directories:
35+
- $HOME/.composer/cache
36+
37+
before_install:
38+
- phpenv config-rm xdebug.ini || true
39+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
40+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv rehash; fi;
41+
- composer self-update
42+
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/symfony:${SYMFONY_VERSION}; fi;
4043

4144
install:
42-
- ./bin/ci/install_dependencies.sh
45+
- composer update --no-interaction --no-progress $COMPOSER_FLAGS
4346

44-
script:
45-
- php -f tests/SyntaxChecker.test.php
47+
before_script:
48+
- mkdir Phpfastcache && ln -s ../ Phpfastcache/PhpfastcacheBundle

Diff for: CHANGELOG.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
## 2.0.1
2-
##### 16 february 2018
3-
- __Global__
4-
- Updated **@phpfastcache** service to be provided by a service factory to avoid multiprocessor issues with PhpUnit (@geolim4)
5-
- __Data collector__
6-
- Fixed critical Symfony 3.4 issue (@geolim4)
1+
## 3.0.0
2+
##### 27 may 2018
3+
4+
- Added Symfony 4 (Flex) compatibility (thanks to @Pastisd)
5+
- Updated Phpfastcache service which is now private, use Symfony [D.I](https://symfony.com/doc/current/components/dependency_injection.html) instead.
6+
- Updated Phpfastcache dependency to the v7
7+
- Updated namespace for more consistency and to comply with moderns standards
8+
- Improved DataCollector interface by retrieving more information about cache
9+
- Improved Opcache efficiency, thanks to PHP7
10+
- Added deep tests (unit. + func.) to ensure you that the bundle is well-tested
11+
- Added CRUD-like commands, check out [README.md](./README.md#computer-cli-command-interactions)
12+
- Added "Cacheable Response" feature, check out [README.md](./README.md#bulb-introducing-cacheable-responses-v3-only)
13+
- Performed global code review to remove code aberrations and simplify portions of code.
14+
- Migration guide available [here](./src/Resources/Docs/migration/MigratingFromV2ToV3.md) to migrate from the Phpfastcache Bundle v2.
715

8-
## 2.0.0
9-
##### 01 july 2017
10-
- __Global__
11-
- First 2.x release, yay !

Diff for: CODE_OF_CONDUCT.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

Diff for: CODING_GUIDELINE.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
CODING GUIDELINE
2+
-------------------
3+
4+
Fork the project, create a feature branch, and send us a pull request.
5+
Preferably on a distinct branch.
6+
7+
To ensure a consistent code base, you should make sure the code follows
8+
the [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/). You can also
9+
run [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with the
10+
configuration file that can be found in the project root directory.
11+
12+
If you would like to help, take a look at the [list of open issues](https://github.com/PHPSocialNetwork/phpfastcache/issues).
13+
14+
PHPFASTCACHE's specialties
15+
-------------------
16+
As of the V7 your contributions MUST comply the following standards:
17+
18+
### PHP CORE FUNCTIONS
19+
- To improve opcode efficiency, you MUST prefix core function by a '\\'
20+
- E.g: `$var = \str_replace('value', '', $var);`
21+
22+
### PHP CORE CLASSES
23+
- Do not imports non-namespaced classes, use an absolute path instead:
24+
- E.g: `$date = new \DateTime();`
25+
26+
### CODE STYLE
27+
- Unneeded/inconsistent `else` statements have to be shortened.
28+
- E.g:
29+
```php
30+
<?php
31+
function setAcme($acme)
32+
{
33+
if ($acme instanceof Acme) {
34+
$this->acme = $acme;
35+
return $this;
36+
} else {
37+
throw new phpFastCacheInvalidArgumentException('Invalid acme instance');
38+
}
39+
}
40+
```
41+
- This example can be safely replaced by this one:
42+
```php
43+
<?php
44+
function setAcme($acme)
45+
{
46+
if ($acme instanceof Acme) {
47+
$this->acme = $acme;
48+
return $this;
49+
}
50+
51+
throw new phpFastCacheInvalidArgumentException('Invalid acme instance');
52+
}
53+
```
54+
[Read this thread on StackExchange for more information](https://softwareengineering.stackexchange.com/questions/122485/elegant-ways-to-handle-ifif-else-else)
55+
This list is non-exhaustive and will may subject to evolve at any time.

Diff for: Command/phpFastCacheCommand.php

-93
This file was deleted.

Diff for: Docs/Example/Screenshoots/debugPanel.md

-7
This file was deleted.

Diff for: Docs/Example/Screenshoots/profiler.png

-173 KB
Binary file not shown.

0 commit comments

Comments
 (0)