Skip to content
Extraits de code Groupes Projets
Valider 4251c618 rédigé par Matthieu Aubry's avatar Matthieu Aubry Validation de GitHub
Parcourir les fichiers

Update composer libraries, while enforcing the minimum php in composer.json (#10334)

* Enforce the Minimum PHP version in composer.json using "platform" feature
Added in https://github.com/composer/composer/commit/a57c51e8d78156612e49dec1c54d3184f260f144

It was found that this flag is very important to use to make sure the package we build and release will be compatible with this PHP version.
Otherwise, the minimum PHP version enforced would be the version where our build script runs, which could be PHP 5.5 or PHP 7 which would have caused serious issues.

* Update doctrine/cache, monolog,piwik/network, piwik/cache, piwik/php-tracker  etc.
https://github.com/piwik/piwik/issues/10058

* Release checklist to check that composer.json is correctly defined

* Use latest travis scripts for https://github.com/piwik/travis-scripts/commit/30d7b16940058a3dcea37dd7e7ed7241090bf57a

* .travis.yml file is out of date, auto-updating .travis.yml file.

* Use latest travis scripts for https://github.com/piwik/travis-scripts/commit/63445cf4a53e6e115a31ecacd79327dc5bfb2494

* .travis.yml file is out of date, auto-updating .travis.yml file.
parent ef3e384b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -101,8 +101,8 @@ install:
# travis now complains about this failing 9 times out of 10, so removing it
#- travis_retry composer self-update
- '[ "$SKIP_COMPOSER_INSTALL" == "1" ] || travis_retry composer install'
- '[ "$SKIP_COMPOSER_INSTALL" == "1" ] || travis_retry composer install'
before_script:
......
......@@ -18,21 +18,9 @@
"wiki": "https://github.com/piwik/piwik/wiki",
"source": "https://github.com/piwik/piwik"
},
"autoload": {
"psr-4": {
"Piwik\\Plugins\\": "plugins/",
"Piwik\\": "core/"
},
"psr-0": {
"Zend_": "libs/",
"HTML_": "libs/",
"PEAR_": "libs/",
"Archive_": "libs/"
}
},
"autoload-dev": {
"psr-4": {
"Piwik\\Tests\\": "tests/PHPUnit/"
"config":{
"platform": {
"php": "5.3.3"
}
},
"require": {
......@@ -107,5 +95,22 @@
"post-install-cmd": [
"Piwik\\Composer\\ScriptHandler::buildXhprof"
]
},
"autoload": {
"psr-4": {
"Piwik\\Plugins\\": "plugins/",
"Piwik\\": "core/"
},
"psr-0": {
"Zend_": "libs/",
"HTML_": "libs/",
"PEAR_": "libs/",
"Archive_": "libs/"
}
},
"autoload-dev": {
"psr-4": {
"Piwik\\Tests\\": "tests/PHPUnit/"
}
}
}
Ce diff est replié.
......@@ -28,6 +28,8 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase
{
private $globalConfig;
const MINIMUM_PHP_VERSION = '5.3.3';
public function setUp()
{
$iniReader = new IniReader();
......@@ -36,6 +38,21 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase
parent::setUp();
}
public function test_minimumPHPVersion_isEnforced()
{
global $piwik_minimumPHPVersion;
$this->assertEquals(self::MINIMUM_PHP_VERSION, $piwik_minimumPHPVersion, 'minimum PHP version global variable correctly defined');
}
public function test_minimumPhpVersion_isDefinedInComposerJson()
{
$composerJson = $this->getComposerJsonAsArray();
$this->assertEquals(self::MINIMUM_PHP_VERSION, $composerJson['config']['platform']['php']);
$expectedRequirePhp = '>=' . self::MINIMUM_PHP_VERSION;
$this->assertEquals($expectedRequirePhp, $composerJson['require']['php']);
}
public function test_icoFilesIconsShouldBeInPngFormat()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.ico');
......@@ -605,8 +622,7 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase
*/
private function getComposerRequireDevPackages()
{
$composer = file_get_contents(PIWIK_INCLUDE_PATH . '/composer.json');
$composerJson = json_decode($composer, $assoc = true);
$composerJson = $this->getComposerJsonAsArray();
$composerDependencyDevOnly = array_keys($composerJson["require-dev"]);
return $composerDependencyDevOnly;
}
......@@ -752,5 +768,14 @@ class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase
return stripos($file, "/tests/") !== false;
}
/**
* @return mixed
*/
private function getComposerJsonAsArray()
{
$composer = file_get_contents(PIWIK_INCLUDE_PATH . '/composer.json');
$composerJson = json_decode($composer, $assoc = true);
return $composerJson;
}
}
Subproject commit e6a2e9eba8e475ac47298b0676b14983043ddb88
Subproject commit 63445cf4a53e6e115a31ecacd79327dc5bfb2494
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter