diff options
author | robocoder <anthon.pang@gmail.com> | 2009-07-08 08:19:14 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2009-07-08 08:19:14 +0400 |
commit | 4fb541d1bb1b2bed65142ee2ec98a4a554001165 (patch) | |
tree | 2681dc3b6ee7393c03dca36359a9c9bb8c22d63c /core | |
parent | 0cc45658c8f23e14dceb663037f512d47ea4e506 (diff) |
fixes #803 - remove unnecessary require_once from core, plugins, and parts of
libs. (I didn't touch: open-flash-chart, Zend Framework, and PEAR HTML.)
git-svn-id: http://dev.piwik.org/svn/trunk@1296 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core')
112 files changed, 107 insertions, 356 deletions
diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php index ddf19b2923..fe5683ae4d 100644 --- a/core/API/DataTableGenericFilter.php +++ b/core/API/DataTableGenericFilter.php @@ -134,4 +134,3 @@ class Piwik_API_DataTableGenericFilter } } } - diff --git a/core/API/DocumentationGenerator.php b/core/API/DocumentationGenerator.php index 7dee28ecd6..a21fba77d5 100644 --- a/core/API/DocumentationGenerator.php +++ b/core/API/DocumentationGenerator.php @@ -23,7 +23,7 @@ class Piwik_API_DocumentationGenerator { $plugin = Piwik::unprefixClass($plugin); try { - Piwik_API_Proxy::getInstance()->registerClass("Piwik_".$plugin."_API"); + Piwik_API_Proxy::getInstance()->registerClass('Piwik_'.$plugin.'_API'); } catch(Exception $e){ } diff --git a/core/API/Proxy.php b/core/API/Proxy.php index 1fc5742187..9266e5e408 100644 --- a/core/API/Proxy.php +++ b/core/API/Proxy.php @@ -9,7 +9,6 @@ * @package Piwik_API */ - /** * Proxy is a singleton that has the knowledge of every method available, their parameters * and default values. @@ -225,20 +224,13 @@ class Piwik_API_Proxy private function includeApiFile($fileName) { $module = self::getModuleNameFromClassName($fileName); - $potentialPaths = array( $module ."/API.php", ); - - $found = false; - foreach($potentialPaths as $path) + $path = PIWIK_INCLUDE_PATH . '/plugins/' . $module . '/API.php'; + + if(Zend_Loader::isReadable($path)) { - if(Zend_Loader::isReadable($path)) - { - require_once $path; - $found = true; - break; - } + require_once $path; // prefixed by PIWIK_INCLUDE_PATH } - - if(!$found) + else { throw new Exception("API module $module not found."); } diff --git a/core/API/Request.php b/core/API/Request.php index aee3c3fc9b..5a3333fbb3 100644 --- a/core/API/Request.php +++ b/core/API/Request.php @@ -10,9 +10,6 @@ * @package Piwik_API */ -require_once "API/ResponseBuilder.php"; -require_once "API/DataTableGenericFilter.php"; - /** * An API request is the object used to make a call to the API and get the result. * The request has the format of a normal GET request, ie. parameter_1=X¶meter_2=Y @@ -134,5 +131,4 @@ class Piwik_API_Request } return $a; } - } diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php index 80cdc38aa4..ddcbfdb6e1 100644 --- a/core/API/ResponseBuilder.php +++ b/core/API/ResponseBuilder.php @@ -247,7 +247,6 @@ class Piwik_API_ResponseBuilder protected function handleScalar($scalar) { - require_once "DataTable/Simple.php"; $dataTable = new Piwik_DataTable_Simple(); $dataTable->addRowsFromArray( array($scalar) ); return $this->getRenderedDataTable($dataTable); @@ -292,6 +291,5 @@ class Piwik_API_ResponseBuilder $dataTable->addRowsFromSimpleArray($array); return $this->getRenderedDataTable($dataTable); } - } - + } } diff --git a/core/Access.php b/core/Access.php index cb502ee65c..fe67922039 100644 --- a/core/Access.php +++ b/core/Access.php @@ -34,7 +34,6 @@ * * @package Piwik */ - class Piwik_Access { /** diff --git a/core/Archive.php b/core/Archive.php index 265b2c54f6..a9029db3ac 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -9,11 +9,6 @@ * @package Piwik */ -require_once 'Period.php'; -require_once 'Date.php'; -require_once 'ArchiveProcessing.php'; -require_once 'Archive/Single.php'; - /** * The archive object is used to query specific data for a day or a period of statistics for a given website. * @@ -135,7 +130,6 @@ abstract class Piwik_Archive if( count($sites) > 1 || $idSite === 'all' ) { - require_once 'Archive/Array/IndexedBySite.php'; $archive = new Piwik_Archive_Array_IndexedBySite($sites, $period, $strDate); } // if a period date string is detected: either 'last30', 'previous10' or 'YYYY-MM-DD,YYYY-MM-DD' @@ -147,7 +141,6 @@ abstract class Piwik_Archive ) { $oSite = new Piwik_Site($idSite); - require_once 'Archive/Array/IndexedByDate.php'; $archive = new Piwik_Archive_Array_IndexedByDate($oSite, $period, $strDate); } // case we request a single archive @@ -266,11 +259,5 @@ abstract class Piwik_Archive public function getIdSite() { return $this->site->getId(); - } - + } } - - - - - diff --git a/core/Archive/Array.php b/core/Archive/Array.php index 7501f02243..4e6b875cc7 100644 --- a/core/Archive/Array.php +++ b/core/Archive/Array.php @@ -10,8 +10,6 @@ * @package Piwik_Archive */ -require_once "DataTable/Simple.php"; -require_once "DataTable/Array.php"; /** * Piwik_Archive_Array is used to store multiple archives, * for example one archive for a given day for each Piwik website diff --git a/core/Archive/Array/IndexedByDate.php b/core/Archive/Array/IndexedByDate.php index 79919285dd..f9b3d6e24a 100644 --- a/core/Archive/Array/IndexedByDate.php +++ b/core/Archive/Array/IndexedByDate.php @@ -9,8 +9,6 @@ * @package Piwik_Archive */ -require_once "Archive/Array.php"; - class Piwik_Archive_Array_IndexedByDate extends Piwik_Archive_Array { /** diff --git a/core/Archive/Array/IndexedBySite.php b/core/Archive/Array/IndexedBySite.php index a2f2bfa385..57479f2a9e 100644 --- a/core/Archive/Array/IndexedBySite.php +++ b/core/Archive/Array/IndexedBySite.php @@ -9,8 +9,6 @@ * @package Piwik_Archive */ -require_once "Archive/Array.php"; - class Piwik_Archive_Array_IndexedBySite extends Piwik_Archive_Array { /** diff --git a/core/Archive/Single.php b/core/Archive/Single.php index f8e980729d..2911666837 100644 --- a/core/Archive/Single.php +++ b/core/Archive/Single.php @@ -394,7 +394,6 @@ class Piwik_Archive_Single extends Piwik_Archive */ public function getDataTableFromNumeric( $fields ) { - require_once "DataTable/Simple.php"; if(!is_array($fields)) { $fields = array($fields); diff --git a/core/ArchiveProcessing.php b/core/ArchiveProcessing.php index 7428fdc9ca..12673d344d 100644 --- a/core/ArchiveProcessing.php +++ b/core/ArchiveProcessing.php @@ -9,12 +9,6 @@ * @package Piwik_ArchiveProcessing */ -require_once 'TablePartitioning.php'; -require_once 'ArchiveProcessing/Record.php'; -require_once 'ArchiveProcessing/RecordArray.php'; -require_once "ArchiveProcessing/Record/Numeric.php"; -require_once 'DataTable.php'; - /** * The ArchiveProcessing module is a module that reads the Piwik logs from the DB and * compute all the reports, which are then stored in the database. @@ -199,14 +193,12 @@ abstract class Piwik_ArchiveProcessing switch($name) { case 'day': - require_once 'ArchiveProcessing/Day.php'; $process = new Piwik_ArchiveProcessing_Day(); break; case 'week': case 'month': case 'year': - require_once 'ArchiveProcessing/Period.php'; $process = new Piwik_ArchiveProcessing_Period(); break; diff --git a/core/ArchiveProcessing/Day.php b/core/ArchiveProcessing/Day.php index 644df03724..7a7855315b 100644 --- a/core/ArchiveProcessing/Day.php +++ b/core/ArchiveProcessing/Day.php @@ -9,7 +9,6 @@ * @package Piwik_ArchiveProcessing */ - /** * Handles the archiving process for a day. * The class provides generic helper methods to manipulate data from the DB, @@ -426,5 +425,3 @@ class Piwik_ArchiveProcessing_Day extends Piwik_ArchiveProcessing ); } } - - diff --git a/core/ArchiveProcessing/Period.php b/core/ArchiveProcessing/Period.php index e347f4a701..7a02577acf 100644 --- a/core/ArchiveProcessing/Period.php +++ b/core/ArchiveProcessing/Period.php @@ -328,6 +328,5 @@ class Piwik_ArchiveProcessing_Period extends Piwik_ArchiveProcessing destroy($archive); } $this->archives = array(); - } - + } } diff --git a/core/ArchiveProcessing/Record.php b/core/ArchiveProcessing/Record.php index e75e1465a6..8b1c9680f0 100644 --- a/core/ArchiveProcessing/Record.php +++ b/core/ArchiveProcessing/Record.php @@ -39,6 +39,3 @@ abstract class Piwik_ArchiveProcessing_Record destroy($this->value); } } - - - diff --git a/core/ArchiveProcessing/RecordArray.php b/core/ArchiveProcessing/RecordArray.php index fc279ef29b..c7d2990b11 100644 --- a/core/ArchiveProcessing/RecordArray.php +++ b/core/ArchiveProcessing/RecordArray.php @@ -9,7 +9,6 @@ * @package Piwik_ArchiveProcessing */ -require_once "ArchiveProcessing/Record/Blob.php"; /** * Array of blob records. * Useful for easily saving splited data in the DB. diff --git a/core/Auth.php b/core/Auth.php index aeed44a27d..036a0aef15 100644 --- a/core/Auth.php +++ b/core/Auth.php @@ -9,8 +9,6 @@ * @package Piwik */ -require "Zend/Auth/Result.php"; - interface Piwik_Auth { /** * Authentication module's name, e.g., "Login" diff --git a/core/CacheFile.php b/core/CacheFile.php index 83b276239d..8cd42b4aed 100644 --- a/core/CacheFile.php +++ b/core/CacheFile.php @@ -24,8 +24,7 @@ class Piwik_CacheFile function __construct($directory) { - $this->cachePath = PIWIK_INCLUDE_PATH . "/tmp/cache/"; - $this->cachePath .= $directory . "/"; + $this->cachePath = PIWIK_INCLUDE_PATH . '/tmp/cache/' . $directory . '/'; // echo $this->cachePath;exit; } @@ -41,7 +40,7 @@ class Piwik_CacheFile $content = ''; // We are assuming that most of the time cache will exists - $ok = @include($this->cachePath . $id . ".php"); + $ok = @include($this->cachePath . $id . '.php'); if ($ok && $cache_complete == true) { return $content; @@ -67,7 +66,7 @@ class Piwik_CacheFile return false; } - $id = $this->cachePath . $id . ".php"; + $id = $this->cachePath . $id . '.php'; $cache_literal = "<"."?php\n\n"; $cache_literal .= "$"."content = ".var_export($content, true).";\n\n"; @@ -95,7 +94,6 @@ class Piwik_CacheFile return false; } - /** * A function to delete a single cache entry * @@ -104,7 +102,7 @@ class Piwik_CacheFile */ function delete($id) { - $filename = $this->cachePath . $id . ".php"; + $filename = $this->cachePath . $id . '.php'; if (file_exists($filename)) { @unlink ($filename); return true; diff --git a/core/Common.php b/core/Common.php index 671dab4eac..456e5ff641 100644 --- a/core/Common.php +++ b/core/Common.php @@ -73,7 +73,7 @@ class Piwik_Common */ static function getCacheWebsiteAttributes( $idSite ) { - require_once "Loader.php"; + require_once PIWIK_INCLUDE_PATH . '/core/Loader.php'; static $cache = null; if(is_null($cache)) @@ -89,9 +89,9 @@ class Piwik_Common if(defined('PIWIK_TRACKER_MODE') && PIWIK_TRACKER_MODE) { - require_once "PluginsManager.php"; - require_once "Translate.php"; - require_once "Option.php"; + require_once PIWIK_INCLUDE_PATH . '/core/PluginsManager.php'; + require_once PIWIK_INCLUDE_PATH . '/core/Translate.php'; + require_once PIWIK_INCLUDE_PATH . '/core/Option.php'; Zend_Registry::set('db', Piwik_Tracker::getDatabase()); Piwik::createAccessObject(); @@ -569,7 +569,7 @@ class Piwik_Common */ static public function getContinent($country) { - require_once "DataFiles/Countries.php"; + require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Countries.php'; $countryList = $GLOBALS['Piwik_CountryList']; if(isset($countryList[$country][0])) { @@ -649,7 +649,7 @@ class Piwik_Common static $countriesList = null; if(is_null($countriesList)) { - require_once "DataFiles/Countries.php"; + require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Countries.php'; $countriesList = array_keys($GLOBALS['Piwik_CountryList']); } return $countriesList; @@ -664,7 +664,7 @@ class Piwik_Common static $langToCountry = null; if(is_null($langToCountry)) { - require_once "DataFiles/LanguageToCountry.php"; + require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/LanguageToCountry.php'; $langToCountry = array_keys($GLOBALS['Piwik_LanguageToCountry']); } @@ -765,7 +765,7 @@ class Piwik_Common { return false; } - require_once "DataFiles/SearchEngines.php"; + require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/SearchEngines.php'; if(!array_key_exists($refererHost, $GLOBALS['Piwik_SearchEngines'])) { diff --git a/core/Config.php b/core/Config.php index 7274a7bd9d..83758500b8 100644 --- a/core/Config.php +++ b/core/Config.php @@ -9,9 +9,6 @@ * @package Piwik_Helper */ -require_once "Zend/Config/Ini.php"; -require_once "Zend/Registry.php"; - /** * This class is used to access configuration files values. * You can also set these values, the updated configuration files will be written at the end of the script execution. diff --git a/core/Controller.php b/core/Controller.php index 94e51d8437..277003ec26 100644 --- a/core/Controller.php +++ b/core/Controller.php @@ -9,7 +9,6 @@ * @package Piwik */ -require_once "ViewDataTable.php"; /** * Parent class of all plugins Controllers (located in /plugins/PluginName/Controller.php * It defines some helper functions controllers can use. @@ -126,7 +125,6 @@ abstract class Piwik_Controller */ protected function getLastUnitGraph($currentModuleName, $currentControllerAction, $apiMethod) { - require_once "ViewDataTable/GenerateGraphHTML.php"; $view = Piwik_ViewDataTable::factory('graphEvolution'); $view->init( $currentModuleName, $currentControllerAction, $apiMethod ); diff --git a/core/Cookie.php b/core/Cookie.php index 2558ff8ab6..518a1d316f 100644 --- a/core/Cookie.php +++ b/core/Cookie.php @@ -9,7 +9,6 @@ * @package Piwik_Helper */ - /** * Simple class to handle the cookies: * - read a cookie values diff --git a/core/DataFiles/Countries.php b/core/DataFiles/Countries.php index bd216bba3c..22b0753fbe 100644 --- a/core/DataFiles/Countries.php +++ b/core/DataFiles/Countries.php @@ -288,4 +288,3 @@ if(!isset($GLOBALS['Piwik_CountryList'])) 'zr' => array('afr') ); } - diff --git a/core/DataTable.php b/core/DataTable.php index 5ab1a3a8e3..1d6b663254 100644 --- a/core/DataTable.php +++ b/core/DataTable.php @@ -9,12 +9,6 @@ * @package Piwik_DataTable */ -require_once "DataTable/Renderer.php"; -require_once "DataTable/Renderer/Console.php"; -require_once "DataTable/Filter.php"; -require_once "DataTable/Row.php"; -require_once "DataTable/Manager.php"; - /** * * ---- DataTable @@ -1165,4 +1159,3 @@ class Piwik_DataTable } } - diff --git a/core/DataTable/Array.php b/core/DataTable/Array.php index 5e011e3528..7e8573e95d 100644 --- a/core/DataTable/Array.php +++ b/core/DataTable/Array.php @@ -170,5 +170,3 @@ class Piwik_DataTable_Array } } } - - diff --git a/core/DataTable/Filter.php b/core/DataTable/Filter.php index 583598eab9..0ee70234ca 100644 --- a/core/DataTable/Filter.php +++ b/core/DataTable/Filter.php @@ -41,23 +41,3 @@ abstract class Piwik_DataTable_Filter abstract protected function filter(); } - -require_once "DataTable/Filter/ColumnCallbackDeleteRow.php"; -require_once "DataTable/Filter/ColumnCallbackAddMetadata.php"; -require_once "DataTable/Filter/ColumnCallbackReplace.php"; -require_once "DataTable/Filter/ColumnCallbackAddColumnPercentage.php"; -require_once "DataTable/Filter/MetadataCallbackAddMetadata.php"; -require_once "DataTable/Filter/MetadataCallbackReplace.php"; -require_once "DataTable/Filter/AddConstantMetadata.php"; -require_once "DataTable/Filter/Null.php"; -require_once "DataTable/Filter/ExcludeLowPopulation.php"; -require_once "DataTable/Filter/Limit.php"; -require_once "DataTable/Filter/Pattern.php"; -require_once "DataTable/Filter/PatternRecursive.php"; -require_once "DataTable/Filter/ReplaceColumnNames.php"; -require_once "DataTable/Filter/Sort.php"; -require_once "DataTable/Filter/AddSummaryRow.php"; -require_once "DataTable/Filter/ReplaceSummaryRowLabel.php"; -require_once "DataTable/Filter/SafeDecodeLabel.php"; -require_once "DataTable/Filter/AddColumnsWhenShowAllColumns.php"; -require_once "DataTable/Filter/UpdateColumnsWhenShowAllGoals.php"; diff --git a/core/DataTable/Filter/AddColumnsWhenShowAllColumns.php b/core/DataTable/Filter/AddColumnsWhenShowAllColumns.php index 83e9ecfb85..feed5653f1 100644 --- a/core/DataTable/Filter/AddColumnsWhenShowAllColumns.php +++ b/core/DataTable/Filter/AddColumnsWhenShowAllColumns.php @@ -44,5 +44,4 @@ class Piwik_DataTable_Filter_AddColumnsWhenShowAllColumns extends Piwik_DataTabl } $this->table->deleteRows($rowsIdToDelete); } - } diff --git a/core/DataTable/Filter/AddConstantMetadata.php b/core/DataTable/Filter/AddConstantMetadata.php index 33c573120b..b5932a81de 100644 --- a/core/DataTable/Filter/AddConstantMetadata.php +++ b/core/DataTable/Filter/AddConstantMetadata.php @@ -40,4 +40,3 @@ class Piwik_DataTable_Filter_AddConstantMetadata extends Piwik_DataTable_Filter } } } - diff --git a/core/DataTable/Filter/ColumnCallbackAddMetadata.php b/core/DataTable/Filter/ColumnCallbackAddMetadata.php index 4cca02ac2c..e65940745f 100644 --- a/core/DataTable/Filter/ColumnCallbackAddMetadata.php +++ b/core/DataTable/Filter/ColumnCallbackAddMetadata.php @@ -9,7 +9,6 @@ * @package Piwik_DataTable */ - /** * Add a new 'metadata' column to the table based on the value resulting * from a callback function with the parameter being another column's value @@ -53,4 +52,3 @@ class Piwik_DataTable_Filter_ColumnCallbackAddMetadata extends Piwik_DataTable_F } } } - diff --git a/core/DataTable/Filter/ColumnCallbackDeleteRow.php b/core/DataTable/Filter/ColumnCallbackDeleteRow.php index 8367d67b44..81136b0aa8 100644 --- a/core/DataTable/Filter/ColumnCallbackDeleteRow.php +++ b/core/DataTable/Filter/ColumnCallbackDeleteRow.php @@ -41,4 +41,3 @@ class Piwik_DataTable_Filter_ColumnCallbackDeleteRow extends Piwik_DataTable_Fil } } } - diff --git a/core/DataTable/Filter/ExcludeLowPopulation.php b/core/DataTable/Filter/ExcludeLowPopulation.php index 67b2c2c352..b6c57d09c6 100644 --- a/core/DataTable/Filter/ExcludeLowPopulation.php +++ b/core/DataTable/Filter/ExcludeLowPopulation.php @@ -56,4 +56,3 @@ class Piwik_DataTable_Filter_ExcludeLowPopulation extends Piwik_DataTable_Filter return $value >= self::$minimumValue; } } - diff --git a/core/DataTable/Filter/Limit.php b/core/DataTable/Filter/Limit.php index 1587ca9a0a..71fa7c94dd 100644 --- a/core/DataTable/Filter/Limit.php +++ b/core/DataTable/Filter/Limit.php @@ -55,5 +55,3 @@ class Piwik_DataTable_Filter_Limit extends Piwik_DataTable_Filter } } } - - diff --git a/core/DataTable/Filter/MetadataCallbackAddMetadata.php b/core/DataTable/Filter/MetadataCallbackAddMetadata.php index 78d9f5f1cc..9fa8bd6139 100644 --- a/core/DataTable/Filter/MetadataCallbackAddMetadata.php +++ b/core/DataTable/Filter/MetadataCallbackAddMetadata.php @@ -45,4 +45,3 @@ class Piwik_DataTable_Filter_MetadataCallbackAddMetadata extends Piwik_DataTable } } } - diff --git a/core/DataTable/Filter/Null.php b/core/DataTable/Filter/Null.php index 680572a6df..fdb04b9a6e 100644 --- a/core/DataTable/Filter/Null.php +++ b/core/DataTable/Filter/Null.php @@ -32,4 +32,3 @@ class Piwik_DataTable_Filter_Null extends Piwik_DataTable_Filter } } } - diff --git a/core/DataTable/Filter/Pattern.php b/core/DataTable/Filter/Pattern.php index 8ab437c9bb..5a444a4fff 100644 --- a/core/DataTable/Filter/Pattern.php +++ b/core/DataTable/Filter/Pattern.php @@ -60,4 +60,3 @@ class Piwik_DataTable_Filter_Pattern extends Piwik_DataTable_Filter } } } - diff --git a/core/DataTable/Filter/PatternRecursive.php b/core/DataTable/Filter/PatternRecursive.php index 130d3190ec..9887181b9d 100644 --- a/core/DataTable/Filter/PatternRecursive.php +++ b/core/DataTable/Filter/PatternRecursive.php @@ -77,4 +77,3 @@ class Piwik_DataTable_Filter_PatternRecursive extends Piwik_DataTable_Filter return $table->getRowsCount(); } } - diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php index 7cc6697065..6b582baca5 100644 --- a/core/DataTable/Filter/ReplaceColumnNames.php +++ b/core/DataTable/Filter/ReplaceColumnNames.php @@ -98,4 +98,3 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter return $newColumns; } } - diff --git a/core/DataTable/Filter/ReplaceSummaryRowLabel.php b/core/DataTable/Filter/ReplaceSummaryRowLabel.php index eb9f275cff..19c13e53c0 100644 --- a/core/DataTable/Filter/ReplaceSummaryRowLabel.php +++ b/core/DataTable/Filter/ReplaceSummaryRowLabel.php @@ -40,4 +40,3 @@ class Piwik_DataTable_Filter_ReplaceSummaryRowLabel extends Piwik_DataTable_Filt } } } - diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php index b3a7860d8e..ae1683b6e3 100644 --- a/core/DataTable/Filter/Sort.php +++ b/core/DataTable/Filter/Sort.php @@ -180,4 +180,3 @@ class Piwik_DataTable_Filter_Sort extends Piwik_DataTable_Filter $this->table->sort( array($this,$methodToUse), $this->columnToSort ); } } - diff --git a/core/DataTable/Filter/UpdateColumnsWhenShowAllGoals.php b/core/DataTable/Filter/UpdateColumnsWhenShowAllGoals.php index 61ce48a8cc..0dc6b50a20 100644 --- a/core/DataTable/Filter/UpdateColumnsWhenShowAllGoals.php +++ b/core/DataTable/Filter/UpdateColumnsWhenShowAllGoals.php @@ -112,4 +112,3 @@ class Piwik_DataTable_Filter_UpdateColumnsWhenShowAllGoals extends Piwik_DataTab } } } - diff --git a/core/DataTable/Manager.php b/core/DataTable/Manager.php index 34926feed3..cedf68e974 100644 --- a/core/DataTable/Manager.php +++ b/core/DataTable/Manager.php @@ -143,4 +143,3 @@ class Piwik_DataTable_Manager echo "<br>-- End Piwik_DataTable_Manager->dumpAllTables()<hr>"; } } - diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php index 66c50ae308..5d65cb90fd 100644 --- a/core/DataTable/Renderer.php +++ b/core/DataTable/Renderer.php @@ -74,13 +74,13 @@ abstract class Piwik_DataTable_Renderer static public function factory( $name ) { $name = ucfirst(strtolower($name)); - $path = "DataTable/Renderer/".$name.".php"; + $path = PIWIK_INCLUDE_PATH .'/core/DataTable/Renderer/'.$name.'.php'; $className = 'Piwik_DataTable_Renderer_' . $name; if( Piwik_Common::isValidFilename($name) && Zend_Loader::isReadable($path) ) { - require_once $path; + require_once $path; // prefixed by PIWIK_INCLUDE_PATH return new $className; } else @@ -89,4 +89,3 @@ abstract class Piwik_DataTable_Renderer } } } - diff --git a/core/DataTable/Renderer/Console.php b/core/DataTable/Renderer/Console.php index f40f7ac19b..ce0fa65482 100644 --- a/core/DataTable/Renderer/Console.php +++ b/core/DataTable/Renderer/Console.php @@ -126,5 +126,3 @@ class Piwik_DataTable_Renderer_Console extends Piwik_DataTable_Renderer } } - - diff --git a/core/DataTable/Renderer/Csv.php b/core/DataTable/Renderer/Csv.php index e824fc9a2c..f7891ec69a 100644 --- a/core/DataTable/Renderer/Csv.php +++ b/core/DataTable/Renderer/Csv.php @@ -9,7 +9,6 @@ * @package Piwik_DataTable */ -require_once "DataTable/Renderer/Php.php"; /** * CSV export * diff --git a/core/DataTable/Renderer/Html.php b/core/DataTable/Renderer/Html.php index 497eac2976..9d457d089e 100644 --- a/core/DataTable/Renderer/Html.php +++ b/core/DataTable/Renderer/Html.php @@ -177,5 +177,4 @@ class Piwik_DataTable_Renderer_Html extends Piwik_DataTable_Renderer @header("Content-Type: text/html;charset=utf-8"); return $xml; } - } diff --git a/core/DataTable/Renderer/Json.php b/core/DataTable/Renderer/Json.php index 4133b9e3cf..25b8248b98 100644 --- a/core/DataTable/Renderer/Json.php +++ b/core/DataTable/Renderer/Json.php @@ -9,7 +9,6 @@ * @package Piwik_DataTable */ -require_once "DataTable/Renderer/Php.php"; /** * JSON export. Using the php 5.2 feature json_encode. * Works with recursive DataTable (when a row can be associated with a subDataTable). diff --git a/core/DataTable/Renderer/Rss.php b/core/DataTable/Renderer/Rss.php index fd2d322831..5359619ffb 100644 --- a/core/DataTable/Renderer/Rss.php +++ b/core/DataTable/Renderer/Rss.php @@ -161,4 +161,3 @@ class Piwik_DataTable_Renderer_Rss extends Piwik_DataTable_Renderer return $html; } } - diff --git a/core/DataTable/Renderer/Xml.php b/core/DataTable/Renderer/Xml.php index 2184b66ced..267aae8381 100644 --- a/core/DataTable/Renderer/Xml.php +++ b/core/DataTable/Renderer/Xml.php @@ -9,7 +9,6 @@ * @package Piwik_DataTable */ -require_once "DataTable/Renderer/Php.php"; /** * XML export of a given DataTable. * See the tests cases for more information about the XML format (/tests/core/DataTable/Renderer.test.php) diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php index d76a4df8fa..291fcd14b1 100644 --- a/core/DataTable/Row.php +++ b/core/DataTable/Row.php @@ -435,5 +435,3 @@ class Piwik_DataTable_Row return true; } } - -require_once "Row/DataTableSummary.php"; diff --git a/core/ErrorHandler.php b/core/ErrorHandler.php index 8d8acac97e..3a4adcaa48 100644 --- a/core/ErrorHandler.php +++ b/core/ErrorHandler.php @@ -9,11 +9,10 @@ * @package Piwik_Helper */ -require_once "Zend/Registry.php"; - -if(!defined('E_STRICT')) { define('E_STRICT', 2048); } -if(!defined('E_RECOVERABLE_ERROR')){ define('E_RECOVERABLE_ERROR', 4096); } -if(!defined('E_EXCEPTION')) { define('E_EXCEPTION', 8192); } +if(!defined('E_STRICT')) { define('E_STRICT', 2048); } +if(!defined('E_RECOVERABLE_ERROR')) { define('E_RECOVERABLE_ERROR', 4096); } +if(!defined('E_DEPRECATED')) { define('E_DEPRECATED', 8192); } +if(!defined('E_USER_DEPRECATED')) { define('E_USER_DEPRECATED', 16384); } /** * Error handler used to display nicely errors in Piwik @@ -49,7 +48,6 @@ function Piwik_ErrorHandler($errno, $errstr, $errfile, $errline) case E_COMPILE_ERROR: case E_COMPILE_WARNING: case E_USER_ERROR: - case E_EXCEPTION: exit; break; @@ -59,9 +57,10 @@ function Piwik_ErrorHandler($errno, $errstr, $errfile, $errline) case E_USER_NOTICE: case E_STRICT: case E_RECOVERABLE_ERROR: + case E_DEPRECATED: + case E_USER_DEPRECATED: default: // do not exit break; } } - diff --git a/core/ExceptionHandler.php b/core/ExceptionHandler.php index 6c494d7a12..9a830f26a4 100644 --- a/core/ExceptionHandler.php +++ b/core/ExceptionHandler.php @@ -36,4 +36,3 @@ function Piwik_ExceptionHandler(Exception $exception) Piwik::exitWithErrorMessage( $message ); } } - diff --git a/core/Form.php b/core/Form.php index f9b0d0ed36..be1f5734fc 100644 --- a/core/Form.php +++ b/core/Form.php @@ -9,10 +9,6 @@ * @package Piwik_Helper */ - -require_once "HTML/QuickForm.php"; -require_once "HTML/QuickForm/Renderer/ArraySmarty.php"; - /** * Parent class for forms to be included in Smarty * diff --git a/core/FrontController.php b/core/FrontController.php index 24f1c3eea8..86503a3433 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -9,9 +9,9 @@ * @package Piwik */ -require_once "PluginsManager.php"; -require_once "Translate.php"; -require_once "Option.php"; +require_once PIWIK_INCLUDE_PATH . '/core/PluginsManager.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Translate.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Option.php'; /** * Front controller. @@ -92,17 +92,17 @@ class Piwik_FrontController throw new Piwik_FrontController_PluginDeactivatedException($module); } - $controllerClassName = "Piwik_".$module."_Controller"; + $controllerClassName = 'Piwik_'.$module.'_Controller'; // FrontController's autoloader if(!class_exists($controllerClassName, false)) { - $moduleController = $module . "/Controller.php"; + $moduleController = PIWIK_INCLUDE_PATH . '/plugins/' . $module . '/Controller.php'; if( !Zend_Loader::isReadable($moduleController)) { throw new Exception("Module controller $moduleController not found!"); } - require_once $moduleController; + require_once $moduleController; // prefixed by PIWIK_INCLUDE_PATH } $controller = new $controllerClassName; diff --git a/core/Loader.php b/core/Loader.php index e9ca5d7ce1..8df94541d3 100644 --- a/core/Loader.php +++ b/core/Loader.php @@ -42,7 +42,7 @@ class Piwik_Loader $path = PIWIK_INCLUDE_PATH . self::$dirs[$i] . $classPath . '.php'; if(file_exists($path)) { - require_once($path); + require_once $path; // prefixed by PIWIK_INCLUDE_PATH if(class_exists($class, false) || interface_exists($class, false)) { return; diff --git a/core/Log.php b/core/Log.php index b09cfe1769..85067a3b91 100644 --- a/core/Log.php +++ b/core/Log.php @@ -9,13 +9,6 @@ * @package Piwik_Log */ -require_once "Zend/Log.php"; -require_once "Zend/Log/Formatter/Interface.php"; -require_once "Zend/Log/Writer/Stream.php"; -require_once "Zend/Log/Writer/Db.php"; - -require_once "Common.php"; - /** * * @package Piwik_Log @@ -167,4 +160,3 @@ class Piwik_Log_Formatter_ScreenFormatter implements Zend_Log_Formatter_Interfac return $string; } } - diff --git a/core/Log/APICall.php b/core/Log/APICall.php index 6913a64b3a..c22008bd7b 100644 --- a/core/Log/APICall.php +++ b/core/Log/APICall.php @@ -115,4 +115,3 @@ class Piwik_Log_APICall_Formatter_ScreenFormatter extends Piwik_Log_Formatter_Sc } } - diff --git a/core/Log/Error.php b/core/Log/Error.php index 2fb51efa86..9d2f4b029e 100644 --- a/core/Log/Error.php +++ b/core/Log/Error.php @@ -116,5 +116,3 @@ class Piwik_Log_Error_Formatter_ScreenFormatter extends Piwik_Log_Formatter_Scre return parent::format($strReturned); } } - - diff --git a/core/Log/Exception.php b/core/Log/Exception.php index b2baf3c10d..247930218d 100644 --- a/core/Log/Exception.php +++ b/core/Log/Exception.php @@ -9,7 +9,6 @@ * @package Piwik_Log * @subpackage Piwik_Log_Exception */ -require_once "Log.php"; /** * Class used to log an exception event. @@ -57,7 +56,6 @@ class Piwik_Log_Exception extends Piwik_Log } } - /** * Format an exception event to be displayed on the screen. * @@ -81,15 +79,9 @@ class Piwik_Log_Exception_Formatter_ScreenFormatter extends Piwik_Log_Formatter_ $errline = $event['errline'] ; $backtrace = $event['backtrace'] ; - require_once "API/ResponseBuilder.php"; $outputFormat = strtolower(Piwik_Common::getRequestVar('format', 'html', 'string')); $response = new Piwik_API_ResponseBuilder(null, $outputFormat); $message = $response->getResponseException(new Exception($errstr)); return parent::format($message); } } - - - - - diff --git a/core/Log/Message.php b/core/Log/Message.php index 0d4c814ebf..77fd0e1a9c 100644 --- a/core/Log/Message.php +++ b/core/Log/Message.php @@ -72,4 +72,3 @@ class Piwik_Log_Message_Formatter_ScreenFormatter extends Piwik_Log_Formatter_Sc return parent::format($message); } } - diff --git a/core/Mail.php b/core/Mail.php index db12d4eaf1..d25cd23262 100644 --- a/core/Mail.php +++ b/core/Mail.php @@ -9,8 +9,6 @@ * @package Piwik */ -require_once "Zend/Mail.php"; - /** * Class for sending mails, for more information see: * http://framework.zend.com/manual/en/zend.mail.html diff --git a/core/Period.php b/core/Period.php index 7f4791fed4..5af51c6ea8 100644 --- a/core/Period.php +++ b/core/Period.php @@ -9,8 +9,6 @@ * @package Piwik_Helper */ -require_once "Period/Day.php"; -require_once "Period/Range.php"; /** * Creating a new Piwik_Period subclass: * @@ -53,17 +51,14 @@ abstract class Piwik_Period break; case 'week': - require_once "Period/Week.php"; return new Piwik_Period_Week($date); break; case 'month': - require_once "Period/Month.php"; return new Piwik_Period_Month($date); break; case 'year': - require_once "Period/Year.php"; return new Piwik_Period_Year($date); break; @@ -242,5 +237,3 @@ abstract class Piwik_Period abstract public function getLocalizedShortString(); abstract public function getLocalizedLongString(); } - - diff --git a/core/Period/Week.php b/core/Period/Week.php index 5129f77b3b..be2f2858c8 100644 --- a/core/Period/Week.php +++ b/core/Period/Week.php @@ -57,5 +57,4 @@ class Piwik_Period_Week extends Piwik_Period $currentDay = $currentDay->addDay(1); } } - } diff --git a/core/Period/Year.php b/core/Period/Year.php index 961f724fb8..df8c5e9808 100644 --- a/core/Period/Year.php +++ b/core/Period/Year.php @@ -9,8 +9,6 @@ * @package Piwik_Period */ -require_once "Period/Month.php"; - class Piwik_Period_Year extends Piwik_Period { protected $label = 'year'; diff --git a/core/Piwik.php b/core/Piwik.php index 0a8a679a6a..e607eb2d05 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -9,11 +9,7 @@ * @package Piwik */ -require_once "Config.php"; -require_once "Zend/Db.php"; -require_once "Zend/Db/Table.php"; -require_once "Log.php"; -require_once "Translate.php"; +require_once PIWIK_INCLUDE_PATH . '/core/Translate.php'; /** * Main piwik helper class. @@ -903,7 +899,6 @@ class Piwik static public function displayScreenForCoreAndPluginsUpdatesIfNecessary() { - require_once "Updater.php"; $updater = new Piwik_Updater(); $updater->addComponentToCheck('core', Piwik_Version::VERSION); @@ -919,7 +914,6 @@ class Piwik return; } - require_once "CoreUpdater/Controller.php"; $updaterController = new Piwik_CoreUpdater_Controller(); $updaterController->runUpdaterAndExit($updater, $componentsWithUpdateFile); } @@ -1228,11 +1222,6 @@ class Piwik static public function createLogObject() { - require_once "Log/APICall.php"; - require_once "Log/Exception.php"; - require_once "Log/Error.php"; - require_once "Log/Message.php"; - $configAPI = Zend_Registry::get('config')->log; $aLoggers = array( diff --git a/core/Plugin.php b/core/Plugin.php index 5fb1dbfc51..d638499420 100644 --- a/core/Plugin.php +++ b/core/Plugin.php @@ -9,7 +9,6 @@ * @package Piwik */ - /** * Abstract class to define a Piwik_Plugin. * Any plugin has to at least implement the abstract methods of this class. @@ -102,4 +101,3 @@ abstract class Piwik_Plugin } } - diff --git a/core/PluginsFunctions/AdminMenu.php b/core/PluginsFunctions/AdminMenu.php index 4ad39f4473..f8445aca1a 100644 --- a/core/PluginsFunctions/AdminMenu.php +++ b/core/PluginsFunctions/AdminMenu.php @@ -9,21 +9,6 @@ * @package Piwik */ -function Piwik_GetAdminMenu() -{ - return Piwik_AdminMenu::getInstance()->get(); -} - -function Piwik_AddAdminMenu( $adminMenuName, $url ) -{ - return Piwik_AdminMenu::getInstance()->add($adminMenuName, $url); -} - -function Piwik_RenameAdminMenuEntry($adminMenuOriginal, $adminMenuRenamed) -{ - Piwik_AdminMenu::getInstance()->rename($adminMenuOriginal, $adminMenuRenamed); -} - class Piwik_AdminMenu { private $adminMenu = null; @@ -85,3 +70,18 @@ class Piwik_AdminMenu $this->adminMenu[$adminMenuRenamed] = $save; } } + +function Piwik_GetAdminMenu() +{ + return Piwik_AdminMenu::getInstance()->get(); +} + +function Piwik_AddAdminMenu( $adminMenuName, $url ) +{ + return Piwik_AdminMenu::getInstance()->add($adminMenuName, $url); +} + +function Piwik_RenameAdminMenuEntry($adminMenuOriginal, $adminMenuRenamed) +{ + Piwik_AdminMenu::getInstance()->rename($adminMenuOriginal, $adminMenuRenamed); +} diff --git a/core/PluginsFunctions/Menu.php b/core/PluginsFunctions/Menu.php index fbcffa5592..f3e9fa5f88 100644 --- a/core/PluginsFunctions/Menu.php +++ b/core/PluginsFunctions/Menu.php @@ -9,27 +9,6 @@ * @package Piwik */ -function Piwik_GetMenu() -{ - return Piwik_Menu::getInstance()->get(); -} - -function Piwik_AddMenu( $mainMenuName, $subMenuName, $url ) -{ - Piwik_Menu::getInstance()->add($mainMenuName, $subMenuName, $url); -} - -function Piwik_RenameMenuEntry($mainMenuOriginal, $subMenuOriginal, - $mainMenuRenamed, $subMenuRenamed) -{ - Piwik_Menu::getInstance()->rename($mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed); -} - -function Piwik_EditMenuUrl( $mainMenuToEdit, $subMenuToEdit, $newUrl ) -{ - Piwik_Menu::getInstance()->editUrl($mainMenuToEdit, $subMenuToEdit, $newUrl); -} - class Piwik_Menu { protected $menu = null; @@ -179,3 +158,24 @@ class Piwik_Menu } } } + +function Piwik_GetMenu() +{ + return Piwik_Menu::getInstance()->get(); +} + +function Piwik_AddMenu( $mainMenuName, $subMenuName, $url ) +{ + Piwik_Menu::getInstance()->add($mainMenuName, $subMenuName, $url); +} + +function Piwik_RenameMenuEntry($mainMenuOriginal, $subMenuOriginal, + $mainMenuRenamed, $subMenuRenamed) +{ + Piwik_Menu::getInstance()->rename($mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed); +} + +function Piwik_EditMenuUrl( $mainMenuToEdit, $subMenuToEdit, $newUrl ) +{ + Piwik_Menu::getInstance()->editUrl($mainMenuToEdit, $subMenuToEdit, $newUrl); +} diff --git a/core/PluginsFunctions/WidgetsList.php b/core/PluginsFunctions/WidgetsList.php index f3982750b1..276c45eb83 100644 --- a/core/PluginsFunctions/WidgetsList.php +++ b/core/PluginsFunctions/WidgetsList.php @@ -9,16 +9,6 @@ * @package Piwik */ -function Piwik_GetWidgetsList() -{ - return Piwik_WidgetsList::get(); -} - -function Piwik_AddWidget( $widgetCategory, $widgetName, $controllerName, $controllerAction, $customParameters = array()) -{ - Piwik_WidgetsList::add($widgetCategory, $widgetName, $controllerName, $controllerAction, $customParameters); -} - class Piwik_WidgetsList { static protected $widgets = null; @@ -43,3 +33,13 @@ class Piwik_WidgetsList ); } } + +function Piwik_GetWidgetsList() +{ + return Piwik_WidgetsList::get(); +} + +function Piwik_AddWidget( $widgetCategory, $widgetName, $controllerName, $controllerAction, $customParameters = array()) +{ + Piwik_WidgetsList::add($widgetCategory, $widgetName, $controllerName, $controllerAction, $customParameters); +} diff --git a/core/PluginsManager.php b/core/PluginsManager.php index 6c0b0a34aa..54bc5c3e6e 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -9,17 +9,10 @@ * @package Piwik */ -require_once "Plugin.php"; -require_once "Event/Dispatcher.php"; -require_once "PluginsFunctions/Menu.php"; -require_once "PluginsFunctions/AdminMenu.php"; -require_once "PluginsFunctions/WidgetsList.php"; -require_once "PluginsFunctions/Sql.php"; - -require_once "Zend/Exception.php"; -require_once "Zend/Loader.php"; -require_once "Auth.php"; -require_once "Controller.php"; +require_once PIWIK_INCLUDE_PATH . '/core/PluginsFunctions/Menu.php'; +require_once PIWIK_INCLUDE_PATH . '/core/PluginsFunctions/AdminMenu.php'; +require_once PIWIK_INCLUDE_PATH . '/core/PluginsFunctions/WidgetsList.php'; +require_once PIWIK_INCLUDE_PATH . '/core/PluginsFunctions/Sql.php'; /** * @package Piwik @@ -85,7 +78,7 @@ class Piwik_PluginsManager */ public function readPluginsDirectory() { - $pluginsName = glob( PIWIK_INCLUDE_PATH . "/plugins/*", GLOB_ONLYDIR); + $pluginsName = glob( PIWIK_INCLUDE_PATH . '/plugins/*', GLOB_ONLYDIR); $pluginsName = array_map('basename', $pluginsName); return $pluginsName; } @@ -262,8 +255,8 @@ class Piwik_PluginsManager { return $this->loadedPlugins[$pluginName]; } - $pluginFileName = $pluginName . '/' . $pluginName . ".php"; - $pluginClassName = "Piwik_".$pluginName; + $pluginFileName = $pluginName . '/' . $pluginName . '.php'; + $pluginClassName = 'Piwik_'.$pluginName; if( !Piwik_Common::isValidFilename($pluginName)) { @@ -282,7 +275,7 @@ class Piwik_PluginsManager // Don't remove this. // Our autoloader can't find plugins/PluginName/PluginName.php - require_once $path; + require_once $path; // prefixed by PIWIK_INCLUDE_PATH if(!class_exists($pluginClassName, false)) { @@ -401,7 +394,7 @@ class Piwik_PluginsManager $pluginName = $plugin->getClassName(); - $path = PIWIK_INCLUDE_PATH . "/plugins/" . $pluginName ."/lang/%s.php"; + $path = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName .'/lang/%s.php'; $defaultLangPath = sprintf($path, $langCode); $defaultEnglishLangPath = sprintf($path, 'en'); @@ -530,4 +523,3 @@ class Piwik_Event_Notification extends Event_Notification } } } - diff --git a/core/Site.php b/core/Site.php index 8882f6ce65..7e9b539722 100644 --- a/core/Site.php +++ b/core/Site.php @@ -70,4 +70,3 @@ class Piwik_Site return $validIds; } } - diff --git a/core/Smarty.php b/core/Smarty.php index 3697624c68..3777ce9fca 100644 --- a/core/Smarty.php +++ b/core/Smarty.php @@ -9,7 +9,8 @@ * @package Piwik */ -require_once "Smarty/Smarty.class.php"; +require_once PIWIK_INCLUDE_PATH . '/libs/Smarty/Smarty.class.php'; + class Piwik_Smarty extends Smarty { function trigger_error($error_msg, $error_type = E_USER_WARNING) diff --git a/core/SmartyPlugins/function.hiddenurl.php b/core/SmartyPlugins/function.hiddenurl.php index 5b4906560a..2bdcccb5a4 100644 --- a/core/SmartyPlugins/function.hiddenurl.php +++ b/core/SmartyPlugins/function.hiddenurl.php @@ -9,8 +9,6 @@ * @package SmartyPlugins */ -require_once "Url.php"; - /** * Smarty {hiddenurl} function plugin. * Writes an input Hidden field for every parameter in the URL. diff --git a/core/SmartyPlugins/function.postEvent.php b/core/SmartyPlugins/function.postEvent.php index 6c802589a8..ece8a3bd1e 100644 --- a/core/SmartyPlugins/function.postEvent.php +++ b/core/SmartyPlugins/function.postEvent.php @@ -9,8 +9,6 @@ * @package SmartyPlugins */ -require_once "Url.php"; - /** * Posts an event from a smarty template. This event can then be hooked by another plugin. * The even will be posted along with a string value that plugins can edit. diff --git a/core/SmartyPlugins/function.sparkline.php b/core/SmartyPlugins/function.sparkline.php index d37f37a659..f1e74a08f2 100644 --- a/core/SmartyPlugins/function.sparkline.php +++ b/core/SmartyPlugins/function.sparkline.php @@ -9,8 +9,6 @@ * @package SmartyPlugins */ -require_once "Visualization/Sparkline.php"; - /** * @param string $url * @return string IMG HTML tag diff --git a/core/SmartyPlugins/function.url.php b/core/SmartyPlugins/function.url.php index a4655a1c43..efa9b5bccf 100644 --- a/core/SmartyPlugins/function.url.php +++ b/core/SmartyPlugins/function.url.php @@ -9,8 +9,6 @@ * @package SmartyPlugins */ -require_once "Url.php"; - /** * Smarty {url} function plugin. * Generates a piwik URL with the specified parameters modified. diff --git a/core/SmartyPlugins/modifier.sumtime.php b/core/SmartyPlugins/modifier.sumtime.php index 5cceee750f..0f5627a0c6 100644 --- a/core/SmartyPlugins/modifier.sumtime.php +++ b/core/SmartyPlugins/modifier.sumtime.php @@ -28,4 +28,3 @@ function smarty_modifier_sumtime($numberOfSeconds) { return Piwik::getPrettyTimeFromSeconds($numberOfSeconds); } - diff --git a/core/SmartyPlugins/modifier.translate.php b/core/SmartyPlugins/modifier.translate.php index 4ce1eb08ee..a98ca05108 100644 --- a/core/SmartyPlugins/modifier.translate.php +++ b/core/SmartyPlugins/modifier.translate.php @@ -37,4 +37,3 @@ function smarty_modifier_translate($stringToken) } return $stringTranslated; } - diff --git a/core/SmartyPlugins/modifier.urlRewriteBasicView.php b/core/SmartyPlugins/modifier.urlRewriteBasicView.php index 0f68201165..61fae37542 100644 --- a/core/SmartyPlugins/modifier.urlRewriteBasicView.php +++ b/core/SmartyPlugins/modifier.urlRewriteBasicView.php @@ -37,4 +37,3 @@ function smarty_modifier_urlRewriteBasicView($parameters) $url = $url . '&module=CoreHome&action=showInContext'; return htmlspecialchars($url); } - diff --git a/core/SmartyPlugins/outputfilter.cachebuster.php b/core/SmartyPlugins/outputfilter.cachebuster.php index cf088be6ca..34a3efedd3 100644 --- a/core/SmartyPlugins/outputfilter.cachebuster.php +++ b/core/SmartyPlugins/outputfilter.cachebuster.php @@ -46,4 +46,3 @@ function smarty_outputfilter_cachebuster($source, &$smarty) return preg_replace($pattern, $replace, $source); } - diff --git a/core/TablePartitioning.php b/core/TablePartitioning.php index 2e74c8f9f9..2c78d8c18f 100644 --- a/core/TablePartitioning.php +++ b/core/TablePartitioning.php @@ -134,4 +134,3 @@ class Piwik_TablePartitioning_Daily extends Piwik_TablePartitioning } } - diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index 1ea7247917..eb2bf13f8e 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -282,4 +282,3 @@ class Piwik_Tracker_Action implements Piwik_Tracker_Action_Interface ); } } - diff --git a/core/Tracker/Config.php b/core/Tracker/Config.php index cac633ea09..78dd389ce6 100644 --- a/core/Tracker/Config.php +++ b/core/Tracker/Config.php @@ -105,5 +105,3 @@ class Piwik_Tracker_Config return count($section) ? $section : null; } } - - diff --git a/core/Tracker/Db.php b/core/Tracker/Db.php index d7b3fd3af8..56e50bb809 100644 --- a/core/Tracker/Db.php +++ b/core/Tracker/Db.php @@ -214,7 +214,6 @@ class Piwik_Tracker_Db protected function initProfiler() { - require_once "Timer.php"; return new Piwik_Timer; } @@ -267,5 +266,3 @@ class Piwik_Tracker_Db self::$profiling = true; } } - - diff --git a/core/Tracker/Generator.php b/core/Tracker/Generator.php index 27b3acf41c..ff65326957 100644 --- a/core/Tracker/Generator.php +++ b/core/Tracker/Generator.php @@ -303,7 +303,7 @@ class Piwik_Tracker_Generator */ // we load some real referers to be used by the generator $referers = array(); - require_once PIWIK_INCLUDE_PATH . "/misc/generateVisitsData/Referers.php"; + require_once PIWIK_INCLUDE_PATH . '/misc/generateVisitsData/Referers.php'; $this->addParam('urlref',$referers); @@ -312,8 +312,8 @@ class Piwik_Tracker_Generator // load some user agent and accept language $userAgent = $acceptLanguages = array(); - require_once PIWIK_INCLUDE_PATH . "/misc/generateVisitsData/UserAgent.php"; - require_once PIWIK_INCLUDE_PATH . "/misc/generateVisitsData/AcceptLanguage.php"; + require_once PIWIK_INCLUDE_PATH . '/misc/generateVisitsData/UserAgent.php'; + require_once PIWIK_INCLUDE_PATH . '/misc/generateVisitsData/AcceptLanguage.php'; $this->userAgents=$userAgent; $this->acceptLanguage=$acceptLanguages; } @@ -644,5 +644,3 @@ class Piwik_Tracker_Generator } } -require_once "Generator/Tracker.php"; -require_once "Generator/Visit.php"; diff --git a/core/Tracker/Generator/Tracker.php b/core/Tracker/Generator/Tracker.php index faed70fb99..0bff866e2a 100644 --- a/core/Tracker/Generator/Tracker.php +++ b/core/Tracker/Generator/Tracker.php @@ -9,7 +9,6 @@ * @package Piwik_Tracker */ - /** * Fake Piwik_Tracker that: * - overwrite the sendHeader method so that no headers are sent. diff --git a/core/Tracker/Generator/Visit.php b/core/Tracker/Generator/Visit.php index ff21b78739..9d6f8c6043 100644 --- a/core/Tracker/Generator/Visit.php +++ b/core/Tracker/Generator/Visit.php @@ -9,7 +9,6 @@ * @package Piwik_Tracker */ - /** * Fake Piwik_Tracker_Visit class that overwrite all the Time related method to be able * to setup a given timestamp for the generated visitor and actions. @@ -44,4 +43,3 @@ class Piwik_Tracker_Generator_Visit extends Piwik_Tracker_Visit } } - diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index 2086704540..c1c7de87b2 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -546,7 +546,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface { return $this->userSettingsInformation; } - require_once "UserAgentParser/UserAgentParser.php"; + require_once PIWIK_INCLUDE_PATH . '/libs/UserAgentParser/UserAgentParser.php'; $plugin_Flash = Piwik_Common::getRequestVar( 'fla', 0, 'int', $this->request); $plugin_Director = Piwik_Common::getRequestVar( 'dir', 0, 'int', $this->request); diff --git a/core/Translate.php b/core/Translate.php index 4357e3bf8f..37ab0265b4 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -32,7 +32,7 @@ class Piwik_Translate public function loadEnglishTranslation() { - require PIWIK_INCLUDE_PATH . "/lang/en.php"; + require PIWIK_INCLUDE_PATH . '/lang/en.php'; $this->mergeTranslationArray($translations); $this->setLocale(); $this->englishLanguageLoaded = true; @@ -47,7 +47,7 @@ class Piwik_Translate return; } - require PIWIK_INCLUDE_PATH . "/lang/" . $language . ".php"; + require PIWIK_INCLUDE_PATH . '/lang/' . $language . '.php'; $this->mergeTranslationArray($translations); $this->setLocale(); } diff --git a/core/Updater.php b/core/Updater.php index 5460eeef62..47ff510c91 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -9,7 +9,7 @@ * @package Piwik */ -require_once "Option.php"; +require_once PIWIK_INCLUDE_PATH . '/core/Option.php'; class Piwik_Updater { @@ -73,7 +73,7 @@ class Piwik_Updater foreach($this->componentsWithUpdateFile[$name] as $file) { try { - require_once $file; + require_once $file; // prefixed by PIWIK_INCLUDE_PATH } catch( Piwik_Updater_UpdateErrorException $e) { throw $e; } catch( Exception $e) { diff --git a/core/Updates/0.2.33.php b/core/Updates/0.2.33.php index bc2d2904be..79858b7ea8 100644 --- a/core/Updates/0.2.33.php +++ b/core/Updates/0.2.33.php @@ -1,5 +1,5 @@ <?php -require_once "SitesManager/API.php"; +require_once PIWIK_INCLUDE_PATH . '/plugins/SitesManager/API.php'; // alter table to set the utf8 collation $tablesToAlter = Piwik::getTablesInstalled(true); diff --git a/core/Url.php b/core/Url.php index 5b5d4a7743..a34bd66178 100644 --- a/core/Url.php +++ b/core/Url.php @@ -15,7 +15,6 @@ */ class Piwik_Url { - /** * If current URL is "http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2" * will return "http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2" @@ -262,4 +261,3 @@ class Piwik_Url } } - diff --git a/core/View.php b/core/View.php index e15242ef5c..2355320b6c 100644 --- a/core/View.php +++ b/core/View.php @@ -9,8 +9,6 @@ * @package Piwik_Visualization */ -require_once "iView.php"; - /** * * @package Piwik_Visualization @@ -24,7 +22,6 @@ class Piwik_View implements Piwik_iView public function __construct( $templateFile, $smConf = array()) { - require_once "Smarty.php"; $this->template = $templateFile; $this->smarty = new Piwik_Smarty(); diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index c04814a036..592bc13f56 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -9,8 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "API/Request.php"; - /** * This class is used to load (from the API) and customize the output of a given DataTable. * The main() method will create an object Piwik_iView @@ -162,58 +160,47 @@ abstract class Piwik_ViewDataTable switch($type) { case 'cloud': - require_once "ViewDataTable/Cloud.php"; return new Piwik_ViewDataTable_Cloud(); break; case 'graphPie': - require_once "ViewDataTable/GenerateGraphHTML/ChartPie.php"; return new Piwik_ViewDataTable_GenerateGraphHTML_ChartPie(); break; case 'graphVerticalBar': - require_once "ViewDataTable/GenerateGraphHTML/ChartVerticalBar.php"; return new Piwik_ViewDataTable_GenerateGraphHTML_ChartVerticalBar(); break; case 'graphEvolution': - require_once "ViewDataTable/GenerateGraphHTML/ChartEvolution.php"; return new Piwik_ViewDataTable_GenerateGraphHTML_ChartEvolution(); break; case 'sparkline': - require_once "ViewDataTable/Sparkline.php"; return new Piwik_ViewDataTable_Sparkline(); break; case 'generateDataChartVerticalBar': - require_once "ViewDataTable/GenerateGraphData/ChartVerticalBar.php"; return new Piwik_ViewDataTable_GenerateGraphData_ChartVerticalBar(); break; case 'generateDataChartPie': - require_once "ViewDataTable/GenerateGraphData/ChartPie.php"; return new Piwik_ViewDataTable_GenerateGraphData_ChartPie(); break; case 'generateDataChartEvolution': - require_once "ViewDataTable/GenerateGraphData/ChartEvolution.php"; return new Piwik_ViewDataTable_GenerateGraphData_ChartEvolution(); break; case 'tableAllColumns': - require_once "ViewDataTable/HtmlTable/AllColumns.php"; return new Piwik_ViewDataTable_HtmlTable_AllColumns(); break; case 'tableGoals': - require_once "ViewDataTable/HtmlTable/Goals.php"; return new Piwik_ViewDataTable_HtmlTable_Goals(); break; case 'table': default: - require_once "ViewDataTable/HtmlTable.php"; return new Piwik_ViewDataTable_HtmlTable(); break; } @@ -262,8 +249,7 @@ abstract class Piwik_ViewDataTable $this->viewProperties['apiMethodToRequestDataTable'] = $this->apiMethodToRequestDataTable; $this->viewProperties['uniqueId'] = $this->getUniqueIdViewDataTable(); } - - + /** * Forces the View to use a given template. * Usually the template to use is set in the specific ViewDataTable_* diff --git a/core/ViewDataTable/Cloud.php b/core/ViewDataTable/Cloud.php index 68481f9159..b2242705b5 100644 --- a/core/ViewDataTable/Cloud.php +++ b/core/ViewDataTable/Cloud.php @@ -9,8 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "Visualization/Cloud.php"; - /** * Reads the requested DataTable from the API, and prepares the data to give * to Piwik_Visualization_Cloud that will display the tag cloud (via the template cloud.tpl). diff --git a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php index 4db764045b..79b48393e7 100644 --- a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php +++ b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php @@ -9,7 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/GenerateGraphData.php"; /** * Piwik_ViewDataTable_GenerateGraphData for the Evolution graph (eg. Last 30 days visits) using Piwik_Visualization_Chart_Evolution * @@ -25,7 +24,6 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat function __construct() { - require_once "Visualization/Chart/Evolution.php"; $this->view = new Piwik_Visualization_Chart_Evolution; } diff --git a/core/ViewDataTable/GenerateGraphData/ChartPie.php b/core/ViewDataTable/GenerateGraphData/ChartPie.php index f7265ae367..547616422c 100644 --- a/core/ViewDataTable/GenerateGraphData/ChartPie.php +++ b/core/ViewDataTable/GenerateGraphData/ChartPie.php @@ -9,7 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/GenerateGraphData.php"; /** * Piwik_ViewDataTable_GenerateGraphData for the pie chart, using Piwik_Visualization_Chart_Pie * @@ -27,7 +26,6 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartPie extends Piwik_ViewDataTable function __construct() { - require_once "Visualization/Chart/Pie.php"; $this->view = new Piwik_Visualization_Chart_Pie; } } diff --git a/core/ViewDataTable/GenerateGraphData/ChartVerticalBar.php b/core/ViewDataTable/GenerateGraphData/ChartVerticalBar.php index 4e08405f6f..26d383381c 100644 --- a/core/ViewDataTable/GenerateGraphData/ChartVerticalBar.php +++ b/core/ViewDataTable/GenerateGraphData/ChartVerticalBar.php @@ -9,7 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/GenerateGraphData.php"; /** * Piwik_ViewDataTable_GenerateGraphData for the vertical bar graph, using Piwik_Visualization_Chart_VerticalBar * @@ -27,7 +26,6 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartVerticalBar extends Piwik_ViewD function __construct() { - require_once "Visualization/Chart/VerticalBar.php"; $this->view = new Piwik_Visualization_Chart_VerticalBar; } } diff --git a/core/ViewDataTable/GenerateGraphHTML.php b/core/ViewDataTable/GenerateGraphHTML.php index c4998ff8c1..27f9f66851 100644 --- a/core/ViewDataTable/GenerateGraphHTML.php +++ b/core/ViewDataTable/GenerateGraphHTML.php @@ -163,4 +163,3 @@ abstract class Piwik_ViewDataTable_GenerateGraphHTML extends Piwik_ViewDataTable return $return; } } - diff --git a/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php b/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php index b82263697c..3b728d65a2 100644 --- a/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php +++ b/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php @@ -9,7 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/GenerateGraphHTML.php"; /** * Generates HTML embed for the Evolution graph * diff --git a/core/ViewDataTable/GenerateGraphHTML/ChartPie.php b/core/ViewDataTable/GenerateGraphHTML/ChartPie.php index 0691af9962..bb29e17d1c 100644 --- a/core/ViewDataTable/GenerateGraphHTML/ChartPie.php +++ b/core/ViewDataTable/GenerateGraphHTML/ChartPie.php @@ -9,7 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/GenerateGraphHTML.php"; /** * Generates HTML embed for the Pie chart * diff --git a/core/ViewDataTable/GenerateGraphHTML/ChartVerticalBar.php b/core/ViewDataTable/GenerateGraphHTML/ChartVerticalBar.php index 20b92c7ea4..b746f44cb7 100644 --- a/core/ViewDataTable/GenerateGraphHTML/ChartVerticalBar.php +++ b/core/ViewDataTable/GenerateGraphHTML/ChartVerticalBar.php @@ -9,7 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/GenerateGraphHTML.php"; /** * * Generates HTML embed for the vertical bar chart diff --git a/core/ViewDataTable/HtmlTable.php b/core/ViewDataTable/HtmlTable.php index 1dc6d2efd2..2e2155685d 100644 --- a/core/ViewDataTable/HtmlTable.php +++ b/core/ViewDataTable/HtmlTable.php @@ -205,4 +205,3 @@ class Piwik_ViewDataTable_HtmlTable extends Piwik_ViewDataTable } } } - diff --git a/core/ViewDataTable/HtmlTable/AllColumns.php b/core/ViewDataTable/HtmlTable/AllColumns.php index b540371712..01a8b11a5b 100644 --- a/core/ViewDataTable/HtmlTable/AllColumns.php +++ b/core/ViewDataTable/HtmlTable/AllColumns.php @@ -9,8 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/HtmlTable.php"; - class Piwik_ViewDataTable_HtmlTable_AllColumns extends Piwik_ViewDataTable_HtmlTable { protected function getViewDataTableId() diff --git a/core/ViewDataTable/HtmlTable/Goals.php b/core/ViewDataTable/HtmlTable/Goals.php index 9b60bb18b8..d5b129eaab 100644 --- a/core/ViewDataTable/HtmlTable/Goals.php +++ b/core/ViewDataTable/HtmlTable/Goals.php @@ -9,8 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "ViewDataTable/HtmlTable.php"; - class Piwik_ViewDataTable_HtmlTable_Goals extends Piwik_ViewDataTable_HtmlTable { protected function getViewDataTableId() @@ -56,8 +54,6 @@ class Piwik_ViewDataTable_HtmlTable_Goals extends Piwik_ViewDataTable_HtmlTable { if($columnName == 'goal_%s_conversion_rate') { - require_once "Tracker/GoalManager.php"; - require_once "Goals/API.php"; $goals = Piwik_Goals_API::getGoals( $this->getIdSite() ); foreach($goals as $goal) { diff --git a/core/ViewDataTable/Sparkline.php b/core/ViewDataTable/Sparkline.php index b47cf81519..ce4282cda7 100644 --- a/core/ViewDataTable/Sparkline.php +++ b/core/ViewDataTable/Sparkline.php @@ -9,8 +9,6 @@ * @package Piwik_ViewDataTable */ -require_once "Visualization/Sparkline.php"; - /** * Reads the requested DataTable from the API and prepare data for the Sparkline view. * diff --git a/core/Visualization/Chart.php b/core/Visualization/Chart.php index c25b373076..5003cba266 100644 --- a/core/Visualization/Chart.php +++ b/core/Visualization/Chart.php @@ -9,7 +9,7 @@ * @package Piwik_Visualization */ -require_once "open-flash-chart/php-ofc-library/open-flash-chart.php"; +require_once PIWIK_INCLUDE_PATH . '/libs/open-flash-chart/php-ofc-library/open-flash-chart.php'; /** * Generates the data in the Open Flash Chart format, from the given data. diff --git a/core/Visualization/Chart/Evolution.php b/core/Visualization/Chart/Evolution.php index b3e2263e07..738e0048ca 100644 --- a/core/Visualization/Chart/Evolution.php +++ b/core/Visualization/Chart/Evolution.php @@ -9,8 +9,6 @@ * @package Piwik_Visualization */ -require_once "Visualization/Chart.php"; - /** * Customize the Evolution chart style for the flash graph * diff --git a/core/Visualization/Chart/Pie.php b/core/Visualization/Chart/Pie.php index 5896f1922b..fdeb0cdf46 100644 --- a/core/Visualization/Chart/Pie.php +++ b/core/Visualization/Chart/Pie.php @@ -8,7 +8,6 @@ * * @package Piwik_Visualization */ -require_once "Visualization/Chart.php"; /** * Customize & set values for the Flash Pie chart diff --git a/core/Visualization/Chart/VerticalBar.php b/core/Visualization/Chart/VerticalBar.php index 025a16ece2..12e55bd54b 100644 --- a/core/Visualization/Chart/VerticalBar.php +++ b/core/Visualization/Chart/VerticalBar.php @@ -9,8 +9,6 @@ * @package Piwik_Visualization */ -require_once "Visualization/Chart.php"; - /** * Customize & set values for the flash Vertical bar chart * diff --git a/core/Visualization/Cloud.php b/core/Visualization/Cloud.php index 73a47e0d72..75a680a966 100644 --- a/core/Visualization/Cloud.php +++ b/core/Visualization/Cloud.php @@ -105,4 +105,3 @@ class Piwik_Visualization_Cloud } } } - diff --git a/core/Visualization/Sparkline.php b/core/Visualization/Sparkline.php index f10502ae3e..71245340e2 100644 --- a/core/Visualization/Sparkline.php +++ b/core/Visualization/Sparkline.php @@ -9,8 +9,7 @@ * @package Piwik_Visualization */ -require_once 'sparkline/lib/Sparkline_Line.php'; - +require_once PIWIK_INCLUDE_PATH . '/libs/sparkline/lib/Sparkline_Line.php'; /** * Renders a sparkline image given a PHP data array. diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php index 5bcd0972fa..1278d4d703 100644 --- a/core/testMinimumPhpVersion.php +++ b/core/testMinimumPhpVersion.php @@ -85,4 +85,4 @@ if(isset($piwik_errorMessage)) // we now include the upgradephp package to define some functions used in piwik // that may not be defined in the current php version -require_once PIWIK_INCLUDE_PATH . "/libs/upgradephp/upgrade.php"; +require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php'; |