diff --git a/composer.json b/composer.json index 6c96b2dfeeb..d76eb82208f 100644 --- a/composer.json +++ b/composer.json @@ -58,6 +58,7 @@ "pear-pear.php.net/validate_ispn": "*", "serialssolutions/summon": "*", "symfony/yaml": "*", + "vufind-org/vufindhttp": "*", "zendframework/zendframework": "2.2.7", "zendframework/zendrest": "2.*", "zendframework/zendservice-amazon": "2.*", diff --git a/composer.lock b/composer.lock index 16796f6ef41..e32afa327c9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "bdf603dc03336b065db2cb676f092114", + "hash": "9cd1fe9a339a11f246bbda40fadca844", "packages": [ { "name": "aferrandini/phpqrcode", @@ -557,6 +557,52 @@ "homepage": "http://symfony.com", "time": "2014-09-22 09:14:18" }, + { + "name": "vufind-org/vufindhttp", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/vufind-org/vufindhttp.git", + "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vufind-org/vufindhttp/zipball/2f56535bd3c306747ecf89ecea33c798f16f8c4e", + "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e", + "shasum": "" + }, + "require": { + "zendframework/zend-http": "2.2.*" + }, + "require-dev": { + "zendframework/zend-uri": "2.2.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "VuFindHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "David Maus", + "email": "maus@hab.de", + "role": "Developer" + }, + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu", + "role": "Maintainer" + } + ], + "description": "VuFind 2.x HTTP service library", + "homepage": "http://vufind.org/", + "time": "2014-10-16 14:38:35" + }, { "name": "zendframework/zendframework", "version": "2.2.7", diff --git a/config/application.config.php b/config/application.config.php index 357a2e6f653..49d744a6fb8 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -2,7 +2,7 @@ // Set up modules: $modules = array( - 'VuFindHttp', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin' + 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin' ); if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) { $modules[] = 'VuFindConsole'; diff --git a/install.php b/install.php index aeddb9d2360..c05c7a17369 100644 --- a/install.php +++ b/install.php @@ -346,8 +346,7 @@ function validateModule($module) $regex = '/^[a-zA-Z][0-9a-zA-Z_]*$/'; $illegalModules = array( 'VuDL', 'VuFind', 'VuFindAdmin', 'VuFindConsole', 'VuFindDevTools', - 'VuFindHttp', 'VuFindLocalTemplate', 'VuFindSearch', 'VuFindTest', - 'VuFindTheme', + 'VuFindLocalTemplate', 'VuFindSearch', 'VuFindTest', 'VuFindTheme', ); if (in_array($module, $illegalModules)) { return "{$module} is a reserved module name; please try another."; diff --git a/module/VuFindHttp/.gitignore b/module/VuFindHttp/.gitignore deleted file mode 100644 index 6b567c718f3..00000000000 --- a/module/VuFindHttp/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -TAGS -\#* -.\#* -ChangeLog -review -test.php -vendor/ diff --git a/module/VuFindHttp/Module.php b/module/VuFindHttp/Module.php deleted file mode 100644 index 91dca4cda12..00000000000 --- a/module/VuFindHttp/Module.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org - */ -namespace VuFindHttp; - -/** - * ZF2 module definition for the VF2 HTTP service. - * - * @category VuFind2 - * @package Http - * @author David Maus - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org - */ -class Module -{ - /** - * Return autoloader configuration. - * - * @return array - */ - public function getAutoloaderConfig() - { - return array( - 'Zend\Loader\StandardAutoloader' => array( - 'namespaces' => array( - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, - ), - ), - ); - } - -} \ No newline at end of file diff --git a/module/VuFindHttp/tests/unit-tests/bootstrap.php b/module/VuFindHttp/tests/unit-tests/bootstrap.php deleted file mode 100644 index fcc2fd66998..00000000000 --- a/module/VuFindHttp/tests/unit-tests/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @copyright Copyright (C) Villanova University 2011 - * - */ - -require_once('Zend/Loader/AutoloaderFactory.php'); -\Zend\Loader\AutoloaderFactory::factory( - array( - 'Zend\Loader\StandardAutoloader' => array( - 'namespaces' => array( - 'VuFindHttp' => realpath(__DIR__ . '/../../src/VuFindHttp'), - 'VuFindTest' => realpath(__DIR__ . '/src/VuFindTest'), - ), - 'autoregister_zf' => true - ) - ) -); diff --git a/module/VuFindHttp/tests/unit-tests/phpunit.xml b/module/VuFindHttp/tests/unit-tests/phpunit.xml deleted file mode 100644 index 1cbaaf01a44..00000000000 --- a/module/VuFindHttp/tests/unit-tests/phpunit.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - src - - - - - - - ../../vendor/zf2/library - - diff --git a/vendor/autoload.php b/vendor/autoload.php index 3d383ebdaa8..5b9cf272a45 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit0f2072e16558438728ae5fe1a74a0c86::getLoader(); +return ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa::getLoader(); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 33addd7ad2b..f32f348f63c 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -11,6 +11,7 @@ 'ZendService\\Amazon\\' => array($vendorDir . '/zendframework/zendservice-amazon/library'), 'ZendService' => array($vendorDir . '/zendframework/zendservice-recaptcha/library'), 'ZendRest' => array($vendorDir . '/zendframework/zendrest/library'), + 'VuFindHttp\\' => array($vendorDir . '/vufind-org/vufindhttp/src'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'SerialsSolutions' => array($vendorDir . '/serialssolutions/summon'), 'ProxyManager\\' => array($vendorDir . '/ocramius/proxy-manager/src'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ea9f2bfdc71..e943ac1ba11 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit0f2072e16558438728ae5fe1a74a0c86 +class ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa { private static $loader; @@ -19,9 +19,9 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit0f2072e16558438728ae5fe1a74a0c86', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit0f2072e16558438728ae5fe1a74a0c86', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit7dec02740c412b5209419ea980a0c5fa', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); @@ -48,7 +48,7 @@ public static function getLoader() } } -function composerRequire0f2072e16558438728ae5fe1a74a0c86($file) +function composerRequire7dec02740c412b5209419ea980a0c5fa($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f75eae69138..6a6c74b0881 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -903,5 +903,53 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com" + }, + { + "name": "vufind-org/vufindhttp", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/vufind-org/vufindhttp.git", + "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vufind-org/vufindhttp/zipball/2f56535bd3c306747ecf89ecea33c798f16f8c4e", + "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e", + "shasum": "" + }, + "require": { + "zendframework/zend-http": "2.2.*" + }, + "require-dev": { + "zendframework/zend-uri": "2.2.*" + }, + "time": "2014-10-16 14:38:35", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "VuFindHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "David Maus", + "email": "maus@hab.de", + "role": "Developer" + }, + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu", + "role": "Maintainer" + } + ], + "description": "VuFind 2.x HTTP service library", + "homepage": "http://vufind.org/" } ] diff --git a/module/VuFindHttp/LICENSE b/vendor/vufind-org/vufindhttp/LICENSE similarity index 100% rename from module/VuFindHttp/LICENSE rename to vendor/vufind-org/vufindhttp/LICENSE diff --git a/vendor/vufind-org/vufindhttp/README.md b/vendor/vufind-org/vufindhttp/README.md new file mode 100644 index 00000000000..5797d801d5e --- /dev/null +++ b/vendor/vufind-org/vufindhttp/README.md @@ -0,0 +1,15 @@ +VuFindHttp +========== + +Introduction +------------ +VuFindHttp contains a convenience class built around Zend\Http\Client which allows +creation of proxy-aware clients and convenient GET/POST behavior. This is part of +the VuFind project (http://vufind.org) but may be useful for any software dealing +with HTTP calls. + + +Installation +------------ +The recommended method for incorporating this library into your project is to use +Composer (http://getcomposer.org). \ No newline at end of file diff --git a/vendor/vufind-org/vufindhttp/build.xml b/vendor/vufind-org/vufindhttp/build.xml new file mode 100644 index 00000000000..3ff7d2dc0ac --- /dev/null +++ b/vendor/vufind-org/vufindhttp/build.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + Unexpected error during continuous integration tasks -- ${exceptionmsg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/module/VuFindHttp/composer.json b/vendor/vufind-org/vufindhttp/composer.json similarity index 80% rename from module/VuFindHttp/composer.json rename to vendor/vufind-org/vufindhttp/composer.json index ca6cf8b8aed..c082536b960 100644 --- a/module/VuFindHttp/composer.json +++ b/vendor/vufind-org/vufindhttp/composer.json @@ -1,5 +1,5 @@ { - "name": "vufind/http", + "name": "vufind-org/vufindhttp", "description": "VuFind 2.x HTTP service library", "authors": [ { @@ -18,9 +18,6 @@ "support": { "issues": "http://vufind.org/jira" }, - "repositories": [ - { "type": "composer", "url": "http://packages.zendframework.com/" } - ], "require": { "zendframework/zend-http": "2.2.*" }, @@ -29,7 +26,7 @@ }, "autoload": { "psr-0": { - "VuFindHttp\\": "src" + "VuFindHttp\\": "src/" } } } diff --git a/module/VuFindHttp/phpunit.xml b/vendor/vufind-org/vufindhttp/phpunit.xml similarity index 67% rename from module/VuFindHttp/phpunit.xml rename to vendor/vufind-org/vufindhttp/phpunit.xml index e01b88137ac..3a7d627bc4c 100644 --- a/module/VuFindHttp/phpunit.xml +++ b/vendor/vufind-org/vufindhttp/phpunit.xml @@ -9,4 +9,9 @@ . + + + src + + diff --git a/module/VuFindHttp/src/VuFindHttp/Exception/ExceptionInterface.php b/vendor/vufind-org/vufindhttp/src/VuFindHttp/Exception/ExceptionInterface.php similarity index 100% rename from module/VuFindHttp/src/VuFindHttp/Exception/ExceptionInterface.php rename to vendor/vufind-org/vufindhttp/src/VuFindHttp/Exception/ExceptionInterface.php diff --git a/module/VuFindHttp/src/VuFindHttp/Exception/RuntimeException.php b/vendor/vufind-org/vufindhttp/src/VuFindHttp/Exception/RuntimeException.php similarity index 100% rename from module/VuFindHttp/src/VuFindHttp/Exception/RuntimeException.php rename to vendor/vufind-org/vufindhttp/src/VuFindHttp/Exception/RuntimeException.php diff --git a/module/VuFindHttp/src/VuFindHttp/HttpService.php b/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpService.php similarity index 100% rename from module/VuFindHttp/src/VuFindHttp/HttpService.php rename to vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpService.php diff --git a/module/VuFindHttp/src/VuFindHttp/HttpServiceAwareInterface.php b/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpServiceAwareInterface.php similarity index 100% rename from module/VuFindHttp/src/VuFindHttp/HttpServiceAwareInterface.php rename to vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpServiceAwareInterface.php diff --git a/module/VuFindHttp/src/VuFindHttp/HttpServiceInterface.php b/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpServiceInterface.php similarity index 100% rename from module/VuFindHttp/src/VuFindHttp/HttpServiceInterface.php rename to vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpServiceInterface.php diff --git a/module/VuFindHttp/tests/bootstrap.php b/vendor/vufind-org/vufindhttp/tests/bootstrap.php similarity index 100% rename from module/VuFindHttp/tests/bootstrap.php rename to vendor/vufind-org/vufindhttp/tests/bootstrap.php diff --git a/module/VuFindHttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php b/vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php similarity index 88% rename from module/VuFindHttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php rename to vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php index 14c4862b675..bcd61e0d73e 100644 --- a/module/VuFindHttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php +++ b/vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php @@ -58,7 +58,7 @@ * @link https://github.com/dmj/vf2-proxy */ -class ProxyServiceTest extends Unit\TestCase +class ProxyServiceTest extends \PHPUnit_Framework_TestCase { protected $local = array('ipv4 localhost' => 'http://localhost', @@ -136,7 +136,15 @@ public function testGetAppendsQueryPart() public function testPostForm() { $service = new Service(); - $adapter = new \Zend\Http\Client\Adapter\Test(); + $adapter = $this->getMock('Zend\Http\Client\Adapter\Test', array('write')); + $adapter->expects($this->once()) + ->method('write') + ->with( + $this->equalTo('POST'), + $this->equalTo( + new \Zend\Uri\Http('http://example.tld', 'foo=bar&bar=baz') + ) + ); $service->setDefaultAdapter($adapter); $service->postForm('http://example.tld', array('foo=bar')); } @@ -260,4 +268,23 @@ public function testTimeout() $clientConfig = $this->getProperty($client, 'config'); $this->assertEquals($clientConfig['timeout'], 67); } + + /** + * Return protected or private property. + * + * Uses PHP's reflection API in order to modify property accessibility. + * + * @param object|string $object Object or class name + * @param string $property Property name + * + * @throws \ReflectionException Property does not exist + * + * @return mixed + */ + protected function getProperty($object, $property) + { + $reflectionProperty = new \ReflectionProperty($object, $property); + $reflectionProperty->setAccessible(true); + return $reflectionProperty->getValue($object); + } } \ No newline at end of file diff --git a/vendor/vufind-org/vufindhttp/vendor/.gitignore b/vendor/vufind-org/vufindhttp/vendor/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/vendor/vufind-org/vufindhttp/vendor/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file