Piwik\Updater::getComponentsWithUpdateFile PHP Method

getComponentsWithUpdateFile() public method

Returns a list of components (core | plugin) that need to run through the upgrade process.
public getComponentsWithUpdateFile ( string[] $componentsToCheck ) : array(
$componentsToCheck string[] An array mapping component names to the latest locally available version. If the version is later than the currently installed version, the component must be upgraded. Example: `array('core' => '2.11.0')`
return array(
    public function getComponentsWithUpdateFile($componentsToCheck)
    {
        $this->componentsWithNewVersion = $this->getComponentsWithNewVersion($componentsToCheck);
        $this->componentsWithUpdateFile = $this->loadComponentsWithUpdateFile();
        return $this->componentsWithUpdateFile;
    }

Usage Example

コード例 #1
0
 public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
 {
     $updater = new Updater(PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/', PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/');
     $updater->markComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
     $updater->markComponentSuccessfullyUpdated('core', '0.1');
     $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile(array('testpluginUpdates' => '0.1', 'core' => '0.3'));
     $this->assertEquals(2, count($componentsWithUpdateFile));
     reset($componentsWithUpdateFile);
     $this->assertEquals('core', key($componentsWithUpdateFile));
 }
All Usage Examples Of Piwik\Updater::getComponentsWithUpdateFile