From a478b13930f72d9a67897792ebd3c36ec0831044 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 17 Oct 2016 23:25:21 -0500 Subject: [PATCH 1/4] Composer: fix autoloading for 1.0 branch --- composer.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 7a2a2bbf..39cfa543 100644 --- a/composer.json +++ b/composer.json @@ -66,11 +66,16 @@ }, "include-path": ["phpseclib/"], "autoload": { + "psr-0": { + "Crypt": "phpseclib/", + "File": "phpseclib/", + "Math": "phpseclib/", + "Net": "phpseclib/", + "System": "phpseclib/" + }, "files": [ + "phpseclib/Crypt/Random.php", "phpseclib/bootstrap.php" - ], - "psr-4": { - "phpseclib\\": "phpseclib/" - } + ] } } From f5d8377cdbddbdd4107a789d2a700f42a95c2009 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 20 Oct 2016 21:29:55 +0200 Subject: [PATCH 2/4] Backport tests/bootstrap.php from 2.0 / master onto 1.0. --- tests/bootstrap.php | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 561b0a82..bb137e4d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -7,25 +7,13 @@ date_default_timezone_set('UTC'); -// Set up include path accordingly. This is especially required because some -// class files of phpseclib require() other dependencies. -set_include_path(implode(PATH_SEPARATOR, array( - dirname(__FILE__) . '/../phpseclib/', - dirname(__FILE__) . '/', - get_include_path(), -))); - -require_once 'Crypt/Random.php'; - -function phpseclib_autoload($class) -{ - $file = str_replace('_', '/', $class) . '.php'; - - if (phpseclib_resolve_include_path($file)) { - // @codingStandardsIgnoreStart - require $file; - // @codingStandardsIgnoreEnd - } +$loader_path = __DIR__ . '/../vendor/autoload.php'; +if (!file_exists($loader_path)) { + echo "Dependencies must be installed using composer:\n\n"; + echo "php composer.phar install\n\n"; + echo "See http://getcomposer.org for help with installing composer\n"; + exit(1); } -spl_autoload_register('phpseclib_autoload'); +$loader = include $loader_path; +$loader->add('', __DIR__); From 1fb9c812334a68f7c1687e6a84a6366930ccecdd Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 22 Oct 2016 11:13:01 -0500 Subject: [PATCH 3/4] Composer: include bootstrap before Crypt/Random --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 39cfa543..acec44de 100644 --- a/composer.json +++ b/composer.json @@ -74,8 +74,8 @@ "System": "phpseclib/" }, "files": [ - "phpseclib/Crypt/Random.php", - "phpseclib/bootstrap.php" + "phpseclib/bootstrap.php", + "phpseclib/Crypt/Random.php" ] } } From 38fa7332e96bcc546ce6eb5cbaa1168c96839393 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 22 Oct 2016 12:53:16 -0500 Subject: [PATCH 4/4] update for 1.0.5 release.. --- CHANGELOG.md | 4 ++++ README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c18d88..73b972fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.5 - 2016-10-22 + +- fix issue preventing installation of 1.0.x via Composer (#1048) + ## 1.0.4 - 2016-10-03 - fix E_DEPRECATED errors on PHP 7.0 and 7.1 (#1041) diff --git a/README.md b/README.md index 3f527547..75089a01 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509 -* [Download (1.0.4)](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.4.zip/download) +* [Download (1.0.5)](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.5.zip/download) * [Browse Git](https://github.com/phpseclib/phpseclib) * [Code Coverage Report](http://phpseclib.bantux.org/code_coverage/1.0/latest/)