Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Go to the source code of this file.
Functions | |
if(count($authFailed) > 0) catch(Exception $e) | findUnusedFilename ($dir, $filename) |
runComposer ($command) | |
deleteFilepath ($path) | |
output ($string, $level=INFO, $label='') | |
Variables | |
$_scriptName = basename(__FILE__) | |
const | SYNOPSIS <<<SYNOPSIS Updates Magento with 2.3 requirements that can't be done by `composer update` or `bin/magento setup:upgrade`. Run this script after upgrading to PHP 7.1/7.2 and before running `composer update` or `bin/magento setup:upgrade`. Steps included: - Require new version of the metapackage - Update "require-dev" section - Add "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/" to composer.json "autoload":"psr-4" section - Update Magento/Updater if it's installed - Update name, version, and description fields in the root composer.json Usage: php -f $_scriptName -- --root='</path/to/magento/root/>' [--composer='</path/to/composer/executable>'] [--edition='<community|enterprise>'] [--repo='<composer_repo_url>'] [--version='<version_constraint>'] [--help] Required: --root='</path/to/magento/root/>' Path to the Magento installation root directory Optional: --composer='</path/to/composer/executable>' Path to the composer executable - Default: The composer found in the system PATH --edition='<community|enterprise>' Target Magento edition for the update. Open Source = 'community', Commerce = 'enterprise' - Default: The edition currently required in composer.json --repo='<composer_repo_url>' The Magento repository url to use to pull the new packages - Default: The Magento repository configured in composer.json --version='<version_constraint>' A composer version constraint for allowable 2.3 packages. Versions other than 2.3 are not handled by this script See https: - Default: The latest 2.3 version available in the Magento repository --help Display this message SYNOPSIS |
$opts | |
const | INFO 0 |
const | WARN 1 |
const | ERROR 2 |
if(isset($opts['help'])) | try |
$composerFile = "$rootDir/composer.json" | |
if(!file_exists($composerFile)) | $composerData = json_decode(file_get_contents($composerFile), true) |
$metapackageMatcher = '/^magento\/product\-(?<edition>community|enterprise)\-edition$/' | |
foreach(array_keys($composerData['require']) as $requiredPackage) if(empty($edition)) if(!empty($opts['edition'])) | $edition = strtolower($edition) |
if($edition !=='community' && $edition !=='enterprise') | $composerExec = (!empty($opts['composer']) ? $opts['composer'] : 'composer') |
$constraint = !empty($opts['version']) ? $opts['version'] : '2.3.*' | |
$project = "magento/project-$edition-edition" | |
$metapackage = "magento/product-$edition-edition" | |
$mageUrls = [] | |
$authFailed = [] | |
if(!empty($opts['repo'])) | else |
$projectConstraint = "$project='$constraint'" | |
$version = null | |
$description = null | |
$composerBackup = findUnusedFilename($rootDir, 'composer.json.bak') | |
$repoUrls = array_map(function ($r) { return $r['url']; }, $composerData['repositories']) | |
$composerData ['autoload']['psr-4']['Zend\\Mvc\\Controller\\'] = 'setup/src/Zend/Mvc/Controller/' | |
$updateDir = "$rootDir/update" | |
deleteFilepath | ( | $path | ) |
Deletes a file or a directory and all its contents
string | $path |
Exception |
Definition at line 363 of file pre_composer_update_2.3.php.
if (count( $authFailed) > 0) catch (Exception $e) findUnusedFilename | ( | $dir, | |
$filename | |||
) |
Gets a variant of a filename that doesn't already exist so we don't overwrite anything
string | $dir | |
string | $filename |
Definition at line 314 of file pre_composer_update_2.3.php.
output | ( | $string, | |
$level = INFO , |
|||
$label = '' |
|||
) |
Logs the given text with
newline replacement and log level formatting
string | $string | Text to log |
int | $level | One of INFO, WARN, or ERROR |
string | $label | Optional message label; defaults to WARNING for $level = WARN and ERROR for $level = ERROR |
Definition at line 389 of file pre_composer_update_2.3.php.
runComposer | ( | $command | ) |
Execute a composer command, reload $composerData afterwards, and check for repo authentication warnings
string | $command |
RuntimeException |
Definition at line 330 of file pre_composer_update_2.3.php.
$_scriptName = basename(__FILE__) |
Definition at line 9 of file pre_composer_update_2.3.php.
$authFailed = [] |
Definition at line 143 of file pre_composer_update_2.3.php.
$composerBackup = findUnusedFilename($rootDir, 'composer.json.bak') |
Definition at line 202 of file pre_composer_update_2.3.php.
if (!file_exists( $composerFile)) $composerData = json_decode(file_get_contents($composerFile), true) |
Definition at line 91 of file pre_composer_update_2.3.php.
$composerData[ 'autoload'][ 'psr-4'][ 'Zend\\Mvc\\Controller\\'] = 'setup/src/Zend/Mvc/Controller/' |
Definition at line 244 of file pre_composer_update_2.3.php.
if ( $composerFailed) $composerExec = (!empty($opts['composer']) ? $opts['composer'] : 'composer') |
Definition at line 114 of file pre_composer_update_2.3.php.
$composerFile = "$rootDir/composer.json" |
Definition at line 86 of file pre_composer_update_2.3.php.
$constraint = !empty($opts['version']) ? $opts['version'] : '2.3.*' |
Definition at line 135 of file pre_composer_update_2.3.php.
$description = null |
Definition at line 162 of file pre_composer_update_2.3.php.
foreach (array_keys( $composerData[ 'require']) as $requiredPackage) if (empty( $edition)) if (!empty( $opts[ 'edition'])) $edition = strtolower($edition) |
Definition at line 108 of file pre_composer_update_2.3.php.
$mageUrls = [] |
Definition at line 142 of file pre_composer_update_2.3.php.
$metapackage = "magento/product-$edition-edition" |
Definition at line 139 of file pre_composer_update_2.3.php.
$metapackageMatcher = '/^magento\/product\-(?<edition>community|enterprise)\-edition$/' |
Definition at line 93 of file pre_composer_update_2.3.php.
$opts |
Definition at line 53 of file pre_composer_update_2.3.php.
$project = "magento/project-$edition-edition" |
Definition at line 138 of file pre_composer_update_2.3.php.
$projectConstraint = "$project='$constraint'" |
Definition at line 160 of file pre_composer_update_2.3.php.
Definition at line 207 of file pre_composer_update_2.3.php.
$updateDir = "$rootDir/update" |
Definition at line 256 of file pre_composer_update_2.3.php.
$version = null |
Definition at line 161 of file pre_composer_update_2.3.php.
if (!empty( $opts[ 'repo'])) else |
Definition at line 147 of file pre_composer_update_2.3.php.
const ERROR 2 |
Definition at line 65 of file pre_composer_update_2.3.php.
const INFO 0 |
Definition at line 63 of file pre_composer_update_2.3.php.
const SYNOPSIS <<<SYNOPSIS Updates Magento with 2.3 requirements that can't be done by `composer update` or `bin/magento setup:upgrade`. Run this script after upgrading to PHP 7.1/7.2 and before running `composer update` or `bin/magento setup:upgrade`. Steps included: - Require new version of the metapackage - Update "require-dev" section - Add "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/" to composer.json "autoload":"psr-4" section - Update Magento/Updater if it's installed - Update name, version, and description fields in the root composer.json Usage: php -f $_scriptName -- --root='</path/to/magento/root/>' [--composer='</path/to/composer/executable>'] [--edition='<community|enterprise>'] [--repo='<composer_repo_url>'] [--version='<version_constraint>'] [--help] Required: --root='</path/to/magento/root/>' Path to the Magento installation root directory Optional: --composer='</path/to/composer/executable>' Path to the composer executable - Default: The composer found in the system PATH --edition='<community|enterprise>' Target Magento edition for the update. Open Source = 'community', Commerce = 'enterprise' - Default: The edition currently required in composer.json --repo='<composer_repo_url>' The Magento repository url to use to pull the new packages - Default: The Magento repository configured in composer.json --version='<version_constraint>' A composer version constraint for allowable 2.3 packages. Versions other than 2.3 are not handled by this script See https: - Default: The latest 2.3 version available in the Magento repository --help Display this message SYNOPSIS |
Definition at line 11 of file pre_composer_update_2.3.php.
if (isset( $opts[ 'help'])) try |
Definition at line 72 of file pre_composer_update_2.3.php.
const WARN 1 |
Definition at line 64 of file pre_composer_update_2.3.php.