composer install * file_put_contents * 无法打开流
composer install * file_put_contents * failed to open stream
我在 Bit-bucket 存储库上有一个 Drupal 项目。
所以目录中有一个piplines.yml,如下所示
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.3.10
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip libfreetype6-dev libjpeg62-turbo-dev git
- docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
- docker-php-ext-install -j$(nproc) gd
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- cd docroot
- composer install
- vendor/bin/phpcs --config-set installed_paths vendor/drupal/coder/coder_sniffer
- vendor/bin/phpcs -i
- vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md --ignore=node_modules,bower_components,vendor modules/custom
- vendor/bin/phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md --ignore=node_modules,bower_components,vendor modules/custom
问题出现在 composer 安装部分,显示此错误
根据https://github.com/Chi-teck/drupal-code-generator
dcg 你的错误指的是一个你需要在你的项目中首先拥有的可执行文件
请确保在 运行 安装之前将其安装在您的文档根目录中,或者确保它是 composer.json 和 composer.lock
的依赖项的一部分
编辑:经过深入调查后发现 dcg 在 docroot/vendor 目录中被跟踪(因为它没有被 gitignored)并作为 link 提交到 cygwin dcg.bat 文件。这在 php7.3 docker 图像上不起作用,这导致了所有的麻烦。
删除跟踪的供应商文件夹并将 docroot/vendor
添加到 gitignore 解决了这个问题。
我在 Bit-bucket 存储库上有一个 Drupal 项目。
所以目录中有一个piplines.yml,如下所示
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.3.10
pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip libfreetype6-dev libjpeg62-turbo-dev git
- docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
- docker-php-ext-install -j$(nproc) gd
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- cd docroot
- composer install
- vendor/bin/phpcs --config-set installed_paths vendor/drupal/coder/coder_sniffer
- vendor/bin/phpcs -i
- vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md --ignore=node_modules,bower_components,vendor modules/custom
- vendor/bin/phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md --ignore=node_modules,bower_components,vendor modules/custom
问题出现在 composer 安装部分,显示此错误
根据https://github.com/Chi-teck/drupal-code-generator dcg 你的错误指的是一个你需要在你的项目中首先拥有的可执行文件 请确保在 运行 安装之前将其安装在您的文档根目录中,或者确保它是 composer.json 和 composer.lock
的依赖项的一部分编辑:经过深入调查后发现 dcg 在 docroot/vendor 目录中被跟踪(因为它没有被 gitignored)并作为 link 提交到 cygwin dcg.bat 文件。这在 php7.3 docker 图像上不起作用,这导致了所有的麻烦。
删除跟踪的供应商文件夹并将 docroot/vendor
添加到 gitignore 解决了这个问题。