root@hony:~# curl -sS http://install.phpcomposer.com/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...php
Composer successfully installed to: /root/composer.phar
Use it: php composer.phar
root@hony:~# ls
1.php composer-setup.php py wrk-master
composer.phar lamp.zip sh-1.5.5 wrk-master.zipapache
全局安裝json
root@hony:~# mv composer.phar /usr/local/bin/composerapp
root@hony:~/framework# composer
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.0-dev (cd21505c8d58499a9b4d38573881cfec49c51ffd) 2016-01-27 13:04:22composer
Usage:
command [options] [arguments]curl
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debugide
Available commands:
about Short information about Composer
archive Create an archive of this composer package
browse Opens the package's repository URL or homepage in your browser.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Set config options
create-project Create new project from a package into given directory.
depends Shows which packages depend on the given package
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader
dumpautoload Dumps the autoloader
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
info Show information about packages
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Show information about licenses of dependencies
list Lists commands
remove Removes a package from the require or require-dev
require Adds required packages to your composer.json and installs them
run-script Run the scripts defined in composer.json.
search Search for packages
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Show information about packages
status Show a list of locally modified packages
suggests Show package suggestions
update Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lockui
執行composer init 進行初始化composer.json文件this
root@hony:~/framework# composer init
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.url
Welcome to the Composer config generator
This command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [root/framework]: xsj/framework
Description []: this is a test frameset
Author []: hanyong
Invalid author string. Must be in the format: John Smith <john@example.com>
Author []: hanyong <hyrxb@163.com>
Minimum Stability []: dev
Package Type []: a
License []: apache
Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]?
Search for a package:
Would you like to define your dev dependencies (require-dev) interactively [yes]?
Search for a package:
{
"name": "xsj/framework",
"description": "this is a test frameset",
"type": "a",
"license": "apache",
"authors": [
{
"name": "hanyong",
"email": "hyrxb@163.com"
}
],
"minimum-stability": "dev",
"require": {}
}
Do you confirm generation [yes]? yes root@hony:~/framework# ls composer.json root@hony:~/framework# cat composer.json { "name": "xsj/framework", "description": "this is a test frameset", "type": "a", "license": "apache", "authors": [ { "name": "hanyong", "email": "hyrxb@163.com" } ], "minimum-stability": "dev", "require": {} }