Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

self-update does update, but displays class not found error and PHP output due to PHAR content changing

オープン
#238 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

@asgrim がすでに取り組んでいます。

2025年5月8日 から。

評価

この issue はまだ評価されていません。

説明

bug maintainer investigating

We introduced the EventDispatcher in #219 to handle the banner, but this has introduced a side-effect when the PHAR is overwritten (by SelfUpdateCommand), in that the PHAR content has changed and so the subsequent class loads will fail.

Reproducer:

$ php box.phar compile && php pie.phar self-update --nightly
<box compile snipped>
🥧 PHP Installer for Extensions (PIE) 0.11.0@5d7fa4f, from The PHP Foundation
You are running PHP 8.4.6
Target PHP installation: 8.4.6 nts, on Linux/OSX/etc x86_64 (from /usr/bin/php8.4)
Downloading the latest nightly release.
✅ Verified the new PIE version
✅ PIE has been upgraded to nightly
icense information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Util;

use Composer\XdebugHandler\XdebugHandler;

/**
 * Provides ini file location functions that work with and without a restart.
 * When the process has restarted it uses a tmp ini and stores the original
 * ini locations in an environment variable.
 *
 * @author John Stevenson <john-stevenson@blueyonder.co.uk>
 */
class IniHelper
{
    /**
     * Returns an array of php.ini locations with at least one entry
     *
     * The equivalent of calling php_ini_loaded_file then php_ini_scanned_files.
     * The loaded ini location is the first entry and may be empty.
     *
     * @return string[]
     */
    public static function getAll(): array
    {
        return XdebugHandler::getAllIniFiles();
    }

    /**
     * Describes the location of the loaded php.ini file(s)
     */
    public static function getMessage(): string
    {
        $paths = self::getAll();

        if (empty($paths[0])) {
            array_shift($paths);
        }

        $ini = array_shift($paths);

        if (empty($ini)) {
            return 'A php.ini file does not exist. You will have to create one.';
        }

        if (!ePHP Fatal error:  Uncaught Error: Class "Symfony\Component\Console\Event\ConsoleTerminateEvent" not found in phar:///home/james/workspace/phpf/pie/pie.phar/vendor/symfony/console/Application.php:1110
Stack trace:
#0 phar:///home/james/workspace/phpf/pie/pie.phar/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#1 phar:///home/james/workspace/phpf/pie/pie.phar/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#2 phar:///home/james/workspace/phpf/pie/pie.phar/bin/pie(53): Symfony\Component\Console\Application->run()
#3 /home/james/workspace/phpf/pie/pie.phar(15): require('...')
#4 {main}
  thrown in phar:///home/james/workspace/phpf/pie/pie.phar/vendor/symfony/console/Application.php on line 1110
主要言語
PHP
スター
2k
フォーク
73
平均マージ
3時間 37分
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

php/pie のほかの issue

php/pie の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。