From 0f37d7741605e63fafb1d165def73d9533b62a02 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 25 Apr 2018 15:37:34 -0400 Subject: [PATCH 001/100] Ignore some files/directories. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c37eb12 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/composer.phar +/vendor/ +/build/ From f2d19c924247350b10ae4f79a6175c6e1f222492 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 25 Apr 2018 20:42:04 -0400 Subject: [PATCH 002/100] Add some desired shake configuration. --- shake.json | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/shake.json b/shake.json index 8b13789..15c7e64 100644 --- a/shake.json +++ b/shake.json @@ -1 +1,32 @@ - +{ + "package": "shake-php/autoloading", + "desc": "Autoloading made simple with Shake PHP. PSR-4 Compliant.", + "keyword": [ + "php72", + "shake-php", + "shake-autoloading", + "composer-alternative", + "secure-by-default", + "elegant-coding", + "psr-compliant", + "classmap", + "files" + ], + "license": "GPL-3.0", + "author": [ + { + "name": "Nicholas English", + "email": "nenglish6657@gmail.com", + "homepage": "https://github.com/inisik", + "role": "Develop" + } + ], + "autoload": { + "classmap": [ + "./src" + ] + }, + "require": { + "php": ">=7.2" + } +} From b97ef660ede14143d31c5f3a0c4920f9eb96e5c7 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 25 Apr 2018 20:42:28 -0400 Subject: [PATCH 003/100] Create ClassmapAutoloading.php --- src/ClassmapAutoloading.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/ClassmapAutoloading.php diff --git a/src/ClassmapAutoloading.php b/src/ClassmapAutoloading.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/ClassmapAutoloading.php @@ -0,0 +1 @@ + From 764102de1b032a1534036c0194681785e3df3f20 Mon Sep 17 00:00:00 2001 From: inisik Date: Thu, 26 Apr 2018 01:09:50 -0400 Subject: [PATCH 004/100] Create .gitkeep --- bin/classmap/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/classmap/.gitkeep diff --git a/bin/classmap/.gitkeep b/bin/classmap/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/classmap/.gitkeep @@ -0,0 +1 @@ + From 7ded6218817bf84b36ca34f623f3d31f65369cc1 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 01:57:41 -0400 Subject: [PATCH 005/100] Create process.php --- bin/process.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/process.php diff --git a/bin/process.php b/bin/process.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/process.php @@ -0,0 +1 @@ + From a2e0aedf63a95fd7267dbd6388eb54b7230ab255 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 02:14:46 -0400 Subject: [PATCH 006/100] Update ClassmapAutoloading.php --- src/ClassmapAutoloading.php | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/ClassmapAutoloading.php b/src/ClassmapAutoloading.php index 8b13789..163f8e1 100644 --- a/src/ClassmapAutoloading.php +++ b/src/ClassmapAutoloading.php @@ -1 +1,69 @@ +. + * @link . + */ +/** + * @class ClassmapAutoloading. + * + * Classmap autoloader. + */ +class ClassmapAutoloading extends AbstractAutoloader +{ + + /** + * @var array $classmapLoadData The classmap load data. + */ + private $classmapLoadData = array(); + + /** + * Set the configuration options for the autoloader. + * + * @link . + * + * @param array $array An array of options. + * + * @return bool Returns TRUE on success or FALSE on failure. + */ + protected function setOptions(array $array = array()): bool { + $this->classmapLoadData = $array; + return true; + } + + /** + * Run the autoloader. + * + * @link . + * + * @param string $k The class name. + * + * @return void Return nothing. + */ + protected function load(string $k): void { + /** + * @var string $baseDir + */ + foreach ($this->classmapLoadData as $baseDir) { + /** + * @var int $len + * @var string $monolog + */ + $file = $baseDir . DIRECTORY_SEPARATOR . str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $k) . '.php'; + $this->try($file); + } + } + + /** + * Get the autoloader information. + * + * @return array An array of information from the autoloader. + */ + public function getInfo(): array { + return array('optionsPassed' => $this->classmapLoadData); + } +} From ac01d383cef31ec55270f7837f19f5b6b5ee55aa Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 02:15:15 -0400 Subject: [PATCH 007/100] Use OS Separators. --- src/Psr4Autoloading.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psr4Autoloading.php b/src/Psr4Autoloading.php index 8b6d7a9..b355851 100644 --- a/src/Psr4Autoloading.php +++ b/src/Psr4Autoloading.php @@ -62,7 +62,7 @@ protected function load(string $k): void { if (strncmp((string) $monolog, $k, $len) !== 0) continue; $relativeClass = substr($k, $len); - $file = $baseDir . DIRECTORY_SEPARATOR . str_replace('\\', '/', $relativeClass) . '.php'; + $file = $baseDir . DIRECTORY_SEPARATOR . str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $relativeClass) . '.php'; $this->try($file); } } From aeb7fc4ab1db7773c6ef00ef65296dc4a1e06418 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 02:16:06 -0400 Subject: [PATCH 008/100] Break the cycle if the file is found. --- src/Psr4Autoloading.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Psr4Autoloading.php b/src/Psr4Autoloading.php index b355851..36f4c2e 100644 --- a/src/Psr4Autoloading.php +++ b/src/Psr4Autoloading.php @@ -63,7 +63,8 @@ protected function load(string $k): void { continue; $relativeClass = substr($k, $len); $file = $baseDir . DIRECTORY_SEPARATOR . str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $relativeClass) . '.php'; - $this->try($file); + if ($this->try($file)) + break; } } From e4aa2a4327401f1ea305eb5daaab9113f7ab2417 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 02:16:52 -0400 Subject: [PATCH 009/100] Break the cycle if the file exists. --- src/ClassmapAutoloading.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ClassmapAutoloading.php b/src/ClassmapAutoloading.php index 163f8e1..02ac926 100644 --- a/src/ClassmapAutoloading.php +++ b/src/ClassmapAutoloading.php @@ -54,7 +54,8 @@ protected function load(string $k): void { * @var string $monolog */ $file = $baseDir . DIRECTORY_SEPARATOR . str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $k) . '.php'; - $this->try($file); + if ($this->try($file)) + break; } } From b873bf90664ef4ee9105814f9b925f817b352561 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 02:17:31 -0400 Subject: [PATCH 010/100] Be able to return false. --- src/AbstractAutoloader.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AbstractAutoloader.php b/src/AbstractAutoloader.php index d2fd2d9..bd83b23 100644 --- a/src/AbstractAutoloader.php +++ b/src/AbstractAutoloader.php @@ -71,8 +71,10 @@ protected function try(string $file): bool { /** * @psalm-suppress UnresolvableInclude */ - if (file_exists($file)) + if (file_exists($file)) { include_once $file; - return true; + return true; + } + return false; } } From d03cdb7809af9d591c318a6cf71e6e6bfaaea929 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:16:07 -0400 Subject: [PATCH 011/100] Fix doctypes. --- src/ClassmapAutoloading.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ClassmapAutoloading.php b/src/ClassmapAutoloading.php index 02ac926..15403d5 100644 --- a/src/ClassmapAutoloading.php +++ b/src/ClassmapAutoloading.php @@ -49,10 +49,6 @@ protected function load(string $k): void { * @var string $baseDir */ foreach ($this->classmapLoadData as $baseDir) { - /** - * @var int $len - * @var string $monolog - */ $file = $baseDir . DIRECTORY_SEPARATOR . str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $k) . '.php'; if ($this->try($file)) break; From 921e496343aed57f53c8fd025b9b18737cef8944 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:18:09 -0400 Subject: [PATCH 012/100] Create test1.php --- bin/classmap/test1.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/classmap/test1.php diff --git a/bin/classmap/test1.php b/bin/classmap/test1.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/classmap/test1.php @@ -0,0 +1 @@ + From 696a3aafe35d931efc72c74ee4aa5ed0c25ee5bb Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:18:22 -0400 Subject: [PATCH 013/100] Create test2.php --- bin/classmap/test2.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/classmap/test2.php diff --git a/bin/classmap/test2.php b/bin/classmap/test2.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/classmap/test2.php @@ -0,0 +1 @@ + From 93dec1f7c6c2c8b8821eef49301f2d6ea71bcecb Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:18:38 -0400 Subject: [PATCH 014/100] Create test1.php --- bin/classmap/extra/test1.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/classmap/extra/test1.php diff --git a/bin/classmap/extra/test1.php b/bin/classmap/extra/test1.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/classmap/extra/test1.php @@ -0,0 +1 @@ + From 1dbc261336a243a5fc1f805d0e59c3b5ba5dfe57 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:18:51 -0400 Subject: [PATCH 015/100] Create .gitkeep --- bin/classmap/extra/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/classmap/extra/.gitkeep diff --git a/bin/classmap/extra/.gitkeep b/bin/classmap/extra/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/classmap/extra/.gitkeep @@ -0,0 +1 @@ + From 373041431b07a66f651df7e7730a67649ea9d64c Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:19:02 -0400 Subject: [PATCH 016/100] Create test2.php --- bin/classmap/extra/test2.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/classmap/extra/test2.php diff --git a/bin/classmap/extra/test2.php b/bin/classmap/extra/test2.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/classmap/extra/test2.php @@ -0,0 +1 @@ + From c131a8d18b984c8fa5ed4a38cfb1cd0adec8aef8 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:21:12 -0400 Subject: [PATCH 017/100] Add an autoloader list. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index bbcf990..31fec1c 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,8 @@ [![Coveralls github branch](https://img.shields.io/coveralls/github/shake-php/autoloading/master.svg)](https://coveralls.io/github/shake-php/autoloading) [![Latest Stable Version](https://poser.pugx.org/shake-php/autoloading/v/stable)](https://packagist.org/packages/shake-php/autoloading) [![License](https://poser.pugx.org/shake-php/autoloading/license)](https://packagist.org/packages/shake-php/autoloading) + +### A list of autoloaders +- Psr4 Autoloader +- Classmap Autoloader +- Files Autoloader From bed8d19896ca07fc63f4e5b4f58ca9271b3ee695 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:21:40 -0400 Subject: [PATCH 018/100] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 31fec1c..77bbc19 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Latest Stable Version](https://poser.pugx.org/shake-php/autoloading/v/stable)](https://packagist.org/packages/shake-php/autoloading) [![License](https://poser.pugx.org/shake-php/autoloading/license)](https://packagist.org/packages/shake-php/autoloading) -### A list of autoloaders -- Psr4 Autoloader -- Classmap Autoloader -- Files Autoloader + +> - Psr4 Autoloader +> - Classmap Autoloader +? - Files Autoloader From f4064c01c05c362081762337854a038e05a5cde8 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:22:01 -0400 Subject: [PATCH 019/100] Update README.md From b8864f6756344e0d7e2cd1f230423d5b99b19ef7 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:22:14 -0400 Subject: [PATCH 020/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77bbc19..2f48196 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ > - Psr4 Autoloader > - Classmap Autoloader -? - Files Autoloader +> - Files Autoloader From f1f9d5b92c7cfbecbe82b51f8a5380a5c185c3c7 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 10:25:31 -0400 Subject: [PATCH 021/100] Create AutoloadManager.php --- src/AutoloadManager.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/AutoloadManager.php diff --git a/src/AutoloadManager.php b/src/AutoloadManager.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/AutoloadManager.php @@ -0,0 +1 @@ + From fc98f0be245d9afe1b803b7ed2ae1032e6155b21 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 17:52:32 -0400 Subject: [PATCH 022/100] Add some processing functions. --- bin/process.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bin/process.php b/bin/process.php index 8b13789..4240726 100644 --- a/bin/process.php +++ b/bin/process.php @@ -1 +1,24 @@ +. + * @link . + */ + +namespace ShakeAutoloadingProcess239471002934583901294880124975124; + +function psr4(array $options = array()): void { + (new Psr4Autoloading)->register($options); +} + +function files(array $options = array()): viod { + (new FilesAutoloading)->register($options); +} + +function classmap(array $options = array()): void { + (new ClassmapAutoloading)->register($options); +} From e3b6c427e57615b24db46d28a73c8dba6c80bcc8 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 17:53:34 -0400 Subject: [PATCH 023/100] Use classes in global scope. --- bin/process.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/process.php b/bin/process.php index 4240726..465def6 100644 --- a/bin/process.php +++ b/bin/process.php @@ -11,14 +11,14 @@ namespace ShakeAutoloadingProcess239471002934583901294880124975124; function psr4(array $options = array()): void { - (new Psr4Autoloading)->register($options); + (new \Psr4Autoloading)->register($options); } function files(array $options = array()): viod { - (new FilesAutoloading)->register($options); + (new \FilesAutoloading)->register($options); } function classmap(array $options = array()): void { - (new ClassmapAutoloading)->register($options); + (new \ClassmapAutoloading)->register($options); } From e44f20f8ca25efe96d83890ec911f315b464e70b Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 17:56:32 -0400 Subject: [PATCH 024/100] Update and rename test1.php to Test.php --- bin/classmap/Test.php | 18 ++++++++++++++++++ bin/classmap/test1.php | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 bin/classmap/Test.php delete mode 100644 bin/classmap/test1.php diff --git a/bin/classmap/Test.php b/bin/classmap/Test.php new file mode 100644 index 0000000..24f8af6 --- /dev/null +++ b/bin/classmap/Test.php @@ -0,0 +1,18 @@ +. + * @link . + */ + +namespace Inisik\ClassmapTest; + +/** + * @class Test + */ +class Test +{ +} diff --git a/bin/classmap/test1.php b/bin/classmap/test1.php deleted file mode 100644 index 8b13789..0000000 --- a/bin/classmap/test1.php +++ /dev/null @@ -1 +0,0 @@ - From 7f3ed9f693b7166384d3403ebfeda15ed4047cbc Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 17:56:58 -0400 Subject: [PATCH 025/100] Update and rename test2.php to Test2.php --- bin/classmap/Test2.php | 19 +++++++++++++++++++ bin/classmap/test2.php | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 bin/classmap/Test2.php delete mode 100644 bin/classmap/test2.php diff --git a/bin/classmap/Test2.php b/bin/classmap/Test2.php new file mode 100644 index 0000000..ef5a30b --- /dev/null +++ b/bin/classmap/Test2.php @@ -0,0 +1,19 @@ + +. + * @link . + */ + +namespace Inisik\ClassmapTest; + +/** + * @class Test2 + */ +class Test2 +{ +} diff --git a/bin/classmap/test2.php b/bin/classmap/test2.php deleted file mode 100644 index 8b13789..0000000 --- a/bin/classmap/test2.php +++ /dev/null @@ -1 +0,0 @@ - From 411abeedb60db347ac24b4166041542fb5f3852f Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 17:57:49 -0400 Subject: [PATCH 026/100] Update and rename test1.php to Test.php --- bin/classmap/extra/Test.php | 18 ++++++++++++++++++ bin/classmap/extra/test1.php | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 bin/classmap/extra/Test.php delete mode 100644 bin/classmap/extra/test1.php diff --git a/bin/classmap/extra/Test.php b/bin/classmap/extra/Test.php new file mode 100644 index 0000000..24f8af6 --- /dev/null +++ b/bin/classmap/extra/Test.php @@ -0,0 +1,18 @@ +. + * @link . + */ + +namespace Inisik\ClassmapTest; + +/** + * @class Test + */ +class Test +{ +} diff --git a/bin/classmap/extra/test1.php b/bin/classmap/extra/test1.php deleted file mode 100644 index 8b13789..0000000 --- a/bin/classmap/extra/test1.php +++ /dev/null @@ -1 +0,0 @@ - From f5db36ea5771ee4325d4db4e29b3877e951804de Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 17:58:14 -0400 Subject: [PATCH 027/100] Update and rename test2.php to Test2.php --- bin/classmap/extra/Test2.php | 18 ++++++++++++++++++ bin/classmap/extra/test2.php | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 bin/classmap/extra/Test2.php delete mode 100644 bin/classmap/extra/test2.php diff --git a/bin/classmap/extra/Test2.php b/bin/classmap/extra/Test2.php new file mode 100644 index 0000000..ebf5503 --- /dev/null +++ b/bin/classmap/extra/Test2.php @@ -0,0 +1,18 @@ +. + * @link . + */ + +namespace Inisik\ClassmapTest; + +/** + * @class Test2 + */ +class Test2 +{ +} diff --git a/bin/classmap/extra/test2.php b/bin/classmap/extra/test2.php deleted file mode 100644 index 8b13789..0000000 --- a/bin/classmap/extra/test2.php +++ /dev/null @@ -1 +0,0 @@ - From 1783ac8c5a698846f75a189ac95a5f29bc957395 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:00:44 -0400 Subject: [PATCH 028/100] Update and rename Test.php to Test3.php --- bin/classmap/extra/{Test.php => Test3.php} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename bin/classmap/extra/{Test.php => Test3.php} (91%) diff --git a/bin/classmap/extra/Test.php b/bin/classmap/extra/Test3.php similarity index 91% rename from bin/classmap/extra/Test.php rename to bin/classmap/extra/Test3.php index 24f8af6..15ab73c 100644 --- a/bin/classmap/extra/Test.php +++ b/bin/classmap/extra/Test3.php @@ -11,8 +11,8 @@ namespace Inisik\ClassmapTest; /** - * @class Test + * @class Test3 */ -class Test +class Test3 { } From 89afac938f66c5015b4efc3d398005bbc98b8b9f Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:01:01 -0400 Subject: [PATCH 029/100] Update and rename Test2.php to Test4.php --- bin/classmap/extra/{Test2.php => Test4.php} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename bin/classmap/extra/{Test2.php => Test4.php} (91%) diff --git a/bin/classmap/extra/Test2.php b/bin/classmap/extra/Test4.php similarity index 91% rename from bin/classmap/extra/Test2.php rename to bin/classmap/extra/Test4.php index ebf5503..a647a4a 100644 --- a/bin/classmap/extra/Test2.php +++ b/bin/classmap/extra/Test4.php @@ -11,8 +11,8 @@ namespace Inisik\ClassmapTest; /** - * @class Test2 + * @class Test4 */ -class Test2 +class Test4 { } From 95337852ce4ae6fde52c3175f36be5bf1dfd30a1 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:03:39 -0400 Subject: [PATCH 030/100] Create ClassmapTest.php --- tests/ClassmapTest.php | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/ClassmapTest.php diff --git a/tests/ClassmapTest.php b/tests/ClassmapTest.php new file mode 100644 index 0000000..d04cc6e --- /dev/null +++ b/tests/ClassmapTest.php @@ -0,0 +1,49 @@ +. + * @link . + */ + +class Psr4Test extends PHPUnit\Framework\TestCase +{ + + public function testRegistry(): void + { + + // Test using an empty option configuration. + // This will cover the set options function in the ClassmapAutoloading + // class. + (new ClassmapAutoloading)->register(/* No options are going to be passed. */); + + // Return test result. + $this->assertTrue(true); + + // Classmap to run. + $map = array( + __DIR__ . '/../bin/classmap/extra', + __DIR__ . '/../bin/classmap' + ); + + // Try to register it with the new options configuration. + (new ClassmapAutoloading)->register($map); + + // Try to use a class. + $result = new Inisik\ClassmapTest\Test; + $result = new Inisik\ClassmapTest\Test2; + $result = new Inisik\ClassmapTest\Test3; + $result = new Inisik\ClassmapTest\Test4; + + // Return test result. + $this->assertTrue(true); + + // Test getInfo. + (new ClassmapAutoloading)->getInfo(); + + // Return test result. + $this->assertTrue(true); + } +} From 64e620b9f4f45fec51b7492593e5e620a02567e9 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:03:55 -0400 Subject: [PATCH 031/100] Update ClassmapTest.php --- tests/ClassmapTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ClassmapTest.php b/tests/ClassmapTest.php index d04cc6e..83bf15b 100644 --- a/tests/ClassmapTest.php +++ b/tests/ClassmapTest.php @@ -8,7 +8,7 @@ * @link . */ -class Psr4Test extends PHPUnit\Framework\TestCase +class ClassmapTest extends PHPUnit\Framework\TestCase { public function testRegistry(): void From fe0e14f092dd3476444c419459f5d141b26a58e4 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:13:30 -0400 Subject: [PATCH 032/100] Fix autoloader. --- src/ClassmapAutoloading.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ClassmapAutoloading.php b/src/ClassmapAutoloading.php index 15403d5..4b74ab7 100644 --- a/src/ClassmapAutoloading.php +++ b/src/ClassmapAutoloading.php @@ -45,6 +45,9 @@ protected function setOptions(array $array = array()): bool { * @return void Return nothing. */ protected function load(string $k): void { + $replace = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $k); + $parts = explode(DIRECTORY_SEPARATOR, $replace); + $k = end($parts); /** * @var string $baseDir */ From 0b7df0ed4dad980ce35063ed98b2e80479792148 Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:15:11 -0400 Subject: [PATCH 033/100] Fix headers first. --- bin/classmap/Test2.php | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/classmap/Test2.php b/bin/classmap/Test2.php index ef5a30b..ebf5503 100644 --- a/bin/classmap/Test2.php +++ b/bin/classmap/Test2.php @@ -1,4 +1,3 @@ - Date: Mon, 30 Apr 2018 18:50:30 -0400 Subject: [PATCH 034/100] Create function_reference.php --- bin/function_reference.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 bin/function_reference.php diff --git a/bin/function_reference.php b/bin/function_reference.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bin/function_reference.php @@ -0,0 +1 @@ + From 413bd7af4244e8b3bf6563d843448cd01cf86faa Mon Sep 17 00:00:00 2001 From: inisik Date: Mon, 30 Apr 2018 18:51:40 -0400 Subject: [PATCH 035/100] Load some bin files. --- composer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composer.json b/composer.json index dc4af5d..ee65105 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,10 @@ "autoload": { "classmap": [ "./src" + ], + "files": [ + "./bin/process.php", + "./bin/function_reference.php" ] }, "require": { From ca2a5305915642d9ac2e12af7eab60ac88114621 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 18:25:24 -0400 Subject: [PATCH 036/100] Update README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 2f48196..4a075b5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,32 @@ [![Latest Stable Version](https://poser.pugx.org/shake-php/autoloading/v/stable)](https://packagist.org/packages/shake-php/autoloading) [![License](https://poser.pugx.org/shake-php/autoloading/license)](https://packagist.org/packages/shake-php/autoloading) +## Installation +via Shake: +> This method is not avaliable. +via Composer: +```sh +composer require shake-php/autoloading +``` + +## Autoloaders > - Psr4 Autoloader > - Classmap Autoloader > - Files Autoloader + +## Psr4 Autoloading +Using the psr4 autoloader is similiar to composers psr4 autoloader. First we should create the autoloader instance before pushing the configuration. + +```php + Date: Tue, 1 May 2018 18:30:34 -0400 Subject: [PATCH 037/100] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 4a075b5..c83bf77 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,11 @@ $psr4autoload = new Psr4Autoloading(); // ... ``` +After that you need to create a configuration for the autoloader. Below is what the configuration array should look like. +```php + +$config = array( + 'The monolog.' => 'The base directory.', + 'Another monolog' => 'Another base directory.', + // ... // +); From 8f877826614ccacb70cb52010680ee7c9336d701 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 18:31:53 -0400 Subject: [PATCH 038/100] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c83bf77..74ed5ef 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,7 @@ $config = array( 'Another monolog' => 'Another base directory.', // ... // ); + +``` + +This config should follow the psr4 standards. You can view it (https://www.php-fig.org/psr/psr-4/)[here]. From a74593f656bba97ed02aa60ea5f7452fbbf9b5c0 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 18:32:39 -0400 Subject: [PATCH 039/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74ed5ef..41ae251 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ $config = array( ``` -This config should follow the psr4 standards. You can view it (https://www.php-fig.org/psr/psr-4/)[here]. +This config should follow the psr4 standards. You can view it (here)[https://www.php-fig.org/psr/psr-4/]. From b45adf130805e1950bb1711bdf55b2d97e29acbc Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 18:33:47 -0400 Subject: [PATCH 040/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41ae251..d1d13f8 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ $config = array( ``` -This config should follow the psr4 standards. You can view it (here)[https://www.php-fig.org/psr/psr-4/]. +This config should follow the psr4 standards. You can view it [here](https://www.php-fig.org/psr/psr-4/). From e20fa37f68909463df7d937bb3a4cb477d4cc4de Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 18:46:37 -0400 Subject: [PATCH 041/100] Update README.md --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1d13f8..5b8776a 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,39 @@ $config = array( ``` -This config should follow the psr4 standards. You can view it [here](https://www.php-fig.org/psr/psr-4/). +This config should follow the psr4 standards. You can view it [here](https://www.php-fig.org/psr/psr-4/). Below is an example of the configuration array. The examples were taken [here](https://www.php-fig.org/psr/psr-4/#3-examples). + +```php + './acme-log-writer/lib/', + 'Aura\\Web' => '/path/to/aura-web/src/', + 'Symfony\\Core' => './vendor/Symfony/Core/', + 'Zend' => '/usr/includes/Zend/', +); + +(new Psr4Autoloading)->register($config); + +$result1 = new Acme\Log\Writer\File_Writer; +$result2 = new Aura\Web\Response\Status; +$result3 = new Symfony\Core\Request; +$result4 = new Zend\Acl; + +``` + +The above is equivalent to. + +```php + Date: Tue, 1 May 2018 18:47:09 -0400 Subject: [PATCH 042/100] Fix styles. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b8776a..642ca83 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,9 @@ This config should follow the psr4 standards. You can view it [here](https://www $config = array( 'Acme\\Log\\Writer' => './acme-log-writer/lib/', - 'Aura\\Web' => '/path/to/aura-web/src/', - 'Symfony\\Core' => './vendor/Symfony/Core/', - 'Zend' => '/usr/includes/Zend/', + 'Aura\\Web' => '/path/to/aura-web/src/', + 'Symfony\\Core' => './vendor/Symfony/Core/', + 'Zend' => '/usr/includes/Zend/', ); (new Psr4Autoloading)->register($config); From 9ca34cdde9b31b2ef80c790924fa970ef04dbb94 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 18:47:34 -0400 Subject: [PATCH 043/100] Fix styles. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 642ca83..906c2dc 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ After that you need to create a configuration for the autoloader. Below is what ```php $config = array( - 'The monolog.' => 'The base directory.', - 'Another monolog' => 'Another base directory.', + 'The monolog.' => 'The base directory.', + 'Another monolog.' => 'Another base directory.', // ... // ); From 1b68cca355bc83c9d551bc389e73f4d17f447313 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:10:02 -0400 Subject: [PATCH 044/100] Update README.md --- README.md | 83 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 906c2dc..60a22b3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,10 @@ [![Latest Stable Version](https://poser.pugx.org/shake-php/autoloading/v/stable)](https://packagist.org/packages/shake-php/autoloading) [![License](https://poser.pugx.org/shake-php/autoloading/license)](https://packagist.org/packages/shake-php/autoloading) +The shake autoloader is to make autoloading of classes and files easy. + ## Installation + via Shake: > This method is not avaliable. @@ -15,12 +18,14 @@ composer require shake-php/autoloading ``` ## Autoloaders + > - Psr4 Autoloader > - Classmap Autoloader > - Files Autoloader -## Psr4 Autoloading -Using the psr4 autoloader is similiar to composers psr4 autoloader. First we should create the autoloader instance before pushing the configuration. +## Getting Started + +First we should include the autoload file. ```php './acme-log-writer/lib/', - 'Aura\\Web' => '/path/to/aura-web/src/', - 'Symfony\\Core' => './vendor/Symfony/Core/', - 'Zend' => '/usr/includes/Zend/', + 'The monolog.' => 'The base directory.', + 'Another monolog.' => 'Another base directory.', + // ... // ); (new Psr4Autoloading)->register($config); -$result1 = new Acme\Log\Writer\File_Writer; -$result2 = new Aura\Web\Response\Status; -$result3 = new Symfony\Core\Request; -$result4 = new Zend\Acl; +// If the class `FooBar` has the same monolog as one in the config and exists in the base directory +// assigned to the monolog it will include it. + +$foobar = new My\Monolog\FooBar(); + +``` + +## Classmap Autoloading + +The classmap autoloader is exactly like the classmap autoloader. The configuration setup is just like the psr4 autoloader configuration. The only difference is you only specify the directory in with the autoloader will scan for the requested class. Down below is an example. + +```php +// ... // + +$config = array( + 'The base directory.', + 'Another base directory.', + // ... // +); + +(new ClassmapAutoloading)->register($config); +// If the class `FooBar` exists in one of the specified directorys it will include the file `FooBar.php` in the +// base directory. + +$foobar = new FooBar(); ``` -The above is equivalent to. +## Files Autoloading + +The files autoloader will autoload on the first chance it gets. Down below is a basic example. The configuration array is going to be the location of the files. If the file exists then include it. ```php register($config); ``` -With Psr4 it will only include it when you use it. +## License -## Classmap Autoloading +Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. + +## Links + +- https://packagist.org/packages/shake-php/autoloading +- Shake webiste does not exist yet. From d7e5f866c360a8902690f2240acd3f04510fcb59 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:12:18 -0400 Subject: [PATCH 045/100] Too much info. --- README.md | 87 ------------------------------------------------------- 1 file changed, 87 deletions(-) diff --git a/README.md b/README.md index 60a22b3..b1de274 100644 --- a/README.md +++ b/README.md @@ -23,93 +23,6 @@ composer require shake-php/autoloading > - Classmap Autoloader > - Files Autoloader -## Getting Started - -First we should include the autoload file. - -```php - 'The base directory.', - 'Another monolog.' => 'Another base directory.', - // ... // -); - -``` - -This config should follow the psr4 standards. You can view it [here](https://www.php-fig.org/psr/psr-4/). Below is an example of the configuration array. - -```php - 'The base directory.', - 'Another monolog.' => 'Another base directory.', - // ... // -); - -(new Psr4Autoloading)->register($config); - -// If the class `FooBar` has the same monolog as one in the config and exists in the base directory -// assigned to the monolog it will include it. - -$foobar = new My\Monolog\FooBar(); - -``` - -## Classmap Autoloading - -The classmap autoloader is exactly like the classmap autoloader. The configuration setup is just like the psr4 autoloader configuration. The only difference is you only specify the directory in with the autoloader will scan for the requested class. Down below is an example. - -```php -// ... // - -$config = array( - 'The base directory.', - 'Another base directory.', - // ... // -); - -(new ClassmapAutoloading)->register($config); - -// If the class `FooBar` exists in one of the specified directorys it will include the file `FooBar.php` in the -// base directory. - -$foobar = new FooBar(); -``` - -## Files Autoloading - -The files autoloader will autoload on the first chance it gets. Down below is a basic example. The configuration array is going to be the location of the files. If the file exists then include it. - -```php -register($config); -``` - ## License Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. From ee927a073441a900ed91ae8aeac628a63329faf3 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:12:42 -0400 Subject: [PATCH 046/100] Create .gitkeep --- docs/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/.gitkeep diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/docs/.gitkeep @@ -0,0 +1 @@ + From 6792f98acbff851057be214fb208111d0ed7b780 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:13:12 -0400 Subject: [PATCH 047/100] Delete .gitkeep --- docs/.gitkeep | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/.gitkeep diff --git a/docs/.gitkeep b/docs/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/docs/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - From c751c3f6a062468cf1cb689b6282711cb8dc6a25 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:19:20 -0400 Subject: [PATCH 048/100] Add documentation link. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b1de274..1efc9b5 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,5 @@ Permissions of this strong copyleft license are conditioned on making available ## Links - https://packagist.org/packages/shake-php/autoloading +- https://shake-php.github.io/shake.github.io/autoloading/index.html - Shake webiste does not exist yet. From a2a4f869091fbdb8975e8a086fdab7cf7b051d7c Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:21:40 -0400 Subject: [PATCH 049/100] Modify shake config. --- shake.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shake.json b/shake.json index 15c7e64..fd0cff4 100644 --- a/shake.json +++ b/shake.json @@ -1,7 +1,7 @@ { "package": "shake-php/autoloading", "desc": "Autoloading made simple with Shake PHP. PSR-4 Compliant.", - "keyword": [ + "keywords": [ "php72", "shake-php", "shake-autoloading", @@ -29,4 +29,7 @@ "require": { "php": ">=7.2" } + "config": { + "only-stable": true + } } From 1ff9479f518aa3c6148b3371a723973d504d335b Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:21:59 -0400 Subject: [PATCH 050/100] Fix JSON Syntax. --- shake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shake.json b/shake.json index fd0cff4..711ea73 100644 --- a/shake.json +++ b/shake.json @@ -28,7 +28,7 @@ }, "require": { "php": ">=7.2" - } + }, "config": { "only-stable": true } From 125a73e52545ab0e388f29dfc21e53e3484fefbc Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 19:22:27 -0400 Subject: [PATCH 051/100] Create elixir.xml --- elixir.xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 elixir.xml diff --git a/elixir.xml b/elixir.xml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/elixir.xml @@ -0,0 +1 @@ + From 422ad57fdb5b4d417ab8ae5a9829a507d68d674c Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 20:11:34 -0400 Subject: [PATCH 052/100] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1efc9b5..40bd710 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,3 @@ Permissions of this strong copyleft license are conditioned on making available - https://packagist.org/packages/shake-php/autoloading - https://shake-php.github.io/shake.github.io/autoloading/index.html -- Shake webiste does not exist yet. From b038004e40762159392d3430dd7ff95d7ac4bd8c Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 20:12:38 -0400 Subject: [PATCH 053/100] Allow function access. --- bin/function_reference.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bin/function_reference.php b/bin/function_reference.php index 8b13789..41f2649 100644 --- a/bin/function_reference.php +++ b/bin/function_reference.php @@ -1 +1,21 @@ +. + * @link . + */ +function psr4(array $options = array()): void { + (new \Psr4Autoloading)->register($options); +} + +function files(array $options = array()): viod { + (new \FilesAutoloading)->register($options); +} + +function classmap(array $options = array()): void { + (new \ClassmapAutoloading)->register($options); +} From 0e7db3dbdc3e96c1bd949189b8d824fbd66d5800 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 20:13:04 -0400 Subject: [PATCH 054/100] Already in global scope --- bin/function_reference.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/function_reference.php b/bin/function_reference.php index 41f2649..830fd4d 100644 --- a/bin/function_reference.php +++ b/bin/function_reference.php @@ -9,13 +9,13 @@ */ function psr4(array $options = array()): void { - (new \Psr4Autoloading)->register($options); + (new Psr4Autoloading)->register($options); } function files(array $options = array()): viod { - (new \FilesAutoloading)->register($options); + (new FilesAutoloading)->register($options); } function classmap(array $options = array()): void { - (new \ClassmapAutoloading)->register($options); + (new ClassmapAutoloading)->register($options); } From e14b7aa4da67e4cf1b091fa9a78fed9ebee595dd Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 20:16:00 -0400 Subject: [PATCH 055/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40bd710..a8bd728 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ composer require shake-php/autoloading > - Classmap Autoloader > - Files Autoloader -## License +## General Public License Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. From 1c565e5b2578210d35caf9ff090adc5226f4237f Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 20:28:47 -0400 Subject: [PATCH 056/100] Create SimpleAutoloading.php --- src/SimpleAutoloading.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/SimpleAutoloading.php diff --git a/src/SimpleAutoloading.php b/src/SimpleAutoloading.php new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/SimpleAutoloading.php @@ -0,0 +1 @@ + From db965e43d68b6931cb44902baafd8b83656a31ef Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 22:31:49 -0400 Subject: [PATCH 057/100] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a8bd728..e168be9 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ composer require shake-php/autoloading > - Psr4 Autoloader > - Classmap Autoloader > - Files Autoloader +> - Simple Autoloader ## General Public License From dfd1f662ec06d8886766b7b7ba41af14cf5ec90f Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 22:51:28 -0400 Subject: [PATCH 058/100] Delete elixir.xml --- elixir.xml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 elixir.xml diff --git a/elixir.xml b/elixir.xml deleted file mode 100644 index 8b13789..0000000 --- a/elixir.xml +++ /dev/null @@ -1 +0,0 @@ - From 40734122f3a66ba85a5bd46e7f981a06a13a4135 Mon Sep 17 00:00:00 2001 From: inisik Date: Tue, 1 May 2018 22:51:37 -0400 Subject: [PATCH 059/100] Delete shake.json --- shake.json | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 shake.json diff --git a/shake.json b/shake.json deleted file mode 100644 index 711ea73..0000000 --- a/shake.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "package": "shake-php/autoloading", - "desc": "Autoloading made simple with Shake PHP. PSR-4 Compliant.", - "keywords": [ - "php72", - "shake-php", - "shake-autoloading", - "composer-alternative", - "secure-by-default", - "elegant-coding", - "psr-compliant", - "classmap", - "files" - ], - "license": "GPL-3.0", - "author": [ - { - "name": "Nicholas English", - "email": "nenglish6657@gmail.com", - "homepage": "https://github.com/inisik", - "role": "Develop" - } - ], - "autoload": { - "classmap": [ - "./src" - ] - }, - "require": { - "php": ">=7.2" - }, - "config": { - "only-stable": true - } -} From f955321fa3c43ba15dc96e5974af5cac25aec90d Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 12:19:02 -0400 Subject: [PATCH 060/100] Delete SimpleAutoloading.php --- src/SimpleAutoloading.php | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/SimpleAutoloading.php diff --git a/src/SimpleAutoloading.php b/src/SimpleAutoloading.php deleted file mode 100644 index 8b13789..0000000 --- a/src/SimpleAutoloading.php +++ /dev/null @@ -1 +0,0 @@ - From 56746f06aabe18b2990332967dce90ef8d030b33 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 12:20:49 -0400 Subject: [PATCH 061/100] Update AutoloadManager.php --- src/AutoloadManager.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/AutoloadManager.php b/src/AutoloadManager.php index 8b13789..d5d73a8 100644 --- a/src/AutoloadManager.php +++ b/src/AutoloadManager.php @@ -1 +1,16 @@ +. + * @link . + */ +/** + * @class AutoloadManager. + */ +class AutoloadManager implements AutoloadManagerInterface +{ +} From 1a32d15108d90712398052995860f022b022d1ac Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 12:21:42 -0400 Subject: [PATCH 062/100] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e168be9..a8bd728 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ composer require shake-php/autoloading > - Psr4 Autoloader > - Classmap Autoloader > - Files Autoloader -> - Simple Autoloader ## General Public License From 1015d0c0e72386e8477d0485efc24811adcd97d9 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 12:24:11 -0400 Subject: [PATCH 063/100] Create AutoloadManagerInterface.php --- src/AutoloadManagerInterface.php | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/AutoloadManagerInterface.php diff --git a/src/AutoloadManagerInterface.php b/src/AutoloadManagerInterface.php new file mode 100644 index 0000000..e314d0f --- /dev/null +++ b/src/AutoloadManagerInterface.php @@ -0,0 +1,5 @@ + Date: Wed, 2 May 2018 12:26:41 -0400 Subject: [PATCH 064/100] Update AutoloadManagerInterface.php --- src/AutoloadManagerInterface.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/AutoloadManagerInterface.php b/src/AutoloadManagerInterface.php index e314d0f..66bea3f 100644 --- a/src/AutoloadManagerInterface.php +++ b/src/AutoloadManagerInterface.php @@ -1,5 +1,16 @@ . + * @link . + */ +/** + * @interface AutoloadManagerInterface. + */ interface AutoloadManagerInterface { } From 267ec42db5a86f249615898c5c6f037f042472b6 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 12:29:02 -0400 Subject: [PATCH 065/100] Create .gitkeep --- ext/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/.gitkeep diff --git a/ext/.gitkeep b/ext/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/.gitkeep @@ -0,0 +1 @@ + From 4277c16f67485fea2d853f19fb6c02e123ee76d9 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 12:32:36 -0400 Subject: [PATCH 066/100] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a8bd728..ca72f29 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The shake autoloader is to make autoloading of classes and files easy. ## Installation via Shake: -> This method is not avaliable. +> If you already use shake as your dependency manager it is already installed. via Composer: ```sh From 90ff07082893b2bc5f94e71e1471a6c5b2443474 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:00:55 -0400 Subject: [PATCH 067/100] Create config.m4 --- ext/config.m4 | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/config.m4 diff --git a/ext/config.m4 b/ext/config.m4 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/config.m4 @@ -0,0 +1 @@ + From f507f617b929a4e7d4e132a874eb9c5b368162a0 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:02:09 -0400 Subject: [PATCH 068/100] Create config.w32 --- ext/config.w32 | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/config.w32 diff --git a/ext/config.w32 b/ext/config.w32 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/config.w32 @@ -0,0 +1 @@ + From 459a9991d78a9402eb5b4f6519a493cef2e7c690 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:02:30 -0400 Subject: [PATCH 069/100] Delete .gitkeep --- ext/.gitkeep | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ext/.gitkeep diff --git a/ext/.gitkeep b/ext/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/ext/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - From 96246bc8bff6c63f1ae06e810feee782f8055bb0 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:03:23 -0400 Subject: [PATCH 070/100] Create php_shake_autoloading.h --- ext/php_shake_autoloading.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/php_shake_autoloading.h diff --git a/ext/php_shake_autoloading.h b/ext/php_shake_autoloading.h new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/php_shake_autoloading.h @@ -0,0 +1 @@ + From a00973a8903233e14269d96c3ea3a76ef1ab9a48 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:04:13 -0400 Subject: [PATCH 071/100] Add more files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c37eb12..e0ababd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/composer.json +/composer.lock /composer.phar /vendor/ /build/ From 0501e41217092831f4fcc7995d3f4e8ede59a512 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:05:13 -0400 Subject: [PATCH 072/100] Create package.xml --- ext/package.xml | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/package.xml diff --git a/ext/package.xml b/ext/package.xml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/package.xml @@ -0,0 +1 @@ + From e4dc9703c9c8b1db58848e9faf68a46d6f0118bc Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:09:02 -0400 Subject: [PATCH 073/100] Create shake_autoloading.c --- ext/shake_autoloading.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/shake_autoloading.c diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/shake_autoloading.c @@ -0,0 +1 @@ + From 82a4e12e42c182cd49d3c8a64ec6cddd53d8eaac Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 13:10:28 -0400 Subject: [PATCH 074/100] Create .gitkeep --- ext/extra/.gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/extra/.gitkeep diff --git a/ext/extra/.gitkeep b/ext/extra/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/extra/.gitkeep @@ -0,0 +1 @@ + From 25ec9005a8112a72a929bac4cc57e2fca9f320bd Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:31:32 -0400 Subject: [PATCH 075/100] Create shake_autoloading.ini --- ext/shake_autoloading.ini | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ext/shake_autoloading.ini diff --git a/ext/shake_autoloading.ini b/ext/shake_autoloading.ini new file mode 100644 index 0000000..ccb580a --- /dev/null +++ b/ext/shake_autoloading.ini @@ -0,0 +1,7 @@ +[PHP] + +extension=php_shake_autoloading + +disable_classmap_autoloading=0 +disable_files_autoloading=0 +disable_psr4_autoloading=0 From 527af39af41e27b2db0504412cbafd92402aab38 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:36:42 -0400 Subject: [PATCH 076/100] Include headers. --- ext/shake_autoloading.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index 8b13789..0d6bf10 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -1 +1,7 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "php.h" +#include "php_ini.h" +#include "php_shake_autoloading.h" From 8c7ed87fb784ec32d73fe653837371b624893b9e Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:44:28 -0400 Subject: [PATCH 077/100] Change function names. --- bin/function_reference.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/function_reference.php b/bin/function_reference.php index 830fd4d..0279479 100644 --- a/bin/function_reference.php +++ b/bin/function_reference.php @@ -8,14 +8,14 @@ * @link . */ -function psr4(array $options = array()): void { +function register_psr4_autoloader(array $options = array()): void { (new Psr4Autoloading)->register($options); } -function files(array $options = array()): viod { +function register_files_autoloader(array $options = array()): viod { (new FilesAutoloading)->register($options); } -function classmap(array $options = array()): void { +function register_classmap_autoloader(array $options = array()): void { (new ClassmapAutoloading)->register($options); } From dd210ea32864c88cd91c01144534d45e8cb0797b Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:45:13 -0400 Subject: [PATCH 078/100] Declare functions provided. --- ext/shake_autoloading.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index 0d6bf10..9fa3e55 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -5,3 +5,13 @@ #include "php.h" #include "php_ini.h" #include "php_shake_autoloading.h" + +#define PHP_SHAKE_AUTOLOADING_VERSION "1.1.2" +#define PHP_SHAKE_AUTOLOADING_EXTENSION_NAME "shake_autoloading" + +static function_entry hello_functions[] = { + PHP_FE(register_psr4_autoloader, NULL) + PHP_FE(register_files_autoloader, NULL) + PHP_FE(register_classmap_autoloader, NULL) + {NULL, NULL, NULL} +}; From 55fa713bd194e17ea18a3cbcdc4b8a7e30da9170 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:54:55 -0400 Subject: [PATCH 079/100] Update shake_autoloading.c --- ext/shake_autoloading.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index 9fa3e55..f95bb1e 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -9,7 +9,14 @@ #define PHP_SHAKE_AUTOLOADING_VERSION "1.1.2" #define PHP_SHAKE_AUTOLOADING_EXTENSION_NAME "shake_autoloading" -static function_entry hello_functions[] = { +extern zend_module_entry my_extension_module_entry; +#define phpext_my_extension_ptr &my_extension_module_entry + +PHP_FUNCTION(register_psr4_autoloader); +PHP_FUNCTION(register_files_autoloader); +PHP_FUNCTION(register_classmap_autoloader); + +static function_entry shake_autoloading_functions[] = { PHP_FE(register_psr4_autoloader, NULL) PHP_FE(register_files_autoloader, NULL) PHP_FE(register_classmap_autoloader, NULL) From 5001b007f0262a6bea27f2991a51a28764a673f0 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:56:39 -0400 Subject: [PATCH 080/100] Create psr4_autoloading.c --- ext/psr4_autoloading.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/psr4_autoloading.c diff --git a/ext/psr4_autoloading.c b/ext/psr4_autoloading.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/psr4_autoloading.c @@ -0,0 +1 @@ + From d84bada8cb2399c4a41a5aea495c7a100722ac08 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:56:56 -0400 Subject: [PATCH 081/100] Create classmap_autoloading.c --- ext/classmap_autoloading.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/classmap_autoloading.c diff --git a/ext/classmap_autoloading.c b/ext/classmap_autoloading.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/classmap_autoloading.c @@ -0,0 +1 @@ + From 05688b4928b5b886fcdb56dc34c404111c5d5a1b Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 15:57:18 -0400 Subject: [PATCH 082/100] Create files_autoloading.c --- ext/files_autoloading.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 ext/files_autoloading.c diff --git a/ext/files_autoloading.c b/ext/files_autoloading.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ext/files_autoloading.c @@ -0,0 +1 @@ + From d5b142f324e9e9497f287127d0374feb36473869 Mon Sep 17 00:00:00 2001 From: inisik Date: Wed, 2 May 2018 16:04:14 -0400 Subject: [PATCH 083/100] Update travis configuration. --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8ea297a..15224b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: php sudo: false dist: trusty +env: + matrix: + - SHAKE_AUTOLOADING_EXT=no + - SHAKE_AUTOLOADING_EXT=yes php: - 7.2 - nightly @@ -11,6 +15,9 @@ matrix: os: - windows - linux +before_script: + - if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then sh -c "cd ext && phpize && ./configure && make && sudo make install"; fi + - if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then echo "extension=php_shake_autoloading.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi install: - travis_retry composer install --no-interaction - wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar From ecd5bbba6496e43eb2fbb98796d3acc37d183168 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 01:27:07 -0400 Subject: [PATCH 084/100] Update shake_autoloading.c --- ext/shake_autoloading.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index f95bb1e..87cfc3f 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -22,3 +22,25 @@ static function_entry shake_autoloading_functions[] = { PHP_FE(register_classmap_autoloader, NULL) {NULL, NULL, NULL} }; + +zend_module_entry my_extension_module_entry = { +#if ZEND_MODULE_API_NO >= 20010901 + STANDARD_MODULE_HEADER, +#endif + PHP_SHAKE_AUTOLOADING_EXTENSION_NAME, + shake_autoloading_functions, + NULL, + NULL, + NULL, + NULL, + NULL, +#if ZEND_MODULE_API_NO >= 20010901 + PHP_SHAKE_AUTOLOADING_VERSION, +#endif + STANDARD_MODULE_PROPERTIES +}; + +PHP_FUNCTION(register_psr4_autoloader) +{ + RETURN_STRING("This is my function", 1); +} From 6c21c2ba7851e25de8026c7e3198c56d5359d715 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 01:28:31 -0400 Subject: [PATCH 085/100] Add extension configuration --- ext/config.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/config.m4 b/ext/config.m4 index 8b13789..a2b656b 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -1 +1,4 @@ - +if test "$PHP_SHAKE_AUTOLOADING" = "yes"; then + AC_DEFINE(HAVE_SHAKE_AUTOLOADING, 1, [Whether you have Slobel]) + PHP_NEW_EXTENSION(shake_autoloading, shake_autoloading.c, $ext_shared) +fi From 6d8a196c74e0d2f94be1698f227eb1c91cd60578 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 01:32:16 -0400 Subject: [PATCH 086/100] Update php_shake_autoloading.h --- ext/php_shake_autoloading.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/php_shake_autoloading.h b/ext/php_shake_autoloading.h index 8b13789..ce1862a 100644 --- a/ext/php_shake_autoloading.h +++ b/ext/php_shake_autoloading.h @@ -1 +1,11 @@ +#ifndef PHP_SHAKE_AUTOLOADING_H +#define PHP_SHAKE_AUTOLOADING_H 1 +extern zend_module_entry shake_autoloading_module_entry; +#define phpext_shake_autoloading_ptr &shake_autoloading_module_entry + +#ifdef ZTS +#include "TSRM.h" +#endif + +#endif From 208168bfe811e503eaa5c42701be8a16f4455d33 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 01:35:12 -0400 Subject: [PATCH 087/100] Update shake_autoloading.c --- ext/shake_autoloading.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index 87cfc3f..c8f41f6 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -9,8 +9,8 @@ #define PHP_SHAKE_AUTOLOADING_VERSION "1.1.2" #define PHP_SHAKE_AUTOLOADING_EXTENSION_NAME "shake_autoloading" -extern zend_module_entry my_extension_module_entry; -#define phpext_my_extension_ptr &my_extension_module_entry +extern zend_module_entry shake_autoloading_module_entry; +#define phpext_shake_autoloading_ptr &shake_autoloading_module_entry PHP_FUNCTION(register_psr4_autoloader); PHP_FUNCTION(register_files_autoloader); @@ -23,13 +23,11 @@ static function_entry shake_autoloading_functions[] = { {NULL, NULL, NULL} }; -zend_module_entry my_extension_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 +zend_module_entry slobel_module_entry = { STANDARD_MODULE_HEADER, -#endif PHP_SHAKE_AUTOLOADING_EXTENSION_NAME, shake_autoloading_functions, - NULL, + PHP_MINIT(slobel_init), NULL, NULL, NULL, From cf38dfd0d8aa1fae8a96802023065eb1d5f38a14 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 01:39:07 -0400 Subject: [PATCH 088/100] Update shake_autoloading.c --- ext/shake_autoloading.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index c8f41f6..5d3df7c 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -4,6 +4,9 @@ #include "php.h" #include "php_ini.h" +#include "psr4_autoloading.c" +#include "files_autoloading.c" +#include "classmap_autoloading.c" #include "php_shake_autoloading.h" #define PHP_SHAKE_AUTOLOADING_VERSION "1.1.2" @@ -38,7 +41,19 @@ zend_module_entry slobel_module_entry = { STANDARD_MODULE_PROPERTIES }; +#ifdef COMPILE_DL_SHAKE_AUTOLOADING +ZEND_GET_MODULE(shake_autoloading) +#endif + + PHP_FUNCTION(register_psr4_autoloader) { - RETURN_STRING("This is my function", 1); +} + +PHP_FUNCTION(register_files_autoloader) +{ +} + +PHP_FUNCTION(register_classmap_autoloader) +{ } From cdc0680e3e27f5386cac6867c3c567f17fdacf81 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 01:51:22 -0400 Subject: [PATCH 089/100] Update shake_autoloading.c --- ext/shake_autoloading.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/shake_autoloading.c b/ext/shake_autoloading.c index 5d3df7c..a666530 100644 --- a/ext/shake_autoloading.c +++ b/ext/shake_autoloading.c @@ -30,7 +30,7 @@ zend_module_entry slobel_module_entry = { STANDARD_MODULE_HEADER, PHP_SHAKE_AUTOLOADING_EXTENSION_NAME, shake_autoloading_functions, - PHP_MINIT(slobel_init), + NULL, NULL, NULL, NULL, From b969a70ca69d0145adcd2631a4a7b7182ea171f7 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 14:18:50 -0400 Subject: [PATCH 090/100] Change texts. --- ext/config.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/config.m4 b/ext/config.m4 index a2b656b..ba09373 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -1,4 +1,4 @@ if test "$PHP_SHAKE_AUTOLOADING" = "yes"; then - AC_DEFINE(HAVE_SHAKE_AUTOLOADING, 1, [Whether you have Slobel]) + AC_DEFINE(HAVE_SHAKE_AUTOLOADING, 1, [Whether you have Shake Autoloading]) PHP_NEW_EXTENSION(shake_autoloading, shake_autoloading.c, $ext_shared) fi From f159e9405b677ee09d27a53530bebc08fd92b7d7 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 14:32:54 -0400 Subject: [PATCH 091/100] Create install.sh --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..c959d60 --- /dev/null +++ b/install.sh @@ -0,0 +1,4 @@ +travis_retry composer install --no-interaction +wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar +chmod +x php-coveralls.phar +php php-coveralls.phar --version From 75176b922c833bfb7d5d016470a3c91d369e538b Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 14:35:36 -0400 Subject: [PATCH 092/100] Create before_script.sh --- before_script.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 before_script.sh diff --git a/before_script.sh b/before_script.sh new file mode 100644 index 0000000..183de85 --- /dev/null +++ b/before_script.sh @@ -0,0 +1,8 @@ +if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then + git clone https://github.com/phalcon/zephir + phpize -v + cd zephir + ./install -c + zephir help + zephir init utils +; fi From 9ad29bbeecab06404ca0bc0a9044ff098e477105 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 14:36:28 -0400 Subject: [PATCH 093/100] Update .travis.yml --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 15224b2..749c407 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,7 @@ os: before_script: - if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then sh -c "cd ext && phpize && ./configure && make && sudo make install"; fi - if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then echo "extension=php_shake_autoloading.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi -install: - - travis_retry composer install --no-interaction - - wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar - - chmod +x php-coveralls.phar - - php php-coveralls.phar --version +install: ./install.sh after_success: - travis_retry php php-coveralls.phar -v before_script: From c87cccee72641f6bb3f23e4d83f60674b1b39c28 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 15:32:58 -0400 Subject: [PATCH 094/100] Delete install.sh --- install.sh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 install.sh diff --git a/install.sh b/install.sh deleted file mode 100644 index c959d60..0000000 --- a/install.sh +++ /dev/null @@ -1,4 +0,0 @@ -travis_retry composer install --no-interaction -wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar -chmod +x php-coveralls.phar -php php-coveralls.phar --version From 48ae611ec70825d71b10c120cf24aa7bb88e9c55 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 15:39:55 -0400 Subject: [PATCH 095/100] Update .travis.yml --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 749c407..3ccc994 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,12 @@ matrix: os: - windows - linux -before_script: - - if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then sh -c "cd ext && phpize && ./configure && make && sudo make install"; fi - - if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then echo "extension=php_shake_autoloading.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi -install: ./install.sh +before_script: ./before_script.sh +install: + - travis_retry composer install --no-interaction + - wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar + - chmod +x php-coveralls.phar + - php php-coveralls.phar --version after_success: - travis_retry php php-coveralls.phar -v before_script: From 88c4efdbeeef204723ff0b38de08dcfe70c80fec Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 15:43:15 -0400 Subject: [PATCH 096/100] Update .travis.yml --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ccc994..afc470a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,6 @@ language: php sudo: false dist: trusty -env: - matrix: - - SHAKE_AUTOLOADING_EXT=no - - SHAKE_AUTOLOADING_EXT=yes php: - 7.2 - nightly @@ -15,7 +11,13 @@ matrix: os: - windows - linux -before_script: ./before_script.sh +before_script: + - git clone https://github.com/phalcon/zephir + - phpize -v + - cd zephir + - ./install -c + - zephir help + - zephir init utils install: - travis_retry composer install --no-interaction - wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar From 51a6fa0483a4ef5c75e64bb1faa33627e6672e62 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 15:43:42 -0400 Subject: [PATCH 097/100] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e0ababd..34464b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /composer.phar /vendor/ /build/ +/utils/ From 08b624bcd17a1a1078b5cd0db125b3eb0f11ec27 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 15:43:57 -0400 Subject: [PATCH 098/100] Delete before_script.sh --- before_script.sh | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 before_script.sh diff --git a/before_script.sh b/before_script.sh deleted file mode 100644 index 183de85..0000000 --- a/before_script.sh +++ /dev/null @@ -1,8 +0,0 @@ -if [ "$SHAKE_AUTOLOADING_EXT" == "yes" ]; then - git clone https://github.com/phalcon/zephir - phpize -v - cd zephir - ./install -c - zephir help - zephir init utils -; fi From eed8c6588fa66e0706cf849f20b0d6ac5abe3333 Mon Sep 17 00:00:00 2001 From: inisik Date: Fri, 4 May 2018 15:46:03 -0400 Subject: [PATCH 099/100] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index afc470a..db40634 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ matrix: os: - windows - linux -before_script: +before_install: - git clone https://github.com/phalcon/zephir - phpize -v - cd zephir From f6d11bbcd4310f8544b724938c78a7b410a54867 Mon Sep 17 00:00:00 2001 From: inisik Date: Sat, 5 May 2018 01:50:50 -0400 Subject: [PATCH 100/100] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db40634..845f9e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ before_install: - phpize -v - cd zephir - ./install -c - - zephir help - zephir init utils install: - travis_retry composer install --no-interaction