search
Homephp教程php手册关于Composer好久不动手了。。。

  六月第一“血”

 

看书,发现喜欢从尾开始读起,然后 php经典实例 中,最后一章是PEAR内容,知乎上一查,完,过时了,完全都是Composer,那就学一下吧

 

一、啥东西

一句话:依赖管理工具;

解释:方便你下载库啊包啊什么的,基本专属于php;

http://baike.baidu.com/link?url=Ql801yyOyi3P-8KVDTNst2eg2nq797pJQBrTB8GFZ6ga2gc68LKhIewpOk_D8BrrnACIM83yH6oxrXlNGVWJ8a

另外,什么事依赖管理,就是个名字,但似乎有点深刻含义:看这个http://www.infoq.com/cn/news/2011/05/ci-dependency-management/#anch68966

二、安装

http://www.phpcomposer.com/

根据这里面,安装自己的系统去搞就好了,需要知道的就是这东西是在命令行实现的;

我的wamp,直接有.exe,然后装完找到composer.phar文件备用

三、使用

推荐看imooc上的一个yii框架的工具篇中的介绍:http://www.imooc.com/learn/520

关键点就是如何使用:cd到项目文件/创建项目所在文件夹,然后.phar文件路径/composer.phar install yiisoft/yii 1.0.2

其他深入的要自己研究。

常见几个情况:需要安装jquery的包时出现的问题,到响应的包下载页面找支持:比如yii2的

另外,需要github的api的token时,就去github上面生成一个,copy过来一次即可;

另外,每次的中断都会造成文件传输的失败,再次执行命令之前,请删除刚才的文件;

另外,最好先匹配好中文镜像,提个速,不然外网,你懂的。。。具体的话packagist中文网都有:http://www.phpcomposer.com/

配置在这里,一条命令搞定,就喜欢这种酸爽:http://pkg.phpcomposer.com/

composer config -g repo.packagist composer https://packagist.phpcomposer.com

 最后上个过程截图:

 

 

 

以上,不过最近真的是太也懒惰。。。

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools