getMissingDependencies() 공개 메소드

public getMissingDependencies ( $requires )
예제 #1
0
 private function makeSureThereAreNoMissingRequirements($metadata)
 {
     $requires = array();
     if (!empty($metadata->require)) {
         $requires = (array) $metadata->require;
     }
     $dependency = new PluginDependency();
     $missingDependencies = $dependency->getMissingDependencies($requires);
     if (!empty($missingDependencies)) {
         $message = '';
         foreach ($missingDependencies as $dep) {
             $params = array(ucfirst($dep['requirement']), $dep['actualVersion'], $dep['requiredVersion']);
             $message .= Piwik::translate('CorePluginsAdmin_MissingRequirementsNotice', $params);
         }
         throw new PluginInstallerException($message);
     }
 }
예제 #2
0
 /**
  * @param $plugin
  */
 private function addMissingRequirements($plugin)
 {
     $plugin['missingRequirements'] = array();
     if (empty($plugin['versions']) || !is_array($plugin['versions'])) {
         return $plugin;
     }
     $latestVersion = $plugin['versions'][count($plugin['versions']) - 1];
     if (empty($latestVersion['requires'])) {
         return $plugin;
     }
     $requires = $latestVersion['requires'];
     $dependency = new PluginDependency();
     $plugin['missingRequirements'] = $dependency->getMissingDependencies($requires);
     return $plugin;
 }
예제 #3
0
 public function getMissingDependencies($piwikVersion = null)
 {
     if (empty($this->pluginInformation['require'])) {
         return array();
     }
     $dependency = new Dependency();
     if (!is_null($piwikVersion)) {
         $dependency->setPiwikVersion($piwikVersion);
     }
     return $dependency->getMissingDependencies($this->pluginInformation['require']);
 }
예제 #4
0
 private function assertMissingDependency($requires, $expectedMissing)
 {
     $missing = $this->dependency->getMissingDependencies($requires);
     $this->assertEquals($expectedMissing, $missing);
 }