Piwik\Plugin::__construct PHP Метод

__construct() публичный Метод

Constructor.
public __construct ( string | boolean $pluginName = false )
$pluginName string | boolean A plugin name to force. If not supplied, it is set to the last part of the class name.
    public function __construct($pluginName = false)
    {
        if (empty($pluginName)) {
            $pluginName = explode('\\', get_class($this));
            $pluginName = end($pluginName);
        }
        $this->pluginName = $pluginName;
        $cacheId = 'Plugin' . $pluginName . 'Metadata';
        $cache = Cache::getEagerCache();
        if ($cache->contains($cacheId)) {
            $this->pluginInformation = $cache->fetch($cacheId);
        } else {
            $this->reloadPluginInformation();
            $cache->save($cacheId, $this->pluginInformation);
        }
    }

Usage Example

Пример #1
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->dntChecker = new DoNotTrackHeaderChecker();
     $this->ipAnonymizer = new IPAnonymizer();
 }
All Usage Examples Of Piwik\Plugin::__construct