Page MenuHomePhabricator

autoload_classmap.php exists but instead non-existent autoload_static.php is used ruining entire upgrade
Closed, DuplicatePublic

Description

In
vendor/composer/autoload_real.php
wouldn't it be best to first check which of the two files is available,

$ find mediawiki|grep -i autoload_[cs]
mediawiki/vendor/composer/autoload_classmap.php

before doing

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
which chooses
require_once DIR . '/autoload_static.php';
or
require DIR . '/autoload_classmap.php';

which might result in

PHP Warning: require_once(/home/jidanni/mediawiki/vendor/composer/autoload_static.php): failed to open stream: No such file or directory in /home/jidanni/mediawiki/vendor/composer/autoload_real.php on line 32
PHP Fatal error: require_once(): Failed opening required '/home/jidanni/mediawiki/vendor/composer/autoload_static.php' (include_path='/home/jidanni/mediawiki/vendor/pear/pear_exception:/home/jidanni/mediawiki/vendor/pear/console_getopt:/home/jidanni/mediawiki/vendor/pear/pear-core-minimal/src:/home/jidanni/mediawiki/vendor/pear/mail_mime:/home/jidanni/mediawiki/vendor/pear/mail_mime-decode:/home/jidanni/mediawiki/vendor/pear/net_socket:/home/jidanni/mediawiki/vendor/pear/net_smtp:/home/jidanni/mediawiki/vendor/pear/mail:.:/usr/share/php') in /home/jidanni/mediawiki/vendor/composer/autoload_real.php on line 32

when used with
$ dpkg -l|grep php|tr -s ' '
ii libapache2-mod-php7.0 7.0.6-10 i386 server-side, HTML-embedded scripting language (Apache 2 module)
ii php 1:7.0+40 all server-side, HTML-embedded scripting language (default)
ii php-common 1:40 all Common files for PHP packages
ii php-doc 20140201-1 all Documentation for PHP5
ii php-elisp 1.13.5-2 all Emacs support for php files
ii php-gettext 1.0.11-2 all read gettext MO files directly, without requiring anything other than PHP
ii php-mysql 1:7.0+40 all MySQL module for PHP [default]
ii php-pear 1:1.10.1+submodules+notgz-8 all PEAR Base System
ii php-phpseclib 2.0.1-2 all implementations of an arbitrary-precision integer arithmetic library
ii php-xml 1:7.0+40 all DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii php7.0 7.0.6-10 all server-side, HTML-embedded scripting language (metapackage)
ii php7.0-cli 7.0.6-10 i386 command-line interpreter for the PHP scripting language
ii php7.0-common 7.0.6-10 i386 documentation, examples and common module for PHP
ii php7.0-json 7.0.6-10 i386 JSON module for PHP
ii php7.0-mbstring 7.0.6-10 i386 MBSTRING module for PHP
ii php7.0-mysql 7.0.6-10 i386 MySQL module for PHP
ii php7.0-opcache 7.0.6-10 i386 Zend OpCache module for PHP
ii php7.0-readline 7.0.6-10 i386 readline module for PHP
ii php7.0-xml 7.0.6-10 i386 DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii phpmyadmin 4:4.6.1-1 all MySQL web administration tool

on Debian.

Event Timeline

Jidanni renamed this task from autoload_classmap.php exists but instead non-existent autoload_static.php is used ruining entire upgrade! to autoload_classmap.php exists but instead non-existent autoload_static.php is used ruining entire upgrade.May 17 2016, 6:22 PM
Jidanni triaged this task as High priority.

Change 289507 had a related patch set uploaded (by Reedy):
Add autoload_static.php

https://gerrit.wikimedia.org/r/289507

This doesn't actually just break update.php, it breaks my whole dev wiki.... Also PHP 7 etc

I don't know if just committing this file is enough for it to be kept upto date...

Change 289507 abandoned by Reedy:
Add autoload_static.php

https://gerrit.wikimedia.org/r/289507