Piwik\Plugin\MetadataLoader::hasPluginJson PHP Method

hasPluginJson() public method

public hasPluginJson ( )
    public function hasPluginJson()
    {
        $hasJson = $this->loadPluginInfoJson();
        return !empty($hasJson);
    }

Usage Example

コード例 #1
0
ファイル: Plugin.php プロジェクト: TensorWrenchOSS/piwik
 /**
  * Constructor.
  *
  * @param string|bool $pluginName A plugin name to force. If not supplied, it is set
  *                                to the last part of the class name.
  * @throws \Exception If plugin metadata is defined in both the getInformation() method
  *                    and the **plugin.json** file.
  */
 public function __construct($pluginName = false)
 {
     if (empty($pluginName)) {
         $pluginName = explode('\\', get_class($this));
         $pluginName = end($pluginName);
     }
     $this->pluginName = $pluginName;
     $metadataLoader = new MetadataLoader($pluginName);
     $this->pluginInformation = $metadataLoader->load();
     if ($this->hasDefinedPluginInformationInPluginClass() && $metadataLoader->hasPluginJson()) {
         throw new \Exception('Plugin ' . $pluginName . ' has defined the method getInformation() and as well as having a plugin.json file. Please delete the getInformation() method from the plugin class. Alternatively, you may delete the plugin directory from plugins/' . $pluginName);
     }
     $this->cache = new PersistentCache('Plugin' . $pluginName);
 }
All Usage Examples Of Piwik\Plugin\MetadataLoader::hasPluginJson