Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating ZF2 cache and log adapters. Using the ZF2 provided composer …

…repositories.
  • Loading branch information...
commit d8a6bf48496112b02b8c3eb45ee595045cc1a335 1 parent 1075904
@mtdowling mtdowling authored
View
103 composer.json
@@ -21,7 +21,7 @@
"require": {
"php": ">=5.3.2",
"ext-curl": "*",
- "symfony/event-dispatcher": "*"
+ "symfony/event-dispatcher": "2.*"
},
"autoload": {
@@ -34,96 +34,21 @@
"require-dev": {
"doctrine/common": "*",
"symfony/class-loader": "*",
- "monolog/monolog": "*",
- "zend/zend-cache": "2.0.0beta3",
- "zend/zend-log": "2.0.0beta3",
- "zend/zend-loader": "2.0.0beta3",
- "zend/zend-stdlib": "2.0.0beta3",
- "zend/zend-eventmanager": "2.0.0beta3",
+ "monolog/monolog": "1.*",
+ "zendframework/zend-cache": "2.0.*",
+ "zendframework/zend-log": "2.0.*",
+ "zendframework/zend-loader": "2.0.*",
+ "zendframework/zend-stdlib": "2.0.*",
+ "zendframework/zend-eventmanager": "2.0.*",
+ "zendframework/zend-servicemanager": "2.0.*",
"zend/zend-log1": "1.11",
"zend/zend-cache1": "1.11"
},
"repositories": [
{
- "type": "package",
- "package": {
- "name": "zend/zend-log",
- "version": "2.0.0beta3",
- "dist": {
- "url": "http://packages.zendframework.com/get/Zend_Log-2.0.0beta3.tgz",
- "type": "pear"
- },
- "autoload": {
- "psr-0": {
- "Zend\\Log": "php/"
- }
- }
- }
- },
- {
- "type":"package",
- "package": {
- "name": "zend/zend-cache",
- "version": "2.0.0beta3",
- "dist": {
- "url": "http://packages.zendframework.com/get/Zend_Cache-2.0.0beta3.tgz",
- "type": "pear"
- },
- "autoload": {
- "psr-0": {
- "Zend\\Cache": "php/"
- }
- }
- }
- },
- {
- "type":"package",
- "package": {
- "name": "zend/zend-loader",
- "version": "2.0.0beta3",
- "dist": {
- "url": "http://packages.zendframework.com/get/Zend_Loader-2.0.0beta3.tgz",
- "type": "pear"
- },
- "autoload": {
- "psr-0": {
- "Zend\\Loader": "php/"
- }
- }
- }
- },
- {
- "type":"package",
- "package": {
- "name": "zend/zend-stdlib",
- "version": "2.0.0beta3",
- "dist": {
- "url": "http://packages.zendframework.com/get/Zend_Stdlib-2.0.0beta3.tgz",
- "type": "pear"
- },
- "autoload": {
- "psr-0": {
- "Zend\\Stdlib": "php/"
- }
- }
- }
- },
- {
- "type":"package",
- "package": {
- "name": "zend/zend-eventmanager",
- "version": "2.0.0beta3",
- "dist": {
- "url": "http://packages.zendframework.com/get/Zend_EventManager-2.0.0beta3.tgz",
- "type": "pear"
- },
- "autoload": {
- "psr-0": {
- "Zend\\EventManager": "php/"
- }
- }
- }
+ "type": "composer",
+ "url": "http://packages.zendframework.com/"
},
{
"type":"package",
@@ -137,9 +62,7 @@
},
"target-dir": "Zend/Log",
"autoload": {
- "psr-0": {
- "Zend_Log": "/"
- }
+ "psr-0": { "Zend_Log": "/" }
}
}
},
@@ -155,9 +78,7 @@
},
"target-dir": "Zend/Cache",
"autoload": {
- "psr-0": {
- "Zend_Cache": "/"
- }
+ "psr-0": { "Zend_Cache": "/" }
}
}
}
View
16 src/Guzzle/Common/Cache/Zf2CacheAdapter.php
@@ -2,7 +2,7 @@
namespace Guzzle\Common\Cache;
-use Zend\Cache\Storage\Adapter;
+use Zend\Cache\Storage\Adapter\AdapterInterface;
/**
* Zend Framework 2 cache adapter
@@ -17,14 +17,14 @@ class Zf2CacheAdapter extends AbstractCacheAdapter
protected $defaultOptions = array();
/**
- * @param Adapter $cache Zend Framework 2 cache adapter
- * @param array $options Hash of default options for each cache method.
- * Can contain for 'contains', 'delete', 'fetch',
- * and 'save'. Each key must map to an
- * associative array of options to merge into the
- * options argument passed into each respective call.
+ * @param AdapterInteface $cache Zend Framework 2 cache adapter
+ * @param array $options Hash of default options for each cache method.
+ * Can contain for 'contains', 'delete', 'fetch',
+ * and 'save'. Each key must map to an
+ * associative array of options to merge into the
+ * options argument passed into each respective call.
*/
- public function __construct(Adapter $cache, array $defaultOptions = array())
+ public function __construct(AdapterInterface $cache, array $defaultOptions = array())
{
$this->cache = $cache;
$this->defaultOptions = array_merge(array(
View
2  src/Guzzle/Common/Log/Zf2LogAdapter.php
@@ -22,6 +22,6 @@ public function __construct(Logger $logObject)
*/
public function log($message, $priority = LOG_INFO, $extras = null)
{
- $this->log->log($message, $priority, $extras);
+ $this->log->log($priority, $message, $extras ?: array());
}
}
View
4 tests/Guzzle/Tests/Common/Log/Zf2LogAdapterTest.php
@@ -33,8 +33,10 @@ class Zf2LogAdapterTest extends \Guzzle\Tests\GuzzleTestCase
protected function setUp()
{
$this->stream = fopen('php://temp', 'r+');
- $this->log = new Logger(new Stream($this->stream));
+ $this->log = new Logger();
+ $this->log->addWriter(new Stream($this->stream));
$this->adapter = new Zf2LogAdapter($this->log);
+
}
/**
View
8 tests/bootstrap.php
@@ -3,7 +3,7 @@
error_reporting(E_ALL | E_STRICT);
// Ensure that composer has installed all dependencies
-if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) {
+if (!file_exists(dirname(__DIR__) . '/composer.lock')) {
die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n"
. "See http://getcomposer.org for help with installing composer\n");
}
@@ -16,14 +16,14 @@
}
// Include the composer autoloader
-require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
+require_once dirname(__DIR__) . '/vendor/autoload.php';
// Add the services file to the default service builder
-$servicesFile = __DIR__ . DIRECTORY_SEPARATOR . 'Guzzle' . DIRECTORY_SEPARATOR . 'Tests' . DIRECTORY_SEPARATOR . 'TestData' . DIRECTORY_SEPARATOR . 'services' . DIRECTORY_SEPARATOR . 'services.xml';
+$servicesFile = __DIR__ . '/Guzzle/Tests/TestData/services/services.xml';
Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory($servicesFile));
// Modify the include path so that it can find the Zend Framework
$paths = array('vendor/zend/zend-cache1', 'vendor/zend/zend-log1');
set_include_path(implode(PATH_SEPARATOR, array_map(function($path) {
- return __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $path;
+ return __DIR__ . '/../' . $path;
}, $paths)) . PATH_SEPARATOR . get_include_path());
Please sign in to comment.
Something went wrong with that request. Please try again.