composer install – 永夜 https://www.shuijingwanwq.com 没有不值得去解决的问题,也没有不值得去学习的技术! Sun, 31 May 2026 03:54:00 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0 执行:composer install 时,提示:enqueue/rdkafka 0.10.19 requires ext-rdkafka -> it is missing from your system. Install or enable PHP’s rdkafka extension. https://www.shuijingwanwq.com/2023/12/13/8274/ https://www.shuijingwanwq.com/2023/12/13/8274/#respond Wed, 13 Dec 2023 01:48:18 +0000 https://www.shuijingwanwq.com/?p=8274 Post Views: 88

1、执行:composer install 时,提示:enqueue/rdkafka 0.10.19 requires ext-rdkafka -> it is missing from your system. Install or enable PHP’s rdkafka extension.。如图1

执行:composer install 时,提示:enqueue/rdkafka 0.10.19 requires ext-rdkafka -> it is missing from your system. Install or enable PHP's rdkafka extension.

图1


PS E:\wwwroot\object> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - enqueue/rdkafka is locked to version 0.10.19 and an update of this package was not requested.
    - enqueue/rdkafka 0.10.19 requires ext-rdkafka ^4.0|^5.0|^6.0 -> it is missing from your system. Install or enable PHP's rdkafka extension.

To enable extensions, verify that they are enabled in your .ini files:
    - C:\php-7.4.27\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-rdkafka` to temporarily ignore these required extensions.


2、决定启用 PHP 的 rdkafka 扩展。打开:https://pecl.php.net/package/rdkafka/6.0.1/windows ,下载 7.4 Thread Safe (TS) x64。解压缩 php_rdkafka-6.0.1-7.4-ts-vc15-x64 后,将 php_rdkafka.dll 复制至:C:\php-7.4.27\ext\php_rdkafka.dll。然后编辑 php.ini,添加 extension=rdkafka

3、重新启动 PHP 时,报错:PHP Warning: PHP Startup: Unable to load dynamic library ‘rdkafka’。如图2

重新启动 PHP 时,报错:PHP Warning: PHP Startup: Unable to load dynamic library 'rdkafka'

图2

PS C:\Users\Lenovo> php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.27/php.ini
PHP Warning:  PHP Startup: Unable to load dynamic library 'rdkafka' (tried: C:/php-7.4.27/ext\rdkafka (鎵句笉鍒版寚瀹氱殑妯″潡銆?, C:/php-7.4.27/ext\php_rdkafka.dll (鎵句 笉鍒版寚瀹氱殑妯″潡銆?) in Unknown on line 0
<br />
<b>Warning</b>:  PHP Startup: Unable to load dynamic library 'rdkafka' (tried: C:/php-7.4.27/ext\rdkafka (鎵句笉鍒版寚瀹氱殑妯″潡銆?, C:/php-7.4.27/ext\php_rdkafka.dll (鎵句笉鍒版寚瀹氱殑妯″潡銆?) in <b>Unknown</b> on line <b>0</b><br />
 

4、参考:https://arnaud.le-blanc.net/php-rdkafka-doc/phpdoc/rdkafka.installation.windows.html Installing the rdkafka extension on Windows。将 librdkafka.dll 放入 PHP 根目录(与 php.exe 同一级别),将 php_rdkfaka.dll 文件放入 PHP 扩展目录(默认为“ext”)。将 librdkafka.dll 复制至:C:\php-7.4.27\librdkafka.dll。重新启动 PHP 时,不再报错。

5、查看 phpinfo,搜索:rdkafka,PHP 的 rdkafka 扩展已经启用成功。如图3

查看 phpinfo,搜索:rdkafka,PHP 的 rdkafka 扩展已经启用成功

图3

6、执行:composer install 时,不再提示,运行正常。如图4

执行:composer install 时,不再提示,运行正常

图4

]]>
https://www.shuijingwanwq.com/2023/12/13/8274/feed/ 0
在 GitLab 的 CI / CD 的 Pipelines 中,Build composer 失败 https://www.shuijingwanwq.com/2022/10/08/7027/ https://www.shuijingwanwq.com/2022/10/08/7027/#respond Sat, 08 Oct 2022 06:42:32 +0000 https://www.shuijingwanwq.com/?p=7027 Post Views: 79 1、在 GitLab 的 CI / CD 的 Pipelines 中,Build composer 失败。如图1
在 GitLab 的 CI / CD 的 Pipelines 中,Build composer 失败

图1



$ php artisan key:generate

In DatabaseServiceProvider.php line 88:
                                   
  Class 'Faker\Factory' not found  
                                   

Cleaning up file based variables
ERROR: Job failed: command terminated with exit code 1


2、在本地环境搜索 Class ‘Faker\Factory’,确定 /vendor/fzaninotto/faker/src/Faker/Factory.php 是存在的。在本地环境执行:php artisan key:generate 成功。如图2
在本地环境搜索 Class 'Faker\Factory',确定 /vendor/fzaninotto/faker/src/Faker/Factory.php 是存在的。在本地环境执行:php artisan key:generate 成功

图2



PS E:\wwwroot\object> php artisan key:generate
Application key set successfully.


3、查看 gitlab-runner 中的日志,if [ ! -x “vendor” ];then echo ‘vendor not exists’; composer self-update 2.1.14; composer install –prefer-dist –no-ansi –no-interaction –no-progress –no-scripts –no-dev; else echo ‘vendor exists’; fi。如图3
查看 gitlab-runner 中的日志

图3



$ if [ ! -x "vendor" ];then echo 'vendor not exists'; composer self-update 2.1.14; composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts --no-dev; else echo 'vendor exists'; fi
vendor not exists
You are already using the latest available Composer version 2.1.14 (stable channel).
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 233 installs, 0 updates, 0 removals


4、在本地环境执行 composer install –prefer-dist –no-ansi –no-interaction –no-progress –no-scripts –no-dev,然后再执行 php artisan key:generate。报错:In Application.php line 679: Class ‘Barryvdh\Debugbar\ServiceProvider’ not found。原因应该在于本地环境与线上环境的配置项有差异。


PS E:\wwwroot\object> php artisan key:generate

In Application.php line 679:

  Class 'Barryvdh\Debugbar\ServiceProvider' not found




5、在本地环境执行 composer install –prefer-dist –no-ansi –no-interaction –no-progress –no-scripts,然后再执行 php artisan key:generate。不再报错。由此确认原因在于 –no-dev 的添加导致了流水线失败。–no-dev: 跳过 require-dev 字段中列出的包。在 composer.json 的 require-dev 配置中,存在 “fzaninotto/faker”: “^1.4″。


    "require-dev": {
        "fzaninotto/faker": "^1.4",
    },


6、将 require-dev 配置中的 “fzaninotto/faker”: “^1.4” 移至 require 配置中。不再报错。]]>
https://www.shuijingwanwq.com/2022/10/08/7027/feed/ 0
执行 php artisan config:clear 时,报错:ErrorException : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory https://www.shuijingwanwq.com/2022/07/27/6826/ https://www.shuijingwanwq.com/2022/07/27/6826/#respond Wed, 27 Jul 2022 01:14:11 +0000 https://www.shuijingwanwq.com/?p=6826 Post Views: 124 1、执行 php artisan config:clear 时,报错:ErrorException : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory。如图1
执行 php artisan config:clear 时,报错:ErrorException  : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory

图1



PS E:\wwwroot\object> php artisan config:clear

   ErrorException  : include(E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php): failed to open stream: No such file or directory

  at E:\wwwroot\object\vendor\composer\ClassLoader.php:571
    567|  * @private
    568|  */
    569| function includeFile($file)
    570| {
  > 571|     include $file;
    572| }
    573|

  Exception trace:

  1   include()
      E:\wwwroot\object\vendor\composer\ClassLoader.php:571

  2   Composer\Autoload\includeFile("E:\wwwroot\object\vendor\composer/../../Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php")
      E:\wwwroot\object\vendor\composer\ClassLoader.php:428

  Please use the argument -v to see more details.


2、确认文件 Modules/ThemeStoreGraphQL/Providers/GraphQlResolverServiceProvider.php 已经不存在,被重命名为:Modules/OnlineStoreThemeGraphQL/Providers/GraphQlResolverServiceProvider.php 3、执行:composer install 命令,以重新生成 vendor\composer\ClassLoader.php。报错:In ProviderRepository.php line 208: Class ‘Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider’ not found Script @php artisan package:discover –ansi handling the post-autoload-dump event returned with error code 1。如图2
执行:composer install 命令,以重新生成 vendor\composer\ClassLoader.php。报错:In ProviderRepository.php line 208: Class 'Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider' not found Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

图2



PS E:\wwwroot\object> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 29 updates, 0 removals
  ...
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In ProviderRepository.php line 208:

  Class 'Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider' not
  found


Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1


4、原因在于 /config/app.php 的 providers 中包含:\Modules\ThemeStoreGraphQL\Providers\GraphQlResolverServiceProvider::class, 5、再次执行:composer install、php artisan config:clear,皆运行成功。


PS E:\wwwroot\object> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
...
Package manifest generated successfully.
111 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PS E:\wwwroot\object> php artisan config:clear
Configuration cache cleared!


   ]]>
https://www.shuijingwanwq.com/2022/07/27/6826/feed/ 0
Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91 https://www.shuijingwanwq.com/2022/05/11/6395/ https://www.shuijingwanwq.com/2022/05/11/6395/#respond Wed, 11 May 2022 01:10:45 +0000 https://www.shuijingwanwq.com/?p=6395 Post Views: 89 1、执行:composer install 时提示:Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91。如图1
执行:composer install 时提示:Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91

图1



PS E:\wwwroot\object> composer install
Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove


2、参考:https://www.shuijingwanwq.com/2022/04/19/6307/ 。当时无需要编辑 composer.json,添加 “conedevelopment/blade-filters”: “^0.8”。删除掉此行,避免重复。 3、参考 Warning,执行 composer update conedevelopment/blade-filters。如图2
参考 Warning,执行 composer update conedevelopment/blade-filters

图2



PS E:\wwwroot\object> composer update conedevelopment/blade-filters
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files


4、查看 Git 日志,composer.lock 无变化。 5、再次执行:composer install,不再提示。如图3  ]]>
https://www.shuijingwanwq.com/2022/05/11/6395/feed/ 0
Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91。Warning: The lock file is not up to date with the latest changes in composer.json https://www.shuijingwanwq.com/2022/04/19/6307/ https://www.shuijingwanwq.com/2022/04/19/6307/#respond Tue, 19 Apr 2022 01:10:14 +0000 https://www.shuijingwanwq.com/?p=6307 Post Views: 123 1、执行 composer install 时,报错:Class ‘Pine\BladeFilters\BladeFilters’ not found。如图1
执行 composer install 时,报错:Class 'Pine\BladeFilters\BladeFilters' not found

图1



> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Symfony\Component\Debug\Exception\FatalThrowableError  : Class 'Pine\BladeFilters\BladeFilters' not found

  at E:\wwwroot\object\Modules\ThemeAssetCdn\View\ThemeAssetFilters.php:22
    18|     }
    19|
    20|     public static function scriptTag()
    21|     {
  > 22|         BladeFilters::macro('script_tag', function (string $asset,$type = 'text/javascript', $async = null, $defer = null) {
    23|             static $scripts = [];
    24|             if (isset($scripts[$asset])) {
    25|                 return '';
    26|             } else {



2、编辑 composer.json,添加 “conedevelopment/blade-filters”: “^0.8”


    "require": {
        ...
        "conedevelopment/blade-filters": "^0.8"
    },


3、再次执行时,提示:Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91。Warning: The lock file is not up to date with the latest changes in composer.json。如图2
再次执行时,提示:Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91。Warning: The lock file is not up to date with the latest changes in composer.json

图2

<pre class="wp-block-syntaxhighlighter-code">

PS E:\wwwroot\object> composer install
Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Nothing to install, update or remove

</pre>
4、参考 Warning,执行 composer update conedevelopment/blade-filters。如图3
参考 Warning,执行 composer update conedevelopment/blade-filters

图3



PS E:\wwwroot\object> composer update conedevelopment/blade-filters
Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 23 installs, 0 updates, 1 removal
  - Removing neobject/facebook-conversions-api (1.4.0)
  - Locking barryvdh/laravel-debugbar (v3.6.7)
  - Locking conedevelopment/blade-filters (v0.8.0)
  - Locking elasticsearch/elasticsearch (8.x-dev 3cab97a)
  - Locking ezimuel/guzzlestreams (3.0.1)
  - Locking ezimuel/ringphp (1.2.0)
  - Locking haydenpierce/class-finder (0.4.3)
  - Locking laragraph/utils (v1.3.0)
  - Locking laravel/scout (v8.6.1)
  - Locking laravie/html (v6.0.1)
  - Locking lstrojny/functional-php (1.17.0)
  - Locking maximebf/debugbar (v1.18.0)
  - Locking nuwave/lighthouse (v5.45.0)
  - Locking orchestra/asset (v4.0.1)
  - Locking orchestra/contracts (v4.1.1)
  - Locking orchestra/support (v4.1.1)
  - Locking react/promise (v2.9.0)
  - Locking respect/stringifier (0.2.0)
  - Locking respect/validation (2.2.3)
  - Locking spatie/valuestore (1.3.0)
  - Locking statamic/stringy (3.1.2)
  - Locking tamayo/laravel-scout-elastic (8.0.3)
  - Locking thecodingmachine/safe (v1.3.3)
  - Locking webonyx/graphql-php (v14.11.5)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 23 installs, 0 updates, 1 removal
  - Downloading conedevelopment/blade-filters (v0.8.0)
  - Downloading elasticsearch/elasticsearch (8.x-dev 3cab97a)
  - Downloading lstrojny/functional-php (1.17.0)
  - Downloading nuwave/lighthouse (v5.45.0)
  - Downloading statamic/stringy (3.1.2)
  - Downloading orchestra/contracts (v4.1.1)
  - Downloading orchestra/support (v4.1.1)
  - Downloading laravie/html (v6.0.1)
  - Downloading orchestra/asset (v4.0.1)
  - Downloading spatie/valuestore (1.3.0)
  - Removing neobject/facebook-conversions-api (1.4.0)
  - Installing maximebf/debugbar (v1.18.0): Extracting archive
  - Installing barryvdh/laravel-debugbar (v3.6.7): Extracting archive
  - Installing conedevelopment/blade-filters (v0.8.0): Extracting archive
  - Installing react/promise (v2.9.0): Extracting archive
  - Installing ezimuel/guzzlestreams (3.0.1): Extracting archive
  - Installing ezimuel/ringphp (1.2.0): Extracting archive
  - Installing elasticsearch/elasticsearch (8.x-dev 3cab97a): Extracting archive
  - Installing lstrojny/functional-php (1.17.0): Extracting archive
  - Installing webonyx/graphql-php (v14.11.5): Extracting archive
  - Installing thecodingmachine/safe (v1.3.3): Extracting archive
  - Installing laragraph/utils (v1.3.0): Extracting archive
  - Installing haydenpierce/class-finder (0.4.3): Extracting archive
  - Installing nuwave/lighthouse (v5.45.0): Extracting archive
  - Installing statamic/stringy (3.1.2): Extracting archive
  - Installing orchestra/contracts (v4.1.1): Extracting archive
  - Installing orchestra/support (v4.1.1): Extracting archive
  - Installing laravie/html (v6.0.1): Extracting archive
  - Installing orchestra/asset (v4.0.1): Extracting archive
  - Installing respect/stringifier (0.2.0): Extracting archive
  - Installing respect/validation (2.2.3): Extracting archive
  - Installing spatie/valuestore (1.3.0): Extracting archive
  - Installing laravel/scout (v8.6.1): Extracting archive
  - Installing tamayo/laravel-scout-elastic (8.0.3): Extracting archive
9 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Google\Task\Composer::cleanup
Class Sofa\Eloquence\Searchable\Searchable located in E:/wwwroot/object/vendor/sofa/eloquence-base/src\Contracts\Searchable\Searchable.php does not comply with psr-4 autoloading standard. Skipping.
Class Modules\ThemeStore\Tests\FactoryTest located in E:/wwwroot/object/Modules\ThemeStore\Tests\Unit\FactoryTest.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: arubacao/asset-cdn
Discovered Package: axlon/laravel-postal-code-validation
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: beyondcode/laravel-er-diagram-generator
Discovered Package: boaideas/laravel-cli-create-user
Discovered Package: conedevelopment/blade-filters
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: dingo/api
Discovered Package: fideloper/proxy
Discovered Package: genealabs/laravel-model-caching
Discovered Package: igaster/laravel-theme
Discovered Package: ignited/laravel-omnipay
Discovered Package: intervention/image
Discovered Package: jenssegers/agent
Discovered Package: jgrossi/corcel
Discovered Package: laravel/passport
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: maatwebsite/excel
Discovered Package: mavinoo/laravel-batch
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: nuwave/lighthouse
Discovered Package: nwidart/laravel-modules
Discovered Package: orangehill/iseed
Discovered Package: overtrue/laravel-pinyin
Discovered Package: overtrue/laravel-wechat
Discovered Package: prettus/l5-repository
Discovered Package: s-ichikawa/laravel-sendgrid-driver
Discovered Package: sentry/sentry-laravel
Discovered Package: silber/page-cache
Discovered Package: socialiteproviders/manager
Discovered Package: sofa/eloquence-base
Discovered Package: sofa/eloquence-mutable
Discovered Package: spatie/laravel-activitylog
Discovered Package: spatie/laravel-permission
Discovered Package: spatie/laravel-query-builder
Discovered Package: spatie/laravel-sitemap
Discovered Package: tamayo/laravel-scout-elastic
Discovered Package: torann/geoip
Package manifest generated successfully.
115 packages you are using are looking for funding.
Use the `composer fund` command to find out more!


5、再次执行 composer install 时,不再报错。


PS E:\wwwroot\object> composer install
Key conedevelopment/blade-filters is a duplicate in ./composer.json at line 91
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Google\Task\Composer::cleanup
Class Sofa\Eloquence\Searchable\Searchable located in E:/wwwroot/object/vendor/sofa/eloquence-base/src\Contracts\Searchable\Searchable.php does not comply with psr-4 autoloading standard. Skipping.
Class Modules\ThemeStore\Tests\FactoryTest located in E:/wwwroot/object/Modules\ThemeStore\Tests\Unit\FactoryTest.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: arubacao/asset-cdn
Discovered Package: axlon/laravel-postal-code-validation
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: beyondcode/laravel-er-diagram-generator
Discovered Package: boaideas/laravel-cli-create-user
Discovered Package: conedevelopment/blade-filters
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: dingo/api
Discovered Package: fideloper/proxy
Discovered Package: genealabs/laravel-model-caching
Discovered Package: igaster/laravel-theme
Discovered Package: ignited/laravel-omnipay
Discovered Package: intervention/image
Discovered Package: jenssegers/agent
Discovered Package: jgrossi/corcel
Discovered Package: laravel/passport
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: maatwebsite/excel
Discovered Package: mavinoo/laravel-batch
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: nuwave/lighthouse
Discovered Package: nwidart/laravel-modules
Discovered Package: orangehill/iseed
Discovered Package: overtrue/laravel-pinyin
Discovered Package: overtrue/laravel-wechat
Discovered Package: prettus/l5-repository
Discovered Package: s-ichikawa/laravel-sendgrid-driver
Discovered Package: sentry/sentry-laravel
Discovered Package: silber/page-cache
Discovered Package: socialiteproviders/manager
Discovered Package: sofa/eloquence-base
Discovered Package: sofa/eloquence-mutable
Discovered Package: spatie/laravel-activitylog
Discovered Package: spatie/laravel-permission
Discovered Package: spatie/laravel-query-builder
Discovered Package: spatie/laravel-sitemap
Discovered Package: tamayo/laravel-scout-elastic
Discovered Package: torann/geoip
Package manifest generated successfully.
115 packages you are using are looking for funding.
Use the `composer fund` command to find out more!


]]>
https://www.shuijingwanwq.com/2022/04/19/6307/feed/ 0
在 composer.json 中,scripts 中的一些命令未执行的排查分析 https://www.shuijingwanwq.com/2022/03/08/6094/ https://www.shuijingwanwq.com/2022/03/08/6094/#respond Tue, 08 Mar 2022 01:25:50 +0000 https://www.shuijingwanwq.com/?p=6094 Post Views: 274 1、查看 composer.json 中的 scripts 部分。如图1
查看 composer.json 中的 scripts 部分。

图1



    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "pre-autoload-dump": "Google\\Task\\Composer::cleanup",
        "lint": "phpcs --standard=PSR1,PSR2,./ruleset.xml --ignore=config/us-zipcode.php app/ routes/ config/ ",
        "lint-fix": "phpcbf --standard=PSR1,PSR2 --ignore=config/us-zipcode.php  app/ routes/ config/ "
    }


2、执行命令:composer install 时,仅执行了 pre-autoload-dump、post-autoload-dump 部分下的命令。如图2
执行命令:composer install 时,仅执行了 pre-autoload-dump、post-autoload-dump 部分下的命令

图2



PS E:\wwwroot\object> composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Google\Task\Composer::cleanup
Class Tests\Feature\LoginApiPostCartPaymentTest located in E:/wwwroot/object/tests\Feature\ApiCartPaymentTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Tests\Feature\LoginApiPostCartTest located in E:/wwwroot/object/tests\Feature\ApiCartTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Tests\Feature\LoginGetPaymentTest located in E:/wwwroot/object/tests\Feature\PaymentTest.php does not comply with psr-4 autoloading standard. Skipping.
Class Sofa\Eloquence\Searchable\Searchable located in E:/wwwroot/object/vendor/sofa/eloquence-base/src\Contracts\Searchable\Searchable.php does not comply with psr-4 autoloading standard. Skipping.
Class Modules\ThemeStore\Tests\FactoryTest located in E:/wwwroot/object/Modules\ThemeStore\Tests\Unit\FactoryTest.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: arubacao/asset-cdn
Discovered Package: axlon/laravel-postal-code-validation
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: beyondcode/laravel-er-diagram-generator
Discovered Package: boaideas/laravel-cli-create-user
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: dingo/api
Discovered Package: fideloper/proxy
Discovered Package: genealabs/laravel-model-caching
Discovered Package: igaster/laravel-theme
Discovered Package: ignited/laravel-omnipay
Discovered Package: intervention/image
Discovered Package: jenssegers/agent
Discovered Package: jgrossi/corcel
Discovered Package: laravel/passport
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: maatwebsite/excel
Discovered Package: mavinoo/laravel-batch
Discovered Package: nesbot/carbon
Discovered Package: newobject/facebook-conversions-api
Discovered Package: nunomaduro/collision
Discovered Package: nuwave/lighthouse
Discovered Package: nwidart/laravel-modules
Discovered Package: orangehill/iseed
Discovered Package: overtrue/laravel-pinyin
Discovered Package: overtrue/laravel-wechat
Discovered Package: prettus/l5-repository
Discovered Package: s-ichikawa/laravel-sendgrid-driver
Discovered Package: sentry/sentry-laravel
Discovered Package: silber/page-cache
Discovered Package: socialiteproviders/manager
Discovered Package: sofa/eloquence-base
Discovered Package: sofa/eloquence-mutable
Discovered Package: spatie/laravel-activitylog
Discovered Package: spatie/laravel-permission
Discovered Package: spatie/laravel-query-builder
Discovered Package: spatie/laravel-sitemap
Discovered Package: tamayo/laravel-scout-elastic
Discovered Package: torann/geoip
Package manifest generated successfully.
113 packages you are using are looking for funding.
Use the `composer fund` command to find out more!


3、执行的第 1 个命令 Google\Task\Composer::cleanup 属于命令事件:pre-autoload-dump。此事件在自动加载器被转储前触发,无论是 install/update 还是 dump-autoload 命令都会触发。 4、执行的第 2、3 个命令 Illuminate\Foundation\ComposerScripts::postAutoloadDump、@php artisan package:discover –ansi 属于命令事件:post-autoload-dump。此事件在在自动加载器被转储后触发,无论是 install/update 还是 dump-autoload 命令都会触发。 5、post-root-package-install 事件在 create-project 命令期间,根包安装完成后触发。post-create-project-cmd 事件在 create-project 命令执行后触发。所以在执行命令:composer install 时未触发此 2 个事件,因此事件下所属的命令皆未执行。 6、lint、lint-fix 属于自定义的 Composer 命令。需要手动调用,例:composer lint 7、由于此项目是基于 Git 克隆至本地的,没有执行 create-project 命令。所以 create-project 命令期间触发的事件下的命令需要手动执行。如图3
由于此项目是基于 Git 克隆至本地的,没有执行 create-project 命令。所以 create-project 命令期间触发的事件下的命令需要手动执行。

图3



PS E:\wwwroot\object> php -r "file_exists('.env') || copy('.env.example', '.env');"
PS E:\wwwroot\object> php artisan key:generate --ansi
Application key set successfully.
PS E:\wwwroot\object>


]]>
https://www.shuijingwanwq.com/2022/03/08/6094/feed/ 0
chmod(): Operation not permitted,/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php https://www.shuijingwanwq.com/2022/01/14/5711/ https://www.shuijingwanwq.com/2022/01/14/5711/#respond Fri, 14 Jan 2022 01:09:52 +0000 https://www.shuijingwanwq.com/?p=5711 Post Views: 84 1、chmod(): Operation not permitted,/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php 。如图1
chmod(): Operation not permitted,/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php 。

图1



    public function replace($path, $content)
    {
        // If the path already exists and is a symlink, get the real path...
        clearstatcache(true, $path);
 
        $path = realpath($path) ?: $path;
 
        $tempPath = tempnam(dirname($path), basename($path));
 
        // Fix permissions of tempPath because `tempnam()` creates it with permissions set to 0600...
        chmod($tempPath, 0777 - umask());
 
        file_put_contents($tempPath, $content);
 
        rename($tempPath, $path);
    }


2、原因可能在于切换了 Git 分支的缘故,而并未合并代码。但是 /vender 目录是共用的。重新执行命令:composer install 后,不再报错。如图2
原因可能在于切换了 Git 分支的缘故,而并未合并代码。但是 /vender 目录是共用的。重新执行命令:composer install 后,不再报错。

图2

]]>
https://www.shuijingwanwq.com/2022/01/14/5711/feed/ 0
执行命令:composer install 时,报错:Script Google\Task\Composer::cleanup handling the pre-autoload-dump event terminated with an exception https://www.shuijingwanwq.com/2022/01/12/5700/ https://www.shuijingwanwq.com/2022/01/12/5700/#respond Wed, 12 Jan 2022 01:16:25 +0000 https://www.shuijingwanwq.com/?p=5700 Post Views: 126

1、执行命令:composer install 时,报错:Script Google\Task\Composer::cleanup handling the pre-autoload-dump event terminated with an exception。如图1

执行命令:composer install 时,报错:Script Google\Task\Composer::cleanup handling the pre-autoload-dump event terminated with an exception。

图1


/object # composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update `.
Package operations: 1 install, 0 updates, 0 removals
  - Installing google/apiclient-services (v0.226.0): Extracting archive



Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Google\Task\Composer::cleanup
Removing 209 google services
Script Google\Task\Composer::cleanup handling the pre-autoload-dump event terminated with an exception


  [Symfony\Component\Filesystem\Exception\IOException]
  Failed to remove directory "/object/vendor/google/apiclient-services/src/Assuredworkloads": rmdir(/object/vendor/google/apiclient-services/src/Assuredworkloads): Directory not empty.


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-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] [--] []...



2、查看 /vendor/google/apiclient/README.md,清理未使用的服务,有超过 200 个 Google API 服务。 很有可能你不会都想要。 为了避免在您的代码中传送这些依赖项,你可以运行 `Google\Task\Composer::cleanup` 任务并指定服务你想保留在 `composer.json` 中:


{
    "require": {
        "google/apiclient": "^2.12.1"
    },
    "scripts": {
        "pre-autoload-dump": "Google\\Task\\Composer::cleanup"
    },
    "extra": {
        "google/apiclient-services": [
            "Drive",
            "YouTube"
        ]
    }
}


3、编辑 composer.json,决定在 scripts 中,先删除掉:”pre-autoload-dump”: “Google\\Task\\Composer::cleanup” 。如图2

编辑 composer.json,决定在 scripts 中,先删除掉:"pre-autoload-dump": "Google\\Task\\Composer::cleanup" 。

图2


    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "lint": "phpcs --standard=PSR1,PSR2,./ruleset.xml --ignore=config/us-zipcode.php app/ routes/ config/ ",
        "lint-fix": "phpcbf --standard=PSR1,PSR2 --ignore=config/us-zipcode.php  app/ routes/ config/ "
    }


4、执行 composer update 时,不再报错。但是,这是在容器中执行,后来在本地 Windows 主机上执行不存在此问题。如图3

执行 composer update 时,不再报错。但是,这是在容器中执行,后来在本地 Windows 主机上执行不存在此问题。

图3

]]>
https://www.shuijingwanwq.com/2022/01/12/5700/feed/ 0
在 PhpStorm 中提示:Invalid VCS root mapping 的分析解决 https://www.shuijingwanwq.com/2020/08/11/4380/ https://www.shuijingwanwq.com/2020/08/11/4380/#respond Tue, 11 Aug 2020 02:42:06 +0000 https://www.shuijingwanwq.com/?p=4380 Post Views: 144 1、在 PhpStorm 中提示:Invalid VCS root mapping。The directory <Project>\vendor\wartron\yii2-uuid is registered as a Git root, but no Git repositories were found there。如图1
在 PhpStorm 中提示:Invalid VCS root mapping。The directory <Project>\vendor\wartron\yii2-uuid is registered as a Git root, but no Git repositories were found there。

图1

2、点击 Configure 进入配置界面。发现:vendor\wartron\yii2-uuid 标红。如图2
点击 Configure 进入配置界面。发现:vendor\wartron\yii2-uuid 标红。

图2

3、参考网址:https://www.shuijingwanwq.com/2020/05/11/4130/ 。原因在于,删除目录:E:\wwwroot\pcs-api\vendor\wartron\yii2-uuid\.git。如图3
参考网址:https://www.shuijingwanwq.com/2020/05/11/4130/ 。原因在于,删除目录:E:\wwwroot\pcs-api\vendor\wartron\yii2-uuid\.git。

图3

4、参考我应该提交 vendor 目录中的依赖包吗?:https://docs.phpcomposer.com/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.html 。 5、执行命令:composer install,提示:Nothing to install or update。


PS E:\wwwroot\channel-pub-api> composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!


6、参考第 3 点,在运行 composer update 命令前需要先删除磁盘中的依赖文件。删除目录:E:\wwwroot\pcs-api\vendor\wartron。提交至 Git。如图4
参考第 3 点,在运行 composer update 命令前需要先删除磁盘中的依赖文件。删除目录:E:\wwwroot\pcs-api\vendor\wartron。提交至 Git。

图4

7、删除目录:\vendor\wartron 后,提交至 Git。如图5
删除目录:\vendor\wartron 后,提交至 Git。

图5

8、执行命令:composer install。全新安装:wartron/yii2-uuid。如图6
执行命令:composer install。全新安装:wartron/yii2-uuid。

图6



PS E:\wwwroot\channel-pub-api> composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 1 install, 0 updates, 0 removals
  - Installing wartron/yii2-uuid (dev-master 2202443): Cloning 2202443ac7 from cache
Generating autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!


9、查看目录:E:\wwwroot\pcs-api\vendor\wartron\yii2-uuid\.git,已存在。如图7
查看目录:E:\wwwroot\pcs-api\vendor\wartron\yii2-uuid\.git,已存在。

图7

10、如果此时提交代码,会发现仅会提交空目录:\vendor\wartron ,其目录中的文件未被提交。原因在于其受到了 \vendor\wartron\yii2-uuid\.git 的影响。之前的方案是删除目录:\vendor\wartron\yii2-uuid\.git。不过,删除之后,便会出现提示:Invalid VCS root mapping。如图8
如果此时提交代码,会发现仅会提交空目录:\vendor\wartron ,其目录中的文件未被提交。原因在于其受到了 \vendor\wartron\yii2-uuid\.git 的影响。之前的方案是删除目录:\vendor\wartron\yii2-uuid\.git。不过,删除之后,便会出现提示:Invalid VCS root mapping。

图8

11、参考第 2 点。使用 –prefer-dist 或在 config 选项中设置 preferred-install 为 dist。删除目录:E:\wwwroot\pcs-api\vendor\wartron。执行命令:composer install –prefer-dist。全新安装:wartron/yii2-uuid。如图9
参考第 2 点。使用 --prefer-dist 或在 config 选项中设置 preferred-install 为 dist。删除目录:E:\wwwroot\pcs-api\vendor\wartron。执行命令:composer install --prefer-dist。全新安装:wartron/yii2-uuid。

图9



PS E:\wwwroot\channel-pub-api> composer install --prefer-dist
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 1 install, 0 updates, 0 removals
  - Installing wartron/yii2-uuid (dev-master 2202443): Downloading (100%)
Generating autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!


12、查看目录:E:\wwwroot\pcs-api\vendor\wartron\yii2-uuid\.git,已不存在。如图10
查看目录:E:\wwwroot\pcs-api\vendor\wartron\yii2-uuid\.git,已不存在。

图10

13、提交代码,会发现目录:\vendor\wartron 中的文件已被全部提交。如图11
提交代码,会发现目录:\vendor\wartron 中的文件已被全部提交。

图11

14、在 Manage projects 中删除项目。如图12
在 Manage projects 中删除项目。

图12

15、删除 phpstorm project files,即目录:.idea 。如图13
删除 phpstorm project files,即目录:.idea 。

图13

16、再次新建项目。在 PhpStorm 中已无提示:Invalid VCS root mapping。查看版本控制界面,已不存在::vendor\wartron\yii2-uuid。符合预期。如图14
再次新建项目。在 PhpStorm 中已无提示:Invalid VCS root mapping。查看版本控制界面,已不存在::vendor\wartron\yii2-uuid。符合预期。

图14

17、之前在文档中的相应说明: ( wartron\yii2uuid 每次 composer update 后,需要额外处理,以提交至 Git )。已经可以删除。如图15
之前在文档中的相应说明: ( wartron\yii2uuid 每次 composer update 后,需要额外处理,以提交至 Git )。已经可以删除。

图15

]]>
https://www.shuijingwanwq.com/2020/08/11/4380/feed/ 0
将 /vendor 加入至 Git 仓库后,Docker 部署,升级失败的分析解决 https://www.shuijingwanwq.com/2020/05/11/4130/ https://www.shuijingwanwq.com/2020/05/11/4130/#respond Mon, 11 May 2020 12:03:38 +0000 https://www.shuijingwanwq.com/?p=4130 Post Views: 221

1、编辑 .gitignore,将 /vendor 加入至 Git 仓库,如图1

编辑 .gitignore,将 /vendor 加入至 Git 仓库

图1


# composer vendor dir
# /vendor


2、在 Jenkins 中构建失败,查看 Console Output。如图2

在 Jenkins 中构建失败,查看 Console Output

图2


[0mThe command '/bin/sh -c chown -R nginx:nginx /mcloud/www/ &&     rm -rf /etc/nginx/conf.d/status.conf &&     chmod +x /usr/local/bin/composer &&     composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ &&     cd /mcloud/www/pcs-api &&     composer install' returned a non-zero code: 1
Build step 'Docker Build and Publish' marked build as failure
Finished: FAILURE


3、Docker 部署,删除 composer install。编辑 Dockerfile。如图3

Docker 部署,删除 composer install。编辑 Dockerfile。

图3


RUN chown -R nginx:nginx /mcloud/www/ && \
    rm -rf /etc/nginx/conf.d/status.conf && \
    chmod +x /usr/local/bin/composer && \
    composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ && \
    cd /mcloud/www/pcs-api && \
    composer install



RUN chown -R nginx:nginx /mcloud/www/ && \
    rm -rf /etc/nginx/conf.d/status.conf


4、在 Jenkins 中构建成功。如图4

在 Jenkins 中构建成功。

图4

5、在 Rancher 中启动失败,查看日志。如图5

在 Rancher 中启动失败,查看日志。

图5


2020/5/8 下午2:48:45
2020/5/8 下午2:48:45  ... initialization completed.
2020/5/8 下午2:48:45
2020/5/8 下午2:48:45 PCS_API_CFG_MIGRATE=true


6、编辑 build/c_files/config/init/console_init.sh。删除 $PCS_API_CFG_MIGRATE == “true” 的相关命令。如图6

编辑 build/c_files/config/init/console_init.sh。删除 $PCS_API_CFG_MIGRATE == "true" 的相关命令。

图6

7、在 Rancher 中启动成功,查看日志。如图7

在 Rancher 中启动成功,查看日志。

图7


2020/5/8 下午2:48:45
2020/5/8 下午2:48:45  ... initialization completed.
2020/5/8 下午2:48:45
2020/5/8 下午2:48:45 PCS_API_CFG_MIGRATE=true


8、进入容器,手动执行 $PCS_API_CFG_MIGRATE == “true” 的相关命令。未成功运行,因为无相应输出。如图8

进入容器,手动执行 $PCS_API_CFG_MIGRATE == "true" 的相关命令。未成功运行,因为无相应输出。

图8

9、进入将 /vendor 加入至 Git 仓库前的容器。手动执行 $PCS_API_CFG_MIGRATE == “true” 的相关命令。成功运行,因为有相应输出。如图9

进入将 /vendor 加入至 Git 仓库前的容器。手动执行 $PCS_API_CFG_MIGRATE == "true" 的相关命令。成功运行,因为有相应输出。

图9

10、在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == “true” 的相关命令。未成功运行,报错。如图10

在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == "true" 的相关命令。未成功运行,报错。

图10


PS E:\wwwroot\pcs-api-develop> ./yii migrate --migrationPath=@yii/log/migrations/ --interactive=0
PHP Warning:  require(E:\wwwroot\pcs-api-develop\vendor\composer/../codeception/verify/src/Codeception/function.php): fa
iled to open stream: No such file or directory in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php on line 6
6

Warning: require(E:\wwwroot\pcs-api-develop\vendor\composer/../codeception/verify/src/Codeception/function.php): failed
to open stream: No such file or directory in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php on line 66
PHP Fatal error:  require(): Failed opening required 'E:\wwwroot\pcs-api-develop\vendor\composer/../codeception/verify/s
rc/Codeception/function.php' (include_path='.;C:\php\pear') in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.
php on line 66

Fatal error: require(): Failed opening required 'E:\wwwroot\pcs-api-develop\vendor\composer/../codeception/verify/src/Co
deception/function.php' (include_path='.;C:\php\pear') in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php o
n line 66


11、文件 E:\wwwroot\pcs-api-develop\vendor\composer/../codeception/verify/src/Codeception/function.php 不存在,如图11

文件 E:\wwwroot\pcs-api-develop\vendor\composer/../codeception/verify/src/Codeception/function.php 不存在

图11

12、进入将 /vendor 加入至 Git 仓库前的容器。文件 \vendor\composer/../codeception/verify/src/Codeception/function.php 存在。如图12

进入将 /vendor 加入至 Git 仓库前的容器。文件 \vendor\composer/../codeception/verify/src/Codeception/function.php 存在。

图12

13、查看 E:\wwwroot\pcs-api\vendor\codeception\verify,其目录下存在相应的文件。且 Git 显示是已经提交至仓库。如图13

查看 E:\wwwroot\pcs-api\vendor\codeception\verify,其目录下存在相应的文件。且 Git 显示是已经提交至仓库。

图13

14、进入将 /vendor 加入至 Git 仓库前的本地环境。发现 \vendor\codeception\verify 已经存在于 Git 中。只不过是 master 分支。如图14

进入将 /vendor 加入至 Git 仓库前的本地环境。发现 \vendor\codeception\verify 已经存在于 Git 中。只不过是 master 分支。

图14

15、最终决定切换至 master 分支,合并 develop 分支的代码。再推送至远程的 master 分支。在远程仓库中文件:\vendor\composer/../codeception/verify/src/Codeception/function.php 仍然不存在。如图15

最终决定切换至 master 分支,合并 develop 分支的代码。再推送至远程的 master 分支。在远程仓库中文件:\vendor\composer/../codeception/verify/src/Codeception/function.php 仍然不存在。

图15

16、删除目录:E:\wwwroot\pcs-api\vendor\codeception\verify\.git,将未显示已经提交至仓库的文件,添加至仓库。如图16、17

删除目录:E:\wwwroot\pcs-api\vendor\codeception\verify\.git,将未显示已经提交至仓库的文件,添加至仓库。

图16

 

删除目录:E:\wwwroot\pcs-api\vendor\codeception\verify\.git,将未显示已经提交至仓库的文件,添加至仓库。

图17

17、在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == “true” 的相关命令。未成功运行,报错,但是 /codeception/verify 相应的错误已经得到解决。参考步骤 16 同样处理。后续在运行命令的过程中报错的类似问题,皆可以如此处理。


PS E:\wwwroot\pcs-api-develop> ./yii migrate --migrationPath=@yii/log/migrations/ --interactive=0
PHP Warning:  require(E:\wwwroot\pcs-api-develop\vendor\composer/../myclabs/deep-copy/src/DeepCopy/deep_copy.php): faile
d to open stream: No such file or directory in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php on line 66

Warning: require(E:\wwwroot\pcs-api-develop\vendor\composer/../myclabs/deep-copy/src/DeepCopy/deep_copy.php): failed to
open stream: No such file or directory in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php on line 66
PHP Fatal error:  require(): Failed opening required 'E:\wwwroot\pcs-api-develop\vendor\composer/../myclabs/deep-copy/sr
c/DeepCopy/deep_copy.php' (include_path='.;C:\php\pear') in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php
 on line 66

Fatal error: require(): Failed opening required 'E:\wwwroot\pcs-api-develop\vendor\composer/../myclabs/deep-copy/src/Dee
pCopy/deep_copy.php' (include_path='.;C:\php\pear') in E:\wwwroot\pcs-api-develop\vendor\composer\autoload_real.php on l
ine 66


18、在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == “true” 的相关命令。成功运行。如图18

在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == "true" 的相关命令。成功运行。

图18

19、进入将 /vendor 加入至 Git 仓库前的本地环境。执行命令:composer install。成功运行。如图19

进入将 /vendor 加入至 Git 仓库前的本地环境。执行命令:composer install。成功运行。

图19


PS E:\wwwroot\pcs-api-feature-plan-tonglian> composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files


20、在本地环境中全新部署,执行命令:composer install。未成功运行。如图20

在本地环境中全新部署,执行命令:composer install。未成功运行。

图20


PS E:\wwwroot\pcs-api-develop> composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files


  [RuntimeException]
  Could not scan for classes inside "E:\wwwroot\pcs-api-develop\vendor/sebastian/object-enumerator/src/" which does n
  ot appear to be a file nor a folder


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--n
o-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative]
 [--apcu-autoloader] [--ignore-platform-reqs] [--] []...



21、实际上,第 16、17 步骤,可以通过执行命令:composer require codeception/verify myclabs/deep-copy 来解决,而无需一定要将这 2 个包提交至 Git 仓库中。不过,即使采用此方案,仍然会存在第 20 步骤中所存在的问题。而且还会改变 /vendor/composer 中的其他文件。此方案不太可取。如图21

实际上,第 16、17 步骤,可以通过执行命令:composer require codeception/verify myclabs/deep-copy 来解决,而无需一定要将这 2 个包提交至 Git 仓库中。不过,即使采用此方案,仍然会存在第 20 步骤中所存在的问题。而且还会改变 /vendor/composer 中的其他文件。此方案不太可取。

图21

22、最终决定,先删除掉 /vendor ,提交至 Git 仓库,执行命令:composer install –no-dev。–no-dev:跳过 require-dev 字段中列出的包。再将 /vendor 提交至 Git 仓库。因为,已经确定,–dev:安装 require-dev 字段中列出的包 ( 这是一个默认值 )。提交至 Git 仓库仅能够提交空目录。如图22

最终决定,先删除掉 /vendor ,提交至 Git 仓库,执行命令:composer install --no-dev。--no-dev:跳过 require-dev 字段中列出的包。再将 /vendor 提交至 Git 仓库。因为,已经确定,--dev:安装 require-dev 字段中列出的包 ( 这是一个默认值 )。提交至 Git 仓库仅能够提交空目录。

图22

23、执行命令:composer install。安装 require-dev 字段中列出的包。再将 /vendor 提交至 Git 仓库。如图23

执行命令:composer install。安装 require-dev 字段中列出的包。再将 /vendor 提交至 Git 仓库。

图23

24、在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == “true” 的相关命令。成功运行。不符合预期。如图24

在本地环境中全新部署,手动执行 $PCS_API_CFG_MIGRATE == "true" 的相关命令。成功运行。不符合预期。

图24

25、查看全新部署的文件,目录:\codeception\verify、\vendor\myclabs\deep-copy 皆存在。如图25

查看全新部署的文件,目录:\codeception\verify、\vendor\myclabs\deep-copy 皆存在。

图25

26、在 /vendor 目录中搜索:.git,不存在相应的目录。而之前执行命令:composer install。未成功运行。在 /vendor 目录中搜索:.git,存在相应的目录。如图26

在 /vendor 目录中搜索:.git,不存在相应的目录。而之前执行命令:composer install。未成功运行。在 /vendor 目录中搜索:.git,存在相应的目录。

图26

27、编辑 build/c_files/config/init/console_init.sh。恢复 $PCS_API_CFG_MIGRATE == “true” 的相关命令。在 Rancher 中启动成功,查看日志。如图27

编辑 build/c_files/config/init/console_init.sh。恢复 $PCS_API_CFG_MIGRATE == "true" 的相关命令。在 Rancher 中启动成功,查看日志。

图27

28、在另一个产品中,在 /vendor 目录中搜索:.git,存在相应的目录。如图28

在另一个产品中,在 /vendor 目录中搜索:.git,存在相应的目录。

图28

29、在 Rancher 中启动失败,查看日志。如图29

在 Rancher 中启动失败,查看日志。

图29


2020/5/9 下午7:01:07 PHP Fatal Error 'yii\base\ErrorException' with message 'Class 'wartron\yii2uuid\behaviors\UUIDBehavior' not found'
2020/5/9 下午7:01:07
2020/5/9 下午7:01:07 in /mcloud/www/channel-pub-api/common/behaviors/UUIDBehavior.php:7
2020/5/9 下午7:01:07
2020/5/9 下午7:01:07 Stack trace:
2020/5/9 下午7:01:07 #0 [internal function]: yii\base\ErrorHandler->handleFatalError()
2020/5/9 下午7:01:07 #1 {main}


30、由于仅有一个目录:.git,决定采用第 16、17 步骤的方案。在 Rancher 中启动成功,查看日志。如图30

由于仅有一个目录:.git,决定采用第 16、17 步骤的方案。在 Rancher 中启动成功,查看日志。

图30

31、在 Jenkins 中构建时间的前后对比,分别为:13分钟、43秒。如图31

在 Jenkins 中构建时间的前后对比,分别为:13分钟、43秒。

图31

]]>
https://www.shuijingwanwq.com/2020/05/11/4130/feed/ 0