From 2d431803a0952f7ef506c2ba88681a858d6e7d0d Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 23 Aug 2012 14:56:09 -0400 Subject: [PATCH] Eliminated non-essential double backslashes. --- module/VuFind/src/VuFind/Auth/Factory.php | 2 +- .../src/VuFind/Autocomplete/Factory.php | 2 +- module/VuFind/src/VuFind/Bootstrap.php | 2 +- .../VuFind/src/VuFind/Connection/Manager.php | 2 +- .../src/VuFind/Controller/AbstractRecord.php | 2 +- .../src/VuFind/Controller/AbstractSearch.php | 4 ++-- .../src/VuFind/Controller/AjaxController.php | 10 +++++----- .../Controller/MyResearchController.php | 6 +++--- module/VuFind/src/VuFind/Http/Client.php | 4 ++-- module/VuFind/src/VuFind/ILS/Connection.php | 4 ++-- module/VuFind/src/VuFind/Log/Logger.php | 2 +- module/VuFind/src/VuFind/OAI/Server.php | 10 +++++----- .../src/VuFind/Recommend/SearchObject.php | 4 ++-- module/VuFind/src/VuFind/Record.php | 2 +- .../src/VuFind/RecordDriver/AbstractBase.php | 2 +- .../VuFind/src/VuFind/Resolver/Connection.php | 2 +- .../VuFind/src/VuFind/Search/Base/Params.php | 2 +- .../src/VuFind/Search/Favorites/Results.php | 2 +- module/VuFind/src/VuFind/Search/Minified.php | 20 +++++++++---------- .../src/VuFind/Search/MixedList/Results.php | 2 +- module/VuFind/src/VuFind/Search/Options.php | 2 +- .../VuFind/src/VuFind/Search/Solr/Results.php | 4 ++-- .../VuFind/src/VuFind/Search/Tags/Results.php | 2 +- .../src/VuFind/Statistics/AbstractBase.php | 2 +- .../src/VuFind/Theme/Root/Helper/Citation.php | 2 +- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/module/VuFind/src/VuFind/Auth/Factory.php b/module/VuFind/src/VuFind/Auth/Factory.php index 3d5750a3668..dc74ed491d5 100644 --- a/module/VuFind/src/VuFind/Auth/Factory.php +++ b/module/VuFind/src/VuFind/Auth/Factory.php @@ -62,7 +62,7 @@ class Factory } // Load up the handler if a legal name has been supplied. - $className = 'VuFind\\Auth\\' . $authNHandler; + $className = 'VuFind\Auth\\' . $authNHandler; if (class_exists($className)) { return new $className($config); } else { diff --git a/module/VuFind/src/VuFind/Autocomplete/Factory.php b/module/VuFind/src/VuFind/Autocomplete/Factory.php index 904827af7f6..13c8034e29d 100644 --- a/module/VuFind/src/VuFind/Autocomplete/Factory.php +++ b/module/VuFind/src/VuFind/Autocomplete/Factory.php @@ -66,7 +66,7 @@ class Factory // Try to load the appropriate class, if any: if (!empty($module)) { - $module = 'VuFind\\Autocomplete\\' . $module; + $module = 'VuFind\Autocomplete\\' . $module; if (class_exists($module)) { $auto = new $module($params); return $auto; diff --git a/module/VuFind/src/VuFind/Bootstrap.php b/module/VuFind/src/VuFind/Bootstrap.php index 6f41e190823..e0bc7b16b10 100644 --- a/module/VuFind/src/VuFind/Bootstrap.php +++ b/module/VuFind/src/VuFind/Bootstrap.php @@ -120,7 +120,7 @@ class Bootstrap if ($type == 'Mysql') { $type = 'Database'; } - $class = 'VuFind\\Session\\' . $type; + $class = 'VuFind\Session\\' . $type; $sessionManager->setSaveHandler(new $class($this->config->Session)); // Start up the session: diff --git a/module/VuFind/src/VuFind/Connection/Manager.php b/module/VuFind/src/VuFind/Connection/Manager.php index 660720a21be..ff8231da477 100644 --- a/module/VuFind/src/VuFind/Connection/Manager.php +++ b/module/VuFind/src/VuFind/Connection/Manager.php @@ -88,7 +88,7 @@ class Manager } // Construct the object appropriately based on the $core setting: - $class = 'VuFind\\Connection\\' . $type; + $class = 'VuFind\Connection\\' . $type; if (empty($core)) { $index = new $class($url); } else { diff --git a/module/VuFind/src/VuFind/Controller/AbstractRecord.php b/module/VuFind/src/VuFind/Controller/AbstractRecord.php index ee2cfa87718..69df94ee482 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractRecord.php +++ b/module/VuFind/src/VuFind/Controller/AbstractRecord.php @@ -57,7 +57,7 @@ class AbstractRecord extends AbstractBase public function __construct() { // Set up search class ID-related settings: - $this->searchObject = "VuFind\\Search\\{$this->searchClassId}\\Results"; + $this->searchObject = 'VuFind\Search\\' . $this->searchClassId . '\Results"; } /** diff --git a/module/VuFind/src/VuFind/Controller/AbstractSearch.php b/module/VuFind/src/VuFind/Controller/AbstractSearch.php index b8bc6f559c7..b3f3974c96d 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractSearch.php +++ b/module/VuFind/src/VuFind/Controller/AbstractSearch.php @@ -271,7 +271,7 @@ class AbstractSearch extends AbstractBase */ protected function getParamsClass() { - return 'VuFind\\Search\\' . $this->searchClassId . '\\Params'; + return 'VuFind\Search\\' . $this->searchClassId . '\Params'; } /** @@ -281,7 +281,7 @@ class AbstractSearch extends AbstractBase */ protected function getResultsClass() { - return 'VuFind\\Search\\' . $this->searchClassId . '\\Results'; + return 'VuFind\Search\\' . $this->searchClassId . '\Results'; } /** diff --git a/module/VuFind/src/VuFind/Controller/AjaxController.php b/module/VuFind/src/VuFind/Controller/AjaxController.php index 997424268ff..0f8eb54df10 100644 --- a/module/VuFind/src/VuFind/Controller/AjaxController.php +++ b/module/VuFind/src/VuFind/Controller/AjaxController.php @@ -60,7 +60,7 @@ class AjaxController extends AbstractBase public function __construct() { // Add notices to a key in the output - set_error_handler(array("VuFind\\Controller\\AjaxController", "storeError")); + set_error_handler(array('VuFind\Controller\AjaxController', "storeError")); } /** @@ -106,7 +106,7 @@ class AjaxController extends AbstractBase // Process recommendations -- for now, we assume Solr-based search objects, // since deferred recommendations work best for modules that don't care about // the details of the search objects anyway: - $class = 'VuFind\\Recommend\\' . $this->params()->fromQuery('mod'); + $class = 'VuFind\Recommend\\' . $this->params()->fromQuery('mod'); $module = new $class($this->params()->fromQuery('params')); $params = new \VuFind\Search\Solr\Params(); $module->init($params, $this->getRequest()->getQuery()); @@ -888,14 +888,14 @@ class AjaxController extends AbstractBase $id = $list->updateFromRequest($user, $this->getRequest()->getPost()); } catch (\Exception $e) { switch(get_class($e)) { - case 'VuFind\\Exception\\LoginRequired': + case 'VuFind\Exception\LoginRequired': return $this->output( Translator::translate('You must be logged in first'), self::STATUS_NEED_AUTH ); break; - case 'VuFind\\Exception\\ListPermission': - case 'VuFind\\Exception\\MissingField': + case 'VuFind\Exception\ListPermission': + case 'VuFind\Exception\MissingField': return $this->output( Translator::translate($e->getMessage()), self::STATUS_ERROR ); diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php index 83d000dbfa3..ea6408ee614 100644 --- a/module/VuFind/src/VuFind/Controller/MyResearchController.php +++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php @@ -598,12 +598,12 @@ class MyResearchController extends AbstractBase return $this->redirect()->toRoute('userList', array('id' => $finalId)); } catch (\Exception $e) { switch(get_class($e)) { - case 'VuFind\\Exception\\ListPermission': - case 'VuFind\\Exception\\MissingField': + case 'VuFind\Exception\ListPermission': + case 'VuFind\Exception\MissingField': $this->flashMessenger()->setNamespace('error') ->addMessage($e->getMessage()); return false; - case 'VuFind\\Exception\\LoginRequired': + case 'VuFind\Exception\LoginRequired': return $this->forceLogin(); default: throw $e; diff --git a/module/VuFind/src/VuFind/Http/Client.php b/module/VuFind/src/VuFind/Http/Client.php index a9ed9495272..a136d31b139 100644 --- a/module/VuFind/src/VuFind/Http/Client.php +++ b/module/VuFind/src/VuFind/Http/Client.php @@ -98,7 +98,7 @@ class Client extends BaseClient // Proxy server settings if (isset($config->Proxy->host) && !$skipProxy) { $options = array( - 'adapter' => 'Zend\\Http\\Client\\Adapter\\Proxy', + 'adapter' => 'Zend\Http\Client\Adapter\Proxy', 'proxy_host' => $config->Proxy->host ); if (isset($config->Proxy->port)) { @@ -107,7 +107,7 @@ class Client extends BaseClient $this->setConfig($options); } else { // Default if no proxy settings found: - $this->setAdapter('Zend\\Http\\Client\\Adapter\\Socket'); + $this->setAdapter('Zend\Http\Client\Adapter\Socket'); } } } diff --git a/module/VuFind/src/VuFind/ILS/Connection.php b/module/VuFind/src/VuFind/ILS/Connection.php index 3a63d578d06..cf493e3f26e 100644 --- a/module/VuFind/src/VuFind/ILS/Connection.php +++ b/module/VuFind/src/VuFind/ILS/Connection.php @@ -72,7 +72,7 @@ class Connection if (!isset($config->Catalog->driver)) { throw new ILSException('ILS driver setting missing.'); } - $class = 'VuFind\\ILS\\Driver\\' . $config->Catalog->driver; + $class = 'VuFind\ILS\Driver\\' . $config->Catalog->driver; if (!class_exists($class)) { // Don't throw ILSException here -- we don't want this to be // treated as a login problem; it's more serious than that! @@ -88,7 +88,7 @@ class Connection try { $this->getDriver(); } catch (\Exception $e) { - $this->driverClass = 'VuFind\\ILS\\Driver\\NoILS'; + $this->driverClass = 'VuFind\ILS\Driver\NoILS'; } } } diff --git a/module/VuFind/src/VuFind/Log/Logger.php b/module/VuFind/src/VuFind/Log/Logger.php index c9a798b6385..6b472a36450 100644 --- a/module/VuFind/src/VuFind/Log/Logger.php +++ b/module/VuFind/src/VuFind/Log/Logger.php @@ -123,7 +123,7 @@ class Logger extends BaseLogger // Null writer to avoid errors if (count($this->writers) == 0) { - $nullWriter = 'Zend\\Log\\Writer\\Null'; + $nullWriter = 'Zend\Log\Writer\Null'; $this->addWriter(new $nullWriter()); } } diff --git a/module/VuFind/src/VuFind/OAI/Server.php b/module/VuFind/src/VuFind/OAI/Server.php index c48a5bb24cf..73e2601bc66 100644 --- a/module/VuFind/src/VuFind/OAI/Server.php +++ b/module/VuFind/src/VuFind/OAI/Server.php @@ -501,9 +501,9 @@ class Server // we'll assume that this list is short enough to load in a single response; // it may be necessary to implement a resumption token mechanism if this // proves not to be the case: - $paramsClass = 'VuFind\\Search\\' . $this->searchClassId . '\\Params'; + $paramsClass = 'VuFind\Search\\' . $this->searchClassId . '\Params'; $params = new $paramsClass(); - $resultsClass = 'VuFind\\Search\\' . $this->searchClassId . '\\Results'; + $resultsClass = 'VuFind\Search\\' . $this->searchClassId . '\Results'; $results = new $resultsClass($params); try { $facets = $results->getFullFieldFacets(array($this->setField)); @@ -557,7 +557,7 @@ class Server $set = '' ) { // Set up search parameters: - $paramsClass = 'VuFind\\Search\\' . $this->searchClassId . '\\Params'; + $paramsClass = 'VuFind\Search\\' . $this->searchClassId . '\Params'; $params = new $paramsClass(); $params->setLimit($limit); $params->disableHighlighting(); @@ -578,7 +578,7 @@ class Server } // Perform a Solr search: - $resultsClass = 'VuFind\\Search\\' . $this->searchClassId . '\\Results'; + $resultsClass = 'VuFind\Search\\' . $this->searchClassId . '\Results'; $results = new $resultsClass($params); $results->overrideStartRecord($offset + 1); @@ -681,7 +681,7 @@ class Server // Strip the ID prefix, if necessary: $id = $this->stripID($id); if ($id !== false) { - $resultsClass = 'VuFind\\Search\\' . $this->searchClassId . '\\Results'; + $resultsClass = 'VuFind\Search\\' . $this->searchClassId . '\Results'; try { return $resultsClass::getRecord($id); } catch (RecordMissingException $e) { diff --git a/module/VuFind/src/VuFind/Recommend/SearchObject.php b/module/VuFind/src/VuFind/Recommend/SearchObject.php index 70a3c9271d7..8f0409b2488 100644 --- a/module/VuFind/src/VuFind/Recommend/SearchObject.php +++ b/module/VuFind/src/VuFind/Recommend/SearchObject.php @@ -78,13 +78,13 @@ abstract class SearchObject implements RecommendInterface { // Build a search parameters object: $id = $this->getSearchClassId(); - $paramsClass = 'VuFind\\Search\\' . $id . '\\Params'; + $paramsClass = 'VuFind\Search\\' . $id . '\Params'; $params = new $paramsClass(); $params->setLimit($this->limit); $params->setBasicSearch($request->get($this->requestParam)); // Perform the search: - $resultsClass = 'VuFind\\Search\\' . $id . '\\Results'; + $resultsClass = 'VuFind\Search\\' . $id . '\Results'; $this->results = new $resultsClass($params); $this->results->performAndProcessSearch(); } diff --git a/module/VuFind/src/VuFind/Record.php b/module/VuFind/src/VuFind/Record.php index 4e66e458611..2fb8f273d79 100644 --- a/module/VuFind/src/VuFind/Record.php +++ b/module/VuFind/src/VuFind/Record.php @@ -57,7 +57,7 @@ class Record } // Use the appropriate Search class to load the requested record: - $class = 'VuFind\\Search\\' . $source . '\\Results'; + $class = 'VuFind\Search\\' . $source . '\Results'; // Throw an error if we can't find a loader class: if (!class_exists($class)) { diff --git a/module/VuFind/src/VuFind/RecordDriver/AbstractBase.php b/module/VuFind/src/VuFind/RecordDriver/AbstractBase.php index a1109c61fc6..cc1e6061968 100644 --- a/module/VuFind/src/VuFind/RecordDriver/AbstractBase.php +++ b/module/VuFind/src/VuFind/RecordDriver/AbstractBase.php @@ -257,7 +257,7 @@ abstract class AbstractBase $parts = explode(':', $current); $type = $parts[0]; $params = isset($parts[1]) ? $parts[1] : null; - $class = 'VuFind\\Related\\' . $type; + $class = 'VuFind\Related\\' . $type; if (@class_exists($class)) { $retVal[] = new $class($params, $this); } else { diff --git a/module/VuFind/src/VuFind/Resolver/Connection.php b/module/VuFind/src/VuFind/Resolver/Connection.php index 1e7c2a018b3..392dc314234 100644 --- a/module/VuFind/src/VuFind/Resolver/Connection.php +++ b/module/VuFind/src/VuFind/Resolver/Connection.php @@ -90,7 +90,7 @@ class Connection if (strtolower($driver) == '360link') { $driver = 'threesixtylink'; } - $class = 'VuFind\\Resolver\\Driver\\' . ucwords($driver); + $class = 'VuFind\Resolver\Driver\\' . ucwords($driver); if (class_exists($class)) { $this->driver = new $class(); $this->status = true; diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index f142fe0773f..82a9dfc2218 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -790,7 +790,7 @@ class Params // Break apart the setting into module name and extra parameters: $current = explode(':', $current); $module = array_shift($current); - $class = 'VuFind\\Recommend\\' . $module; + $class = 'VuFind\Recommend\\' . $module; $params = implode(':', $current); // Build a recommendation module with the provided settings. diff --git a/module/VuFind/src/VuFind/Search/Favorites/Results.php b/module/VuFind/src/VuFind/Search/Favorites/Results.php index ebdfeab098c..beaf8a034ac 100644 --- a/module/VuFind/src/VuFind/Search/Favorites/Results.php +++ b/module/VuFind/src/VuFind/Search/Favorites/Results.php @@ -185,7 +185,7 @@ class Results extends BaseResults public static function getRecord($id) { throw new \Exception( - 'getRecord not supported by VuFind\\Search\\Favorites\\Results' + 'getRecord not supported by VuFind\Search\Favorites\Results' ); } diff --git a/module/VuFind/src/VuFind/Search/Minified.php b/module/VuFind/src/VuFind/Search/Minified.php index 058ef06657a..a05fc4e86f5 100644 --- a/module/VuFind/src/VuFind/Search/Minified.php +++ b/module/VuFind/src/VuFind/Search/Minified.php @@ -155,8 +155,8 @@ class Minified // Simple case -- this is a recently-built object which has a search class ID // populated: if (isset($this->cl)) { - $this->pc = 'VuFind\\Search\\' . $this->cl . '\\Params'; - $this->rc = 'VuFind\\Search\\' . $this->cl . '\\Results'; + $this->pc = 'VuFind\Search\\' . $this->cl . '\Params'; + $this->rc = 'VuFind\Search\\' . $this->cl . '\Results'; return; } @@ -165,25 +165,25 @@ class Minified switch($this->ty) { case 'Summon': case 'SummonAdvanced': - $this->pc = 'VuFind\\Search\\Summon\\Params'; - $this->rc = 'VuFind\\Search\\Summon\\Results'; + $this->pc = 'VuFind\Search\Summon\Params'; + $this->rc = 'VuFind\Search\Summon\Results'; $fixType = true; break; case 'WorldCat': case 'WorldCatAdvanced': - $this->pc = 'VuFind\\Search\\WorldCat\\Params'; - $this->rc = 'VuFind\\Search\\WorldCat\\Results'; + $this->pc = 'VuFind\Search\WorldCat\Params'; + $this->rc = 'VuFind\Search\WorldCat\Results'; $fixType = true; break; case 'Authority': case 'AuthorityAdvanced': - $this->pc = 'VuFind\\Search\\SolrAuth\\Params'; - $this->rc = 'VuFind\\Search\\SolrAuth\\Results'; + $this->pc = 'VuFind\Search\SolrAuth\Params'; + $this->rc = 'VuFind\Search\SolrAuth\Results'; $fixType = true; break; default: - $this->pc = 'VuFind\\Search\\Solr\\Params'; - $this->rc = 'VuFind\\Search\\Solr\\Results'; + $this->pc = 'VuFind\Search\Solr\Params'; + $this->rc = 'VuFind\Search\Solr\Results'; $fixType = false; break; } diff --git a/module/VuFind/src/VuFind/Search/MixedList/Results.php b/module/VuFind/src/VuFind/Search/MixedList/Results.php index 097ec572429..3b82fb46517 100644 --- a/module/VuFind/src/VuFind/Search/MixedList/Results.php +++ b/module/VuFind/src/VuFind/Search/MixedList/Results.php @@ -76,7 +76,7 @@ class Results extends BaseResults public static function getRecord($id) { throw new \Exception( - 'getRecord not supported by VuFind\\Search\\MixedList\\Results' + 'getRecord not supported by VuFind\Search\MixedList\Results' ); } } \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Search/Options.php b/module/VuFind/src/VuFind/Search/Options.php index e32b671b07e..386f418038d 100644 --- a/module/VuFind/src/VuFind/Search/Options.php +++ b/module/VuFind/src/VuFind/Search/Options.php @@ -50,7 +50,7 @@ class Options static $store = array(); if (!isset($store[$type])) { - $class = 'VuFind\\Search\\' . $type . '\\Options'; + $class = 'VuFind\Search\\' . $type . '\Options'; $store[$type] = new $class(); } return $store[$type]; diff --git a/module/VuFind/src/VuFind/Search/Solr/Results.php b/module/VuFind/src/VuFind/Search/Solr/Results.php index baa27421961..ecd9fe3ac11 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Results.php +++ b/module/VuFind/src/VuFind/Search/Solr/Results.php @@ -535,12 +535,12 @@ class Results extends BaseResults static $badClasses = array(); // Determine driver path based on record type: - $driver = 'VuFind\\RecordDriver\\Solr' . ucwords($data['recordtype']); + $driver = 'VuFind\RecordDriver\Solr' . ucwords($data['recordtype']); // If we can't load the driver, fall back to the default, index-based one: if (isset($badClasses[$driver]) || !@class_exists($driver)) { $badClasses[$driver] = 1; - $driver = 'VuFind\\RecordDriver\\SolrDefault'; + $driver = 'VuFind\RecordDriver\SolrDefault'; } // Build the object: diff --git a/module/VuFind/src/VuFind/Search/Tags/Results.php b/module/VuFind/src/VuFind/Search/Tags/Results.php index da108fe122d..bbf1918514d 100644 --- a/module/VuFind/src/VuFind/Search/Tags/Results.php +++ b/module/VuFind/src/VuFind/Search/Tags/Results.php @@ -86,7 +86,7 @@ class Results extends BaseResults public static function getRecord($id) { throw new \Exception( - 'getRecord not supported by VuFind\\Tags\\Favorites\\Results' + 'getRecord not supported by VuFind\Search\Tags\Results' ); } diff --git a/module/VuFind/src/VuFind/Statistics/AbstractBase.php b/module/VuFind/src/VuFind/Statistics/AbstractBase.php index cd20bf13ccf..0500c5cf98f 100644 --- a/module/VuFind/src/VuFind/Statistics/AbstractBase.php +++ b/module/VuFind/src/VuFind/Statistics/AbstractBase.php @@ -94,7 +94,7 @@ abstract class AbstractBase } // If we got this far, we want the current option! Build the driver: - $class = 'VuFind\\Statistics\\Driver\\' . ucwords($setting[0]); + $class = 'VuFind\Statistics\Driver\\' . ucwords($setting[0]); // When we construct the driver, we pass the name of the data source; // we use the special value "global" to represent global writer diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php b/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php index 36781b9a022..07d7445df14 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php @@ -116,7 +116,7 @@ class Citation extends AbstractHelper // If this data comes from a MARC record, we can probably assume that // anything without a comma is a valid corporate author that should be // left alone... - if (is_a($this->driver, 'VuFind\\RecordDriver\\SolrMarc')) { + if (is_a($this->driver, 'VuFind\RecordDriver\SolrMarc')) { return $authors; } -- GitLab