看到Workerman喜升5.0.0,而我的项目Composer u时报错。。

深林孤鹰

我的项目是基于webman的,今天升级时报错:

In Install.php line 21:

  [Error]
  Call to undefined function Webman\Console\base_path()

Exception trace:
  at D:\Documents\Desktop\Pleafles\_Yes\PHP\WorkerMan\_Projects\Webman\vendor\webman\console\src\Install.php:21
 Webman\Console\Install::install() at D:\Documents\Desktop\Pleafles\_Yes\PHP\WorkerMan\_Projects\Webman\support\Plugin.php:19
 support\Plugin::install() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:491
 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:276
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:150
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer/InstallationManager.php:399
 Composer\Installer\InstallationManager::Composer\Installer\{closure}() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer/InstallationManager.php:414
 Composer\Installer\InstallationManager->executeBatch() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer/InstallationManager.php:322
 Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer/InstallationManager.php:221
 Composer\Installer\InstallationManager->execute() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer.php:839
 Composer\Installer->doInstall() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer.php:649
 Composer\Installer->doUpdate() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Installer.php:298
 Composer\Installer->run() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Command/UpdateCommand.php:281
 Composer\Command\UpdateCommand->execute() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Console/Application.php:396
 Composer\Console\Application->doRun() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/src/Composer/Console/Application.php:136
 Composer\Console\Application->run() at phar://D:/Programs/Programming/PHP/Composer/composer.phar/bin/composer:98
 require() at D:\Programs\Programming\PHP\Composer\composer.phar:29

update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [--patch-only] [-i|--interactive] [--root-reqs] [--bump-after-update [BUMP-AFTER-UPDATE]] [--] [<packages>...]
254 1 0
1个回答

升级用命令
composer require workerman/workerman ^5.0.0

  • 深林孤鹰 5天前

    解决了,升级前需要先删除support/helpers.php和support/Plugin.php才行

×
🔝