Composer(PHP依赖管理工具)安装

来源:互联网 发布:中国软件测评中心待遇 编辑:程序博客网 时间:2024/05/01 11:23

http://docs.phpcomposer.com/00-intro.md#Installation-*nix

切换到项目目录。增加文件:[root@localhost html]# vi composer.json{    "require": {        "monolog/monolog": "1.0.*"    }}由于composer是安装在/root下的,所以在项目下,我们这样执行:[root@localhost html]# php /root/composer.phar installLoading composer repositories with package informationInstalling dependencies (including require-dev)  - Installing monolog/monolog (1.0.2)    Loading from cacheWriting lock fileGenerating autoload files项目文件a.php中可以增加这行语句,进行自动加载composer下载的包类:[root@localhost html]# vi /var/www/html/a.php <?phprequire 'vendor/autoload.php';





0 0