diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..d5e72228 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,433 @@ +# Changelog + +## [v2.28.0](https://github.com/sifophp/SIFO/tree/v2.28.0) (2020-07-06) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.27.3...v2.28.0) + +**Merged pull requests:** + +- Injectable container [\#88](https://github.com/sifophp/SIFO/pull/88) ([p0lemic](https://github.com/p0lemic)) + +## [v2.27.3](https://github.com/sifophp/SIFO/tree/v2.27.3) (2020-05-25) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.27.2...v2.27.3) + +**Merged pull requests:** + +- Update dotenv to version 5.0 [\#87](https://github.com/sifophp/SIFO/pull/87) ([p0lemic](https://github.com/p0lemic)) + +## [v2.27.2](https://github.com/sifophp/SIFO/tree/v2.27.2) (2020-04-06) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.27.1...v2.27.2) + +**Merged pull requests:** + +- Controller instance var [\#86](https://github.com/sifophp/SIFO/pull/86) ([p0lemic](https://github.com/p0lemic)) + +## [v2.27.1](https://github.com/sifophp/SIFO/tree/v2.27.1) (2020-03-06) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.27.0...v2.27.1) + +**Merged pull requests:** + +- Fix Registry::invalidate method to invalidate a key that contains a NULL value [\#85](https://github.com/sifophp/SIFO/pull/85) ([xserrat](https://github.com/xserrat)) + +## [v2.27.0](https://github.com/sifophp/SIFO/tree/v2.27.0) (2020-02-19) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.26.2...v2.27.0) + +## [v2.26.2](https://github.com/sifophp/SIFO/tree/v2.26.2) (2020-02-14) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.26.1...v2.26.2) + +## [v2.26.1](https://github.com/sifophp/SIFO/tree/v2.26.1) (2020-02-13) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.26.0...v2.26.1) + +## [v2.26.0](https://github.com/sifophp/SIFO/tree/v2.26.0) (2019-08-05) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.25.0...v2.26.0) + +**Merged pull requests:** + +- Allow arguments with variables in services definition [\#83](https://github.com/sifophp/SIFO/pull/83) ([p0lemic](https://github.com/p0lemic)) +- Allow arguments with variables in services definition [\#82](https://github.com/sifophp/SIFO/pull/82) ([p0lemic](https://github.com/p0lemic)) + +## [v2.25.0](https://github.com/sifophp/SIFO/tree/v2.25.0) (2019-06-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.24.1...v2.25.0) + +## [v2.24.1](https://github.com/sifophp/SIFO/tree/v2.24.1) (2019-06-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.24.0...v2.24.1) + +**Merged pull requests:** + +- Change error type to E\_WARNING when try to store a null value in session [\#81](https://github.com/sifophp/SIFO/pull/81) ([p0lemic](https://github.com/p0lemic)) + +## [v2.24.0](https://github.com/sifophp/SIFO/tree/v2.24.0) (2019-05-30) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.23.0...v2.24.0) + +**Merged pull requests:** + +- Load dotenv file from root folder [\#80](https://github.com/sifophp/SIFO/pull/80) ([p0lemic](https://github.com/p0lemic)) + +## [v2.23.0](https://github.com/sifophp/SIFO/tree/v2.23.0) (2019-05-28) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.22.4...v2.23.0) + +**Merged pull requests:** + +- TARC-237 Configure Sifo Dependency Injector to be able to locate service definition files outside instances folders [\#79](https://github.com/sifophp/SIFO/pull/79) ([xserrat](https://github.com/xserrat)) + +## [v2.22.4](https://github.com/sifophp/SIFO/tree/v2.22.4) (2019-03-21) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.22.3...v2.22.4) + +## [v2.22.3](https://github.com/sifophp/SIFO/tree/v2.22.3) (2019-03-21) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.22.2...v2.22.3) + +## [v2.22.2](https://github.com/sifophp/SIFO/tree/v2.22.2) (2019-03-21) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.22.1...v2.22.2) + +## [v2.22.1](https://github.com/sifophp/SIFO/tree/v2.22.1) (2019-03-13) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.22.0...v2.22.1) + +**Merged pull requests:** + +- Changes for generate definition services files complying with PSR-2. [\#77](https://github.com/sifophp/SIFO/pull/77) ([mangasf](https://github.com/mangasf)) + +## [v2.22.0](https://github.com/sifophp/SIFO/tree/v2.22.0) (2019-02-07) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.21.0...v2.22.0) + +**Merged pull requests:** + +- Uvinum/allow load controller from di container [\#76](https://github.com/sifophp/SIFO/pull/76) ([p0lemic](https://github.com/p0lemic)) + +## [v2.21.0](https://github.com/sifophp/SIFO/tree/v2.21.0) (2019-02-05) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.20.1...v2.21.0) + +**Merged pull requests:** + +- Uvinum/add factory option to dependency injection [\#74](https://github.com/sifophp/SIFO/pull/74) ([p0lemic](https://github.com/p0lemic)) + +## [v2.20.1](https://github.com/sifophp/SIFO/tree/v2.20.1) (2019-01-23) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.20.0...v2.20.1) + +## [v2.20.0](https://github.com/sifophp/SIFO/tree/v2.20.0) (2018-10-02) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.19.0...v2.20.0) + +## [v2.19.0](https://github.com/sifophp/SIFO/tree/v2.19.0) (2018-08-27) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.18.0...v2.19.0) + +**Merged pull requests:** + +- Allowing Twig plugins to be parsed by Sifo [\#73](https://github.com/sifophp/SIFO/pull/73) ([marcossegovia](https://github.com/marcossegovia)) + +## [v2.18.0](https://github.com/sifophp/SIFO/tree/v2.18.0) (2018-08-01) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.17.3...v2.18.0) + +## [v2.17.3](https://github.com/sifophp/SIFO/tree/v2.17.3) (2018-07-30) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.17.2...v2.17.3) + +## [v2.17.2](https://github.com/sifophp/SIFO/tree/v2.17.2) (2018-06-21) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.17.1...v2.17.2) + +## [v2.17.1](https://github.com/sifophp/SIFO/tree/v2.17.1) (2018-05-28) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.17.0...v2.17.1) + +## [v2.17.0](https://github.com/sifophp/SIFO/tree/v2.17.0) (2018-05-08) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.8...v2.17.0) + +## [v3.0.0-beta.8](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.8) (2018-04-12) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.7...v3.0.0-beta.8) + +## [v3.0.0-beta.7](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.7) (2018-04-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.6...v3.0.0-beta.7) + +## [v3.0.0-beta.6](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.6) (2018-04-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.16.4...v3.0.0-beta.6) + +## [v2.16.4](https://github.com/sifophp/SIFO/tree/v2.16.4) (2018-04-05) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.16.3...v2.16.4) + +## [v2.16.3](https://github.com/sifophp/SIFO/tree/v2.16.3) (2017-11-07) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.16.2...v2.16.3) + +## [v2.16.2](https://github.com/sifophp/SIFO/tree/v2.16.2) (2017-10-03) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.16.1...v2.16.2) + +## [v2.16.1](https://github.com/sifophp/SIFO/tree/v2.16.1) (2017-09-19) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.16.0...v2.16.1) + +## [v2.16.0](https://github.com/sifophp/SIFO/tree/v2.16.0) (2017-08-24) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/elastic02...v2.16.0) + +## [elastic02](https://github.com/sifophp/SIFO/tree/elastic02) (2017-07-26) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.15.2...elastic02) + +## [v2.15.2](https://github.com/sifophp/SIFO/tree/v2.15.2) (2017-07-14) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/elastic01...v2.15.2) + +## [elastic01](https://github.com/sifophp/SIFO/tree/elastic01) (2017-07-12) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.15.1...elastic01) + +## [v2.15.1](https://github.com/sifophp/SIFO/tree/v2.15.1) (2017-06-27) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.5...v2.15.1) + +## [v3.0.0-beta.5](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.5) (2017-05-17) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.15.0...v3.0.0-beta.5) + +## [v2.15.0](https://github.com/sifophp/SIFO/tree/v2.15.0) (2017-05-17) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.4...v2.15.0) + +## [v3.0.0-beta.4](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.4) (2017-05-15) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.3...v3.0.0-beta.4) + +## [v3.0.0-beta.3](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.3) (2017-05-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.2...v3.0.0-beta.3) + +## [v3.0.0-beta.2](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.2) (2017-05-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.14.1...v3.0.0-beta.2) + +## [v2.14.1](https://github.com/sifophp/SIFO/tree/v2.14.1) (2017-05-11) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.13.4...v2.14.1) + +**Closed issues:** + +- Add SIFO to packagist [\#45](https://github.com/sifophp/SIFO/issues/45) + +## [v2.13.4](https://github.com/sifophp/SIFO/tree/v2.13.4) (2017-04-22) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.13.3...v2.13.4) + +**Merged pull requests:** + +- Multiple improvements from Uvinum's fork [\#72](https://github.com/sifophp/SIFO/pull/72) ([obokaman-com](https://github.com/obokaman-com)) + +## [v2.13.3](https://github.com/sifophp/SIFO/tree/v2.13.3) (2017-04-12) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.13.1...v2.13.3) + +## [v2.13.1](https://github.com/sifophp/SIFO/tree/v2.13.1) (2017-03-31) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.13.2...v2.13.1) + +## [v2.13.2](https://github.com/sifophp/SIFO/tree/v2.13.2) (2017-03-31) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.12.2...v2.13.2) + +## [v2.12.2](https://github.com/sifophp/SIFO/tree/v2.12.2) (2016-11-14) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.12.1...v2.12.2) + +## [v2.12.1](https://github.com/sifophp/SIFO/tree/v2.12.1) (2016-11-14) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.11.5...v2.12.1) + +## [v2.11.5](https://github.com/sifophp/SIFO/tree/v2.11.5) (2016-05-05) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.11.4...v2.11.5) + +## [v2.11.4](https://github.com/sifophp/SIFO/tree/v2.11.4) (2016-05-04) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.11.3...v2.11.4) + +## [v2.11.3](https://github.com/sifophp/SIFO/tree/v2.11.3) (2016-05-04) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.11.2...v2.11.3) + +## [v2.11.2](https://github.com/sifophp/SIFO/tree/v2.11.2) (2016-05-03) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.11.1...v2.11.2) + +## [v2.11.1](https://github.com/sifophp/SIFO/tree/v2.11.1) (2016-05-03) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.11.0...v2.11.1) + +## [v2.11.0](https://github.com/sifophp/SIFO/tree/v2.11.0) (2016-05-03) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.10.3...v2.11.0) + +## [v2.10.3](https://github.com/sifophp/SIFO/tree/v2.10.3) (2016-04-26) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.10.2...v2.10.3) + +## [v2.10.2](https://github.com/sifophp/SIFO/tree/v2.10.2) (2016-04-20) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.10.1...v2.10.2) + +## [v2.10.1](https://github.com/sifophp/SIFO/tree/v2.10.1) (2016-04-12) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v2.10.0...v2.10.1) + +## [v2.10.0](https://github.com/sifophp/SIFO/tree/v2.10.0) (2016-04-12) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/v3.0.0-beta.1...v2.10.0) + +**Closed issues:** + +- Move FilterException to correct location in travis-integration branch [\#67](https://github.com/sifophp/SIFO/issues/67) +- Make the "common" instance run [\#59](https://github.com/sifophp/SIFO/issues/59) +- Helper script to transition 2.xx to 3.0 [\#33](https://github.com/sifophp/SIFO/issues/33) + +**Merged pull requests:** + +- Merge pull request \#61 from sifophp/devel [\#62](https://github.com/sifophp/SIFO/pull/62) ([alombarte](https://github.com/alombarte)) +- Devel [\#61](https://github.com/sifophp/SIFO/pull/61) ([alombarte](https://github.com/alombarte)) + +## [v3.0.0-beta.1](https://github.com/sifophp/SIFO/tree/v3.0.0-beta.1) (2014-10-14) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.9.1...v3.0.0-beta.1) + +## [sifo-2.9.1](https://github.com/sifophp/SIFO/tree/sifo-2.9.1) (2014-09-13) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.9...sifo-2.9.1) + +**Closed issues:** + +- Add a before\_install clause in .travis.yml [\#58](https://github.com/sifophp/SIFO/issues/58) +- Move Bootstrap inside the Sifo folder [\#56](https://github.com/sifophp/SIFO/issues/56) +- Isolate autoloader inside Bootstrap to an Autoloader.php file [\#55](https://github.com/sifophp/SIFO/issues/55) +- Remove direct includes of files [\#52](https://github.com/sifophp/SIFO/issues/52) +- Remove all closing PHP tags [\#50](https://github.com/sifophp/SIFO/issues/50) +- Put all the classes in their correct namespace [\#41](https://github.com/sifophp/SIFO/issues/41) +- Integration of PHPUnit with Travis-CI [\#37](https://github.com/sifophp/SIFO/issues/37) +- Proposal of tree structure for Sifo 3, compliant with PSR-0,1,2,3,4 [\#31](https://github.com/sifophp/SIFO/issues/31) +- Split Filter classes into several files [\#11](https://github.com/sifophp/SIFO/issues/11) + +**Merged pull requests:** + +- trigger\_error on genurl action parameter invalid value set [\#60](https://github.com/sifophp/SIFO/pull/60) ([JavierCane](https://github.com/JavierCane)) + +## [sifo-2.9](https://github.com/sifophp/SIFO/tree/sifo-2.9) (2014-01-09) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.8...sifo-2.9) + +**Closed issues:** + +- Bug en js.config de la instancia common [\#17](https://github.com/sifophp/SIFO/issues/17) +- Exceptions\_XXX thrown in preDispatch invoke the autoloader when they should be in memory [\#10](https://github.com/sifophp/SIFO/issues/10) + +**Merged pull requests:** + +- Update README.md [\#30](https://github.com/sifophp/SIFO/pull/30) ([alombarte](https://github.com/alombarte)) +- Validate email regex used in the Filter class improved [\#29](https://github.com/sifophp/SIFO/pull/29) ([JavierCane](https://github.com/JavierCane)) +- Improved findi18n [\#28](https://github.com/sifophp/SIFO/pull/28) ([JavierCane](https://github.com/JavierCane)) +- Added "memory" for change directory [\#26](https://github.com/sifophp/SIFO/pull/26) ([alexgt9](https://github.com/alexgt9)) +- Fix problem with script, to not depends on the current directory [\#25](https://github.com/sifophp/SIFO/pull/25) ([alexgt9](https://github.com/alexgt9)) +- Command line options "Did you mean". [\#24](https://github.com/sifophp/SIFO/pull/24) ([JavierCane](https://github.com/JavierCane)) +- Added check before executing a class method other than build. [\#21](https://github.com/sifophp/SIFO/pull/21) ([nilportugues](https://github.com/nilportugues)) +- Updating Controller class to make it 100% compatible with new router sys... [\#20](https://github.com/sifophp/SIFO/pull/20) ([nilportugues](https://github.com/nilportugues)) +- Bootstrap.php : Changed $path\_parts\[0\] to implode\('/',$path\_parts\). [\#19](https://github.com/sifophp/SIFO/pull/19) ([nilportugues](https://github.com/nilportugues)) +- Extended the Router class [\#18](https://github.com/sifophp/SIFO/pull/18) ([nilportugues](https://github.com/nilportugues)) + +## [sifo-2.8](https://github.com/sifophp/SIFO/tree/sifo-2.8) (2013-04-07) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.7...sifo-2.8) + +**Closed issues:** + +- Cache: Avoid the dogpile effect \(add cache locking\) [\#15](https://github.com/sifophp/SIFO/issues/15) + +## [sifo-2.7](https://github.com/sifophp/SIFO/tree/sifo-2.7) (2012-11-02) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.6...sifo-2.7) + +**Closed issues:** + +- JSS and CSS Minify scripts [\#4](https://github.com/sifophp/SIFO/issues/4) + +## [sifo-2.6](https://github.com/sifophp/SIFO/tree/sifo-2.6) (2012-07-17) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.5...sifo-2.6) + +**Closed issues:** + +- Create an instance to deploy code on servers [\#6](https://github.com/sifophp/SIFO/issues/6) + +**Merged pull requests:** + +- Added phpunit and php-unit-skeleton generators [\#12](https://github.com/sifophp/SIFO/pull/12) ([alombarte](https://github.com/alombarte)) + +## [sifo-2.5](https://github.com/sifophp/SIFO/tree/sifo-2.5) (2012-05-25) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.4...sifo-2.5) + +## [sifo-2.4](https://github.com/sifophp/SIFO/tree/sifo-2.4) (2012-05-15) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.3...sifo-2.4) + +## [sifo-2.3](https://github.com/sifophp/SIFO/tree/sifo-2.3) (2012-04-18) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.2...sifo-2.3) + +## [sifo-2.2](https://github.com/sifophp/SIFO/tree/sifo-2.2) (2012-02-10) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-1.9...sifo-2.2) + +## [sifo-1.9](https://github.com/sifophp/SIFO/tree/sifo-1.9) (2011-12-07) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/stable-php-5.2-last-commit...sifo-1.9) + +## [stable-php-5.2-last-commit](https://github.com/sifophp/SIFO/tree/stable-php-5.2-last-commit) (2011-12-07) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/sifo-2.1...stable-php-5.2-last-commit) + +**Closed issues:** + +- Enable rebuild when debug is OFF and instance is in development mode [\#8](https://github.com/sifophp/SIFO/issues/8) +- SVN as read-only and mirror of Github repo [\#5](https://github.com/sifophp/SIFO/issues/5) + +## [sifo-2.1](https://github.com/sifophp/SIFO/tree/sifo-2.1) (2011-10-26) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/stable-php-5.2...sifo-2.1) + +**Merged pull requests:** + +- PHPUnit 3.5 + VisualPHPUnit [\#3](https://github.com/sifophp/SIFO/pull/3) ([thedae](https://github.com/thedae)) + +## [stable-php-5.2](https://github.com/sifophp/SIFO/tree/stable-php-5.2) (2011-10-06) + +[Full Changelog](https://github.com/sifophp/SIFO/compare/6a30ab66d5bef33d334090c58bf984fc78a86ef5...stable-php-5.2) + +**Merged pull requests:** + +- Added generated folder for static files in create\_instance script [\#2](https://github.com/sifophp/SIFO/pull/2) ([thedae](https://github.com/thedae)) +- Added generated folder for static files in create\_instance script [\#1](https://github.com/sifophp/SIFO/pull/1) ([thedae](https://github.com/thedae)) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/composer.json b/composer.json index f5b1fd0f..9a1d6299 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "psr/container": "^1.0", "sifophp/sifo-common-instance": "^2.14", "smarty/smarty": "^3.1", - "symfony/dotenv": "^5.0", + "symfony/dotenv": "^3.3.1|^4.3.1|^5.0.1", "symfony/yaml": "^3.2", "tpyo/amazon-s3-php-class": "^0.5", "twig/extensions": "^1.4", diff --git a/src/Sifo/Bootstrap.php b/src/Sifo/Bootstrap.php index 6198d1a0..6e6d643f 100644 --- a/src/Sifo/Bootstrap.php +++ b/src/Sifo/Bootstrap.php @@ -21,6 +21,8 @@ namespace Sifo; +use Psr\Container\ContainerInterface; + $is_defined_in_vhost = (false !== ini_get('newrelic.appname') && 'PHP Application' !== ini_get('newrelic.appname')); if ( !$is_defined_in_vhost && extension_loaded( 'newrelic' ) && isset( $instance ) ) { @@ -78,7 +80,7 @@ class Bootstrap */ public static $container; - /** + /** * Starts the execution. Root path is passed to avoid recalculation. * * @param $instance_name @@ -93,7 +95,7 @@ public static function execute( $instance_name, $controller_name = null, $contai self::$root = ROOT_PATH; self::$application = dirname( __FILE__ ); self::$instance = $instance_name; - self::$container = $container ?? DependencyInjector::getInstance(); + static::setContainer($container); Benchmark::getInstance()->timingStart(); @@ -110,19 +112,20 @@ public static function execute( $instance_name, $controller_name = null, $contai * @return Controller * @throws Exception_DependencyInjector */ - public static function invokeController( $controller ) + public static function invokeController( $controller, $container = null ) { + static::setContainer($container); + $class = self::convertToControllerClassName( $controller ); - if (self::$container->has($class)) { - $controller = self::$container->get($class); + if (static::$container instanceof ContainerInterface && static::$container->has($class)) { + $controller = static::$container->get($class); + $controller->setContainer(static::$container); } else { /** @var Controller $controller */ $controller = new $class(); } - $controller->setContainer(self::$container); - return $controller; } @@ -160,10 +163,12 @@ private static function convertToControllerClassName( $controller ): string * * @param string $controller Dispatches a specific controller, or use URL to determine the controller */ - public static function dispatch( $controller = null ) + public static function dispatch( $controller = null, $container = null ) { try { + static::setContainer($container); + $domain = Domains::getInstance(); $destination = $domain->getRedirect(); @@ -288,9 +293,11 @@ public static function dispatch( $controller = null ) * * @return output buffer */ - private static function _dispatchErrorController( $e ) + private static function _dispatchErrorController( $e, $container = null ) { - if ( !isset( $e->http_code ) ) + static::setContainer($container); + + if ( !isset( $e->http_code ) ) { $e->http_code = 503; $e->http_code_msg = 'Exception!'; @@ -370,9 +377,16 @@ private static function _dispatchErrorController( $e ) */ private static function _overWritePHPini( Array $php_inis ) { - foreach ( $php_inis as $varname => $newvalue ) + foreach ( $php_inis as $varname => $newvalue ) { ini_set( $varname, $newvalue ); } } + + protected static function setContainer($container = null) + { + if (null === static::$container && null !== $container) { + static::$container = $container; + } + } } diff --git a/src/Sifo/CLBootstrap.php b/src/Sifo/CLBootstrap.php index d4d426f4..c1ba2673 100644 --- a/src/Sifo/CLBootstrap.php +++ b/src/Sifo/CLBootstrap.php @@ -19,14 +19,15 @@ class CLBootstrap extends Bootstrap * @param null $instance_name Name of the instance. Required for Bootsrap::execute compatibility. * @param null $controller_name Script that will be executed. Required for Bootsrap::execute compatibility. */ - public static function execute( $instance_name = null, $controller_name = null, $container = null ) + public static function execute( $instance_name = null, $controller_name = null, $psr_container = null ) { if ( !isset( $controller_name ) ) { $controller_name = self::$script_controller; } - self::$container = $container ?? DependencyInjector::getInstance(); + + self::$container = DependencyInjector::getInstance(null, $psr_container); // Set paths: self::$root = ROOT_PATH; @@ -42,7 +43,7 @@ public static function execute( $instance_name = null, $controller_name = null, * * @param string $controller Dispatches a specific controller. Defaults to null for compatibility with Bootstrap::dispatch */ - public static function dispatch( $controller = null ) + public static function dispatch( $controller = null, $container = null ) { // Set Timezone as required by php 5.1+ date_default_timezone_set('Europe/Madrid'); @@ -50,7 +51,8 @@ public static function dispatch( $controller = null ) self::$language = 'en_US'; // This is the controller to use: - $ctrl = self::invokeController( $controller ); + $ctrl = self::invokeController( $controller, $container ); + $ctrl->setContainer(static::$container); self::$controller = $controller; $ctrl->build(); diff --git a/src/Sifo/Controller.php b/src/Sifo/Controller.php index 11afe5b4..d64f0118 100644 --- a/src/Sifo/Controller.php +++ b/src/Sifo/Controller.php @@ -157,6 +157,7 @@ public function __construct() $this->cache = Cache::getInstance( Cache::CACHE_TYPE_AUTODISCOVER ); $this->view = new View(); + $this->container = DependencyInjector::getInstance(); } /** @@ -164,8 +165,11 @@ public function __construct() * * @param ContainerInterface $container The container to use. */ - public function setContainer(ContainerInterface $container) + public function setContainer($container = null) { + if (null === $container || null !== $this->container) { + return; + } $this->container = $container; } @@ -339,13 +343,17 @@ protected function cacheException( $e, $cache_key ) /** * Dispatch the controller. */ - public function dispatch() + public function dispatch($container = null) { if ( Domains::getInstance()->getDebugMode() && ( FilterGet::getInstance()->getInteger( 'kill_session' ) ) ) { @Session::getInstance()->destroy(); } + if (null === $this->container) { + $this->container = DependencyInjector::getInstance(null, $container); + } + if ( $this->is_json ) { // Set headers before cache: diff --git a/src/Sifo/DependencyInjector.php b/src/Sifo/DependencyInjector.php index 924dd2a2..4083d9f2 100644 --- a/src/Sifo/DependencyInjector.php +++ b/src/Sifo/DependencyInjector.php @@ -22,6 +22,7 @@ use Psr\Container\ContainerInterface; use Symfony\Component\Yaml\Yaml; +use function array_key_exists; /** * Handles the dependency injection. @@ -35,27 +36,35 @@ class DependencyInjector implements ContainerInterface * @static */ static protected $instance; - /** * Already instantiated container services. * * @var array * @static */ - static protected $container_instances = array(); - + static protected $container_instances = []; /** * Defined services. * * @var array */ protected $service_definitions; + /** @var null|ContainerInterface */ + private static $container; /** * Private constructor, use getInstance() instead to get an instance. */ - private function __construct() + private function __construct($container = null) { + if (null !== self::$container) { + return; + } + + self::$container = $container; + if (null === $container) { + $this->loadServiceDefinitions(); + } } /** @@ -70,17 +79,17 @@ private function __clone() * * @static * @param null $instance_name + * @param null|ContainerInterface $container * @return ContainerInterface|DependencyInjector Dependency injector instance. */ - public static function getInstance($instance_name = null) + public static function getInstance($instance_name = null, $container = null) { - if (null == $instance_name) - { + if (null == $instance_name) { $instance_name = Bootstrap::$instance; } if (!isset(self::$instance[$instance_name])) { - self::$instance[$instance_name] = new self; + self::$instance[$instance_name] = new self($container ?? self::$container); } return self::$instance[$instance_name]; @@ -96,8 +105,8 @@ public static function getInstance($instance_name = null) */ public function get($service_key, $get_private_service = false) { - if (!$this->service_definitions) { - $this->loadServiceDefinitions(); + if (null !== self::$container) { + return self::$container->get($service_key); } if (!array_key_exists($service_key, $this->service_definitions)) { @@ -136,10 +145,9 @@ private function loadingAPrivateService($service_key) private function loadServiceDefinitions() { try { - $environment_suffix = Domains::getInstance()->getDevMode() ? '_dev' : ''; + $environment_suffix = Domains::getInstance()->getDevMode() ? '_dev' : ''; $service_definitions = Config::getInstance()->getConfig('services/definition' . $environment_suffix); - } - catch (Exception_Configuration $e) { + } catch (Exception_Configuration $e) { $service_definitions = Config::getInstance()->getConfig('services/definition'); } @@ -155,23 +163,18 @@ private function loadServiceDefinitions() */ public function has($service) { - $service_exists = true; - - try { - Config::getInstance()->getConfig('services/definition', $service); - } - catch (Exception_Configuration $e) { - $service_exists = false; + if (null !== self::$container) { + return self::$container->has($service); } - return $service_exists; + return array_key_exists($service, $this->service_definitions); } + /** @deprecated */ public function servicesWithTag($tag_name) { - if (!isset($this->service_definitions['tags'][$tag_name])) - { - return array(); + if (!isset($this->service_definitions['tags'][$tag_name])) { + return []; } return $this->service_definitions['tags'][$tag_name]; @@ -190,11 +193,11 @@ private function usingTheContainerScope($service) */ public function generateDependenciesDeclaration() { - $domains = Domains::getInstance(); + $domains = Domains::getInstance(); $instances = array_slice($domains->getInstanceInheritance(), 1); foreach ($instances as $index => $instance) { - $parent_instance = $index > 0 ? $instances[$index - 1] : null; + $parent_instance = $index > 0 ? $instances[$index - 1] : null; $this->generateDependenciesDeclarationForInstance($instance, $parent_instance, ''); if ($domains->getDevMode()) { @@ -208,18 +211,17 @@ private function generateDependenciesDeclarationForInstance($instance, $parent_i $instance_yml_definitions_file = ROOT_PATH . '/instances/' . $instance . '/config/services/definition' . $files_suffix . '.yml'; $instance_php_definitions_file = ROOT_PATH . '/instances/' . $instance . '/config/services/definition' . $files_suffix . '.config.php'; - if (!file_exists($instance_yml_definitions_file)) - { + if (!file_exists($instance_yml_definitions_file)) { return; } $parsed_yaml_content = Yaml::parse(file_get_contents($instance_yml_definitions_file)); - $declared_services = $this->getImportedServices($parsed_yaml_content, $instance_yml_definitions_file); + $declared_services = $this->getImportedServices($parsed_yaml_content, $instance_yml_definitions_file); - $compiled_services = array(); - $scoped_definitions = array(); - $private_services = array(); - $tags_definition = array(); + $compiled_services = []; + $scoped_definitions = []; + $private_services = []; + $tags_definition = []; foreach ($declared_services as $service_key => $declaration) { if ($this->isALiteralDeclaration($declaration)) { @@ -228,28 +230,30 @@ private function generateDependenciesDeclarationForInstance($instance, $parent_i } if ($this->isAnAlias($declaration)) { - $aliased_service = ltrim($declaration['alias'], '@'); - $container_return_string = "return \$container->get('" . $aliased_service . "', true);"; + $aliased_service = ltrim($declaration['alias'], '@'); + $container_return_string = "return \$container->get('" . $aliased_service . "', true);"; $compiled_services[$service_key] = "function (\$container) {\n\x20\x20\x20\x20" . $container_return_string . "\n};"; continue; } - $class_name = '\\' . $declaration['class']; - $arguments = array_key_exists('arguments', $declaration) ? $declaration['arguments'] : array(); + $class_name = '\\' . $declaration['class']; + $arguments = array_key_exists('arguments', $declaration) ? $declaration['arguments'] : []; $compiled_arguments = $this->stringifyArguments($arguments, $compiled_services); if ($this->isASingleton($declaration)) { $class_instance_creation_statement = $class_name . "::" . $declaration['singleton']; - } else if ($this->isAFactory($declaration)) { - $factory_service = ltrim($declaration['factory'][0], '@'); - $factory_method = $declaration['factory'][1]; - $class_instance_creation_statement = "\$container->get('" . $factory_service . "', true)->" . $factory_method; } else { - $class_instance_creation_statement = "new " . $class_name; + if ($this->isAFactory($declaration)) { + $factory_service = ltrim($declaration['factory'][0], '@'); + $factory_method = $declaration['factory'][1]; + $class_instance_creation_statement = "\$container->get('" . $factory_service . "', true)->" . $factory_method; + } else { + $class_instance_creation_statement = "new " . $class_name; + } } $class_instance_creation_statement .= "(\n" . implode(",\n", $compiled_arguments) . "\n\x20\x20\x20\x20)"; - $service_return = '$service_instance = ' . $class_instance_creation_statement . ';'; + $service_return = '$service_instance = ' . $class_instance_creation_statement . ';'; if ($this->hasSetterInjections($declaration)) { $service_return .= $this->getSetterInjectionsCalls($declaration, $compiled_services); @@ -257,8 +261,7 @@ private function generateDependenciesDeclarationForInstance($instance, $parent_i if ($this->isAPrototypedDeclaration($declaration)) { $scoped_definitions[$service_key] = 'prototype'; - } - else { + } else { $scoped_definitions[$service_key] = 'container'; } @@ -268,7 +271,7 @@ private function generateDependenciesDeclarationForInstance($instance, $parent_i $tags_definition = $this->addAllDefinitionTags($tags_definition, $service_key, $declaration); - $service_return .= "\n\n\x20\x20\x20\x20" . 'return $service_instance;'; + $service_return .= "\n\n\x20\x20\x20\x20" . 'return $service_instance;'; $compiled_services[$service_key] = "function (\$container) {\n\x20\x20\x20\x20" . $service_return . "\n};"; } @@ -286,10 +289,9 @@ private function generateDependenciesDeclarationForInstance($instance, $parent_i private function stringifyArguments(array $arguments, array $compiled_services, $depth = 2) { - $compiled_arguments = array(); + $compiled_arguments = []; foreach ($arguments as $argument) { - if ($this->isAVariableArgument($argument)) { $compiled_arguments[] = $this->getVariableArgumentCompilation($argument); } elseif ($this->isALiteralArgument($argument)) { @@ -304,7 +306,7 @@ private function stringifyArguments(array $arguments, array $compiled_services, $compiled_arguments[] = str_repeat("\x20\x20\x20\x20", $depth) . "[\n" . $compiled_argument . str_repeat("\x20\x20\x20\x20", $depth) . ']'; } else { - $dependant_service = ltrim($argument, '@'); + $dependant_service = ltrim($argument, '@'); $compiled_arguments[] = str_repeat("\x20\x20\x20\x20", $depth) . "\$container->get('" . $dependant_service . "', true)"; } } @@ -317,16 +319,16 @@ public function getImportedServices($parsed_yaml_content, $parsed_yaml_path) $imports = is_array($parsed_yaml_content) ? array_key_exists('imports', $parsed_yaml_content) ? $parsed_yaml_content['imports'] - : array() - : array(); + : [] + : []; $services = is_array($parsed_yaml_content) ? array_key_exists('services', $parsed_yaml_content) ? $parsed_yaml_content['services'] - : array() - : array(); + : [] + : []; - $retrieved_services = array(); + $retrieved_services = []; if ($this->hasGroupedServicesByInstances($imports)) { foreach ($imports as $instance => $files_to_import) { @@ -353,7 +355,7 @@ private function hasGroupedServicesByInstances($imports) private function getServicesFromFilesCollection($config_files_path, array $files_to_import) { - $retrieved_services = array(); + $retrieved_services = []; foreach ($files_to_import as $file_to_import) { $imported_parsed_yaml_path = $config_files_path . $file_to_import; @@ -409,13 +411,11 @@ private function isAPrivateService($declaration) private function addAllDefinitionTags($tags_definition, $service_key, $declaration) { - if (!$this->hasTags($declaration)) - { + if (!$this->hasTags($declaration)) { return $tags_definition; } - foreach ($declaration["tags"] as $declaration_tag) - { + foreach ($declaration["tags"] as $declaration_tag) { $tags_definition = $this->addDeclarationTagDefinition($tags_definition, $service_key, $declaration_tag); } @@ -442,8 +442,7 @@ private function getSetterInjectionsCalls($declaration, $compiled_services) { $setter_injections_calls = ""; - foreach ($declaration['calls'] as $setter_injection) - { + foreach ($declaration['calls'] as $setter_injection) { $setter_injection_compiled_arguments = $this->stringifyArguments($setter_injection[1], $compiled_services); $class_instance_creation_statement = implode(",\n", $setter_injection_compiled_arguments); @@ -490,9 +489,9 @@ private function dumpConfigurationFile( $parent_instance, $files_suffix ) { - $dumped_configuration = " $service_tag_definition) - { - foreach ($service_tag_definition as $service_key => $all_tag_values) - { - if (empty($all_tag_values)) - { + foreach ($tags_definition as $tag_name => $service_tag_definition) { + foreach ($service_tag_definition as $service_key => $all_tag_values) { + if (empty($all_tag_values)) { $dumped_services .= "\$config['tags']['" . $tag_name . "']['" . $service_key . "'] = [];\n"; - } - else - { + } else { foreach ($all_tag_values as $tag_value_key => $tag_value_value) { $dumped_services .= "\$config['tags']['" . $tag_name . "']['" . $service_key . "']['" . $tag_value_key . "'] = '" . $tag_value_value . "';\n"; }