Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-10-15 04:11:31 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-15 04:11:31 +0400
commit07f66e0cbe9247e953e78d9b7f06519ff09385d1 (patch)
tree414132d23e098787d88b1a49fba3242635a38196 /core
parent1fd385a514ab9351ceefb58004873e1b8d7b29e7 (diff)
Type hint for Singleton
Enabling All plugins during tests
Diffstat (limited to 'core')
-rw-r--r--core/API/Proxy.php1
-rw-r--r--core/Config.php2
-rw-r--r--core/DataTable/Manager.php1
-rw-r--r--core/Db/Schema.php1
-rw-r--r--core/EventDispatcher.php2
-rw-r--r--core/FrontController.php1
-rw-r--r--core/Log.php2
-rw-r--r--core/Menu/MenuAbstract.php1
-rw-r--r--core/Plugin/Manager.php22
-rw-r--r--core/Registry.php1
10 files changed, 29 insertions, 5 deletions
diff --git a/core/API/Proxy.php b/core/API/Proxy.php
index f504bdeb8f..bceac4556b 100644
--- a/core/API/Proxy.php
+++ b/core/API/Proxy.php
@@ -28,6 +28,7 @@ use ReflectionMethod;
*
* @package Piwik
* @subpackage Piwik_API
+ * @method \Piwik\API\Proxy getInstance()
*/
class Proxy extends Singleton
{
diff --git a/core/Config.php b/core/Config.php
index c7a5ad9d27..37213540d5 100644
--- a/core/Config.php
+++ b/core/Config.php
@@ -41,6 +41,8 @@ use Exception;
*
* @package Piwik
* @subpackage Piwik_Config
+ * @method \Piwik\Config getInstance()
+ *
*/
class Config extends Singleton
{
diff --git a/core/DataTable/Manager.php b/core/DataTable/Manager.php
index 0ae03ede89..3613f70ee8 100644
--- a/core/DataTable/Manager.php
+++ b/core/DataTable/Manager.php
@@ -23,6 +23,7 @@ use Piwik\Singleton;
*
* @package Piwik
* @subpackage DataTable
+ * @method \Piwik\DataTable\Manager getInstance()
*/
class Manager extends Singleton
{
diff --git a/core/Db/Schema.php b/core/Db/Schema.php
index 5ce1d55d62..9fc6283c58 100644
--- a/core/Db/Schema.php
+++ b/core/Db/Schema.php
@@ -20,6 +20,7 @@ use Piwik\Singleton;
*
* @package Piwik
* @subpackage Piwik_Db
+ * @method \Piwik\Db\Schema getInstance()
*/
class Schema extends Singleton
{
diff --git a/core/EventDispatcher.php b/core/EventDispatcher.php
index c57cea990e..642aaee3f7 100644
--- a/core/EventDispatcher.php
+++ b/core/EventDispatcher.php
@@ -16,6 +16,8 @@ use Piwik\Plugin;
/**
* This class allows code to post events from anywhere in Piwik and for
* plugins to associate callbacks to be executed when events are posted.
+ *
+ * @method \Piwik\EventDispatcher getInstance()
*/
class EventDispatcher extends Singleton
{
diff --git a/core/FrontController.php b/core/FrontController.php
index 8b42c87a98..3cf537c9f0 100644
--- a/core/FrontController.php
+++ b/core/FrontController.php
@@ -26,6 +26,7 @@ use Piwik\Session;
*
* @package Piwik
* @subpackage FrontController
+ * @method \Piwik\FrontController getInstance()
*/
class FrontController extends Singleton
{
diff --git a/core/Log.php b/core/Log.php
index 23017acd59..7a82135859 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -25,6 +25,8 @@ use Piwik\Db;
*
* The logging utility can be configured by manipulating the INI config options in the
* [log] section.
+ *
+ * @method \Piwik\Log getInstance()
*/
class Log extends Singleton
{
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php
index b8f5b11e1a..0c71a79ee3 100644
--- a/core/Menu/MenuAbstract.php
+++ b/core/Menu/MenuAbstract.php
@@ -16,6 +16,7 @@ use Piwik\Singleton;
/**
* @package Piwik_Menu
+ * @method \Piwik\Menu\MenuAbstract getInstance()
*/
abstract class MenuAbstract extends Singleton
{
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index fd461af5bb..69020f4785 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -25,6 +25,7 @@ require_once PIWIK_INCLUDE_PATH . '/core/EventDispatcher.php';
/**
* Plugin manager
*
+ * @method \Piwik\Plugin\Manager getInstance()
* @package Piwik
* @subpackage Manager
*/
@@ -67,6 +68,11 @@ class Manager extends Singleton
'TreemapVisualization', // should be moved to marketplace
);
+ public function getCorePluginsDisabledByDefault()
+ {
+ return $this->corePluginsDisabledByDefault;
+ }
+
// If a plugin hooks onto at least an event starting with "Tracker.", we load the plugin during tracker
const TRACKER_EVENT_PREFIX = 'Tracker.';
@@ -399,15 +405,22 @@ class Manager extends Singleton
$pluginsBundledWithPiwik = $pluginsBundledWithPiwik['Plugins'];
return (!empty($pluginsBundledWithPiwik)
- && in_array($name, $pluginsBundledWithPiwik))
- || in_array($name, $this->corePluginsDisabledByDefault);
+ && in_array($name, $pluginsBundledWithPiwik))
+ || in_array($name, $this->getCorePluginsDisabledByDefault());
}
protected function isPluginThirdPartyAndBogus($pluginName)
{
$path = $this->getPluginsDirectory() . $pluginName;
+
+ $bogusPlugins = array(
+ 'PluginMarketplace' //defines a plugin.json but 1.x Piwik plugin
+ );
+
$isBogus = !$this->isPluginBundledWithCore($pluginName)
- && !$this->isManifestFileFound($path);
+ || !$this->isManifestFileFound($path)
+ || in_array($pluginName, $bogusPlugins);
+
return $isBogus;
}
@@ -423,6 +436,7 @@ class Manager extends Singleton
if (is_null($pluginsToLoad)) {
$pluginsToLoad = array();
}
+ $pluginsToLoad = array_unique($pluginsToLoad);
$this->pluginsToLoad = $pluginsToLoad;
$this->reloadPlugins();
}
@@ -462,8 +476,6 @@ class Manager extends Singleton
/**
* Execute postLoad() hook for loaded plugins
- *
- * @see Piwik_Plugin::postLoad()
*/
public function postLoadPlugins()
{
diff --git a/core/Registry.php b/core/Registry.php
index 88ecc1ce95..12ed1d963c 100644
--- a/core/Registry.php
+++ b/core/Registry.php
@@ -14,6 +14,7 @@ namespace Piwik;
* Registry class.
*
* @package Piwik
+ * @method \Piwik\Registry getInstance()
*/
class Registry extends Singleton
{