Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2878' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/File/Transfer/Adapter/AbstractAdapter.php
	library/Zend/File/Transfer/Adapter/Http.php
	tests/ZendTest/Log/Writer/AbstractTest.php
	tests/ZendTest/Log/Writer/DbTest.php
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 72 deletions.
12 changes: 6 additions & 6 deletions src/PubSubHubbub/PubSubHubbub.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function detectHubs($source)
*/
public static function setHttpClient(Http\Client $httpClient)
{
self::$httpClient = $httpClient;
static::$httpClient = $httpClient;
}

/**
Expand All @@ -90,12 +90,12 @@ public static function setHttpClient(Http\Client $httpClient)
*/
public static function getHttpClient()
{
if (!isset(self::$httpClient)) {
self::$httpClient = new Http\Client;
if (!isset(static::$httpClient)) {
static::$httpClient = new Http\Client;
} else {
self::$httpClient->resetParameters();
static::$httpClient->resetParameters();
}
return self::$httpClient;
return static::$httpClient;
}

/**
Expand All @@ -106,7 +106,7 @@ public static function getHttpClient()
*/
public static function clearHttpClient()
{
self::$httpClient = null;
static::$httpClient = null;
}

/**
Expand Down
84 changes: 42 additions & 42 deletions src/Reader/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Reader
*/
public static function getCache()
{
return self::$cache;
return static::$cache;
}

/**
Expand All @@ -112,7 +112,7 @@ public static function getCache()
*/
public static function setCache(CacheStorage $cache)
{
self::$cache = $cache;
static::$cache = $cache;
}

/**
Expand All @@ -125,7 +125,7 @@ public static function setCache(CacheStorage $cache)
*/
public static function setHttpClient(Http\Client $httpClient)
{
self::$httpClient = $httpClient;
static::$httpClient = $httpClient;
}


Expand All @@ -136,11 +136,11 @@ public static function setHttpClient(Http\Client $httpClient)
*/
public static function getHttpClient()
{
if (!self::$httpClient instanceof Http\Client) {
self::$httpClient = new Http\Client();
if (!static::$httpClient instanceof Http\Client) {
static::$httpClient = new Http\Client();
}

return self::$httpClient;
return static::$httpClient;
}

/**
Expand All @@ -158,7 +158,7 @@ public static function getHttpClient()
*/
public static function setHttpMethodOverride($override = true)
{
self::$httpMethodOverride = $override;
static::$httpMethodOverride = $override;
}

/**
Expand All @@ -168,7 +168,7 @@ public static function setHttpMethodOverride($override = true)
*/
public static function getHttpMethodOverride()
{
return self::$httpMethodOverride;
return static::$httpMethodOverride;
}

/**
Expand All @@ -179,7 +179,7 @@ public static function getHttpMethodOverride()
*/
public static function useHttpConditionalGet($bool = true)
{
self::$httpConditionalGet = $bool;
static::$httpConditionalGet = $bool;
}

/**
Expand All @@ -203,7 +203,7 @@ public static function import($uri, $etag = null, $lastModified = null)
$client->setUri($uri);
$cacheId = 'Zend_Feed_Reader_' . md5($uri);

if (self::$httpConditionalGet && $cache) {
if (static::$httpConditionalGet && $cache) {
$data = $cache->getItem($cacheId);
if ($data) {
if ($etag === null) {
Expand Down Expand Up @@ -235,25 +235,25 @@ public static function import($uri, $etag = null, $lastModified = null)
$cache->setItem($cacheId . '_lastmodified', $response->getHeaders()->get('Last-Modified')->getFieldValue());
}
}
return self::importString($responseXml);
return static::importString($responseXml);
} elseif ($cache) {
$data = $cache->getItem($cacheId);
if ($data) {
return self::importString($data);
return static::importString($data);
}
$response = $client->send();
if ((int) $response->getStatusCode() !== 200) {
throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode());
}
$responseXml = $response->getBody();
$cache->setItem($cacheId, $responseXml);
return self::importString($responseXml);
return static::importString($responseXml);
} else {
$response = $client->send();
if ((int) $response->getStatusCode() !== 200) {
throw new Exception\RuntimeException('Feed failed to load, got response code ' . $response->getStatusCode());
}
$reader = self::importString($response->getBody());
$reader = static::importString($response->getBody());
$reader->setOriginalSourceUri($uri);
return $reader;
}
Expand Down Expand Up @@ -295,9 +295,9 @@ public static function importString($string)
throw new Exception\RuntimeException($errormsg);
}

$type = self::detectType($dom);
$type = static::detectType($dom);

self::registerCoreExtensions();
static::registerCoreExtensions();

if (substr($type, 0, 3) == 'rss') {
$reader = new Feed\Rss($dom, $type);
Expand Down Expand Up @@ -327,7 +327,7 @@ public static function importFile($filename)
if ($feed === false) {
throw new Exception\RuntimeException("File '{$filename}' could not be loaded", 0, $err);
}
return self::importString($feed);
return static::importString($feed);
}

/**
Expand All @@ -339,7 +339,7 @@ public static function importFile($filename)
*/
public static function findFeedLinks($uri)
{
$client = self::getHttpClient();
$client = static::getHttpClient();
$client->setUri($uri);
$response = $client->send();
if ($response->getStatusCode() !== 200) {
Expand Down Expand Up @@ -501,7 +501,7 @@ public static function detectType($feed, $specOnly = false)
*/
public static function setExtensionManager(ExtensionManager $extensionManager)
{
self::$extensionManager = $extensionManager;
static::$extensionManager = $extensionManager;
}

/**
Expand All @@ -511,10 +511,10 @@ public static function setExtensionManager(ExtensionManager $extensionManager)
*/
public static function getExtensionManager()
{
if (!isset(self::$extensionManager)) {
self::setExtensionManager(new ExtensionManager());
if (!isset(static::$extensionManager)) {
static::setExtensionManager(new ExtensionManager());
}
return self::$extensionManager;
return static::$extensionManager;
}

/**
Expand All @@ -528,8 +528,8 @@ public static function registerExtension($name)
{
$feedName = $name . '\Feed';
$entryName = $name . '\Entry';
$manager = self::getExtensionManager();
if (self::isRegistered($name)) {
$manager = static::getExtensionManager();
if (static::isRegistered($name)) {
if ($manager->has($feedName) || $manager->has($entryName)) {
return;
}
Expand All @@ -540,10 +540,10 @@ public static function registerExtension($name)
. ' using Plugin Loader. Check prefix paths are configured and extension exists.');
}
if ($manager->has($feedName)) {
self::$extensions['feed'][] = $feedName;
static::$extensions['feed'][] = $feedName;
}
if ($manager->has($entryName)) {
self::$extensions['entry'][] = $entryName;
static::$extensions['entry'][] = $entryName;
}
}

Expand All @@ -557,8 +557,8 @@ public static function isRegistered($extensionName)
{
$feedName = $extensionName . '\Feed';
$entryName = $extensionName . '\Entry';
if (in_array($feedName, self::$extensions['feed'])
|| in_array($entryName, self::$extensions['entry'])
if (in_array($feedName, static::$extensions['feed'])
|| in_array($entryName, static::$extensions['entry'])
) {
return true;
}
Expand All @@ -572,7 +572,7 @@ public static function isRegistered($extensionName)
*/
public static function getExtensions()
{
return self::$extensions;
return static::$extensions;
}

/**
Expand All @@ -582,12 +582,12 @@ public static function getExtensions()
*/
public static function reset()
{
self::$cache = null;
self::$httpClient = null;
self::$httpMethodOverride = false;
self::$httpConditionalGet = false;
self::$extensionManager = null;
self::$extensions = array(
static::$cache = null;
static::$httpClient = null;
static::$httpMethodOverride = false;
static::$httpConditionalGet = false;
static::$extensionManager = null;
static::$extensions = array(
'feed' => array(
'DublinCore\Feed',
'Atom\Feed'
Expand All @@ -614,13 +614,13 @@ public static function reset()
*/
protected static function registerCoreExtensions()
{
self::registerExtension('DublinCore');
self::registerExtension('Content');
self::registerExtension('Atom');
self::registerExtension('Slash');
self::registerExtension('WellFormedWeb');
self::registerExtension('Thread');
self::registerExtension('Podcast');
static::registerExtension('DublinCore');
static::registerExtension('Content');
static::registerExtension('Atom');
static::registerExtension('Slash');
static::registerExtension('WellFormedWeb');
static::registerExtension('Thread');
static::registerExtension('Podcast');
}

/**
Expand Down
48 changes: 24 additions & 24 deletions src/Writer/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Writer
*/
public static function setExtensionManager(ExtensionManager $extensionManager)
{
self::$extensionManager = $extensionManager;
static::$extensionManager = $extensionManager;
}

/**
Expand All @@ -79,10 +79,10 @@ public static function setExtensionManager(ExtensionManager $extensionManager)
*/
public static function getExtensionManager()
{
if (!isset(self::$extensionManager)) {
self::setExtensionManager(new ExtensionManager());
if (!isset(static::$extensionManager)) {
static::setExtensionManager(new ExtensionManager());
}
return self::$extensionManager;
return static::$extensionManager;
}

/**
Expand All @@ -98,8 +98,8 @@ public static function registerExtension($name)
$entryName = $name . '\Entry';
$feedRendererName = $name . '\Renderer\Feed';
$entryRendererName = $name . '\Renderer\Entry';
$manager = self::getExtensionManager();
if (self::isRegistered($name)) {
$manager = static::getExtensionManager();
if (static::isRegistered($name)) {
if ($manager->has($feedName)
|| $manager->has($entryName)
|| $manager->has($feedRendererName)
Expand All @@ -117,16 +117,16 @@ public static function registerExtension($name)
. 'using Plugin Loader. Check prefix paths are configured and extension exists.');
}
if ($manager->has($feedName)) {
self::$extensions['feed'][] = $feedName;
static::$extensions['feed'][] = $feedName;
}
if ($manager->has($entryName)) {
self::$extensions['entry'][] = $entryName;
static::$extensions['entry'][] = $entryName;
}
if ($manager->has($feedRendererName)) {
self::$extensions['feedRenderer'][] = $feedRendererName;
static::$extensions['feedRenderer'][] = $feedRendererName;
}
if ($manager->has($entryRendererName)) {
self::$extensions['entryRenderer'][] = $entryRendererName;
static::$extensions['entryRenderer'][] = $entryRendererName;
}
}

Expand All @@ -142,10 +142,10 @@ public static function isRegistered($extensionName)
$entryName = $extensionName . '\Entry';
$feedRendererName = $extensionName . '\Renderer\Feed';
$entryRendererName = $extensionName . '\Renderer\Entry';
if (in_array($feedName, self::$extensions['feed'])
|| in_array($entryName, self::$extensions['entry'])
|| in_array($feedRendererName, self::$extensions['feedRenderer'])
|| in_array($entryRendererName, self::$extensions['entryRenderer'])
if (in_array($feedName, static::$extensions['feed'])
|| in_array($entryName, static::$extensions['entry'])
|| in_array($feedRendererName, static::$extensions['feedRenderer'])
|| in_array($entryRendererName, static::$extensions['entryRenderer'])
) {
return true;
}
Expand All @@ -159,7 +159,7 @@ public static function isRegistered($extensionName)
*/
public static function getExtensions()
{
return self::$extensions;
return static::$extensions;
}

/**
Expand All @@ -169,8 +169,8 @@ public static function getExtensions()
*/
public static function reset()
{
self::$extensionManager = null;
self::$extensions = array(
static::$extensionManager = null;
static::$extensions = array(
'entry' => array(),
'feed' => array(),
'entryRenderer' => array(),
Expand All @@ -185,13 +185,13 @@ public static function reset()
*/
public static function registerCoreExtensions()
{
self::registerExtension('DublinCore');
self::registerExtension('Content');
self::registerExtension('Atom');
self::registerExtension('Slash');
self::registerExtension('WellFormedWeb');
self::registerExtension('Threading');
self::registerExtension('ITunes');
static::registerExtension('DublinCore');
static::registerExtension('Content');
static::registerExtension('Atom');
static::registerExtension('Slash');
static::registerExtension('WellFormedWeb');
static::registerExtension('Threading');
static::registerExtension('ITunes');
}

public static function lcfirst($str)
Expand Down

0 comments on commit bd800e4

Please sign in to comment.