Composer : how to add a dependency without network connection?

前端 未结 2 1089
广开言路
广开言路 2021-01-03 00:07

My profesionnal network block internet access. Some month ago I download the Silex framework from an archive (which contains composer.json file) and the composer.phar one\'s

2条回答
  •  情歌与酒
    2021-01-03 00:38

    If you do not want to create a custom repository, you can also run composer install (or composer update) on a copy that is on a network-connected computer. Then you can copy over the newly added and extracted component into the vendor folder on the machine without internet access. Note that you also need to copy vendor/composer/installed.json to let composer know that the new package has been installed. Once you have copied all these files, you can run composer install on the machine without internet access and it will not try to install anything and dump autoload files.

提交回复
热议问题