-
-
Save KEINOS/6ac96cbce47a5684a6ff06fdc77b1dbc to your computer and use it in GitHub Desktop.
逆引き!Composer コマンド・ライン一覧 と 基礎知識 ref: https://qiita.com/KEINOS/items/86a16b06af6e936a1841
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config bin-dir bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer --version | |
Composer version 1.9.3 2020-02-04 12:58:49 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ COMPOSER=composer-other.json composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMPOSER=composer-other.json composer require phpunit/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bin": ["bin/my-script", "bin/my-other-script"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"minimum-stability": "dev" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"minimum-stability": "stable" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require-dev": { | |
"phpbench/phpbench": "@dev" | |
}, | |
"scripts" :{ | |
"bench": [ | |
"Composer\\Config::disableProcessTimeout", | |
"./vendor/bin/phpbench run --revs=1000000 --iterations=10 --retry-threshold=1 --report=compare --report=aggregate ./bench/HashSampleBench.php" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config platform.php 5.3.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"post-create-project-cmd": [ | |
"php 'config/rename_namespace.php'" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # コマンド・ラインで追記する例 | |
$ composer require [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # コマンド・ラインで追記する例 | |
$ composer require [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer run-script [script name] [args] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec [script name] [args] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer search [package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require [vendor/package1] [vendor/package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require ****/**** | |
[InvalidArgumentException] | |
Could not find a matching version of package ****/****. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require ****/**** | |
... | |
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos | |
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+docker-desktop+2020-06-27+1405 | |
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. | |
Token (hidden): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require ****/**** | |
[InvalidArgumentException] | |
Could not find a matching version of package ****/****. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor/package1] [vendor/package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require ****/**** | |
... | |
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos | |
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+docker-desktop+2020-06-27+1405 | |
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. | |
Token (hidden): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer diagnose | |
Checking composer.json: OK | |
Checking platform settings: OK | |
Checking git settings: OK | |
Checking http connectivity to packagist: OK | |
Checking https connectivity to packagist: OK | |
Checking github.com rate limit: OK | |
Checking disk free space: OK | |
Checking pubkeys: FAIL | |
Missing pubkey for tags verification ⇦ ここ | |
Missing pubkey for dev verification ⇦ ここ | |
Run composer self-update --update-keys to set them up | |
Checking composer version: OK | |
Composer version: 1.10.8 | |
PHP version: 7.4.7 | |
PHP binary path: /usr/local/bin/php | |
OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019 | |
$ echo $? | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require ****/**** | |
... | |
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos | |
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+docker-desktop+2020-06-27+1405 | |
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. | |
Token (hidden): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer diagnose | |
Checking composer.json: OK | |
Checking platform settings: OK | |
Checking git settings: OK | |
Checking http connectivity to packagist: OK | |
Checking https connectivity to packagist: OK | |
Checking github.com rate limit: OK | |
Checking disk free space: OK | |
Checking pubkeys: FAIL | |
Missing pubkey for tags verification ⇦ ここ | |
Missing pubkey for dev verification ⇦ ここ | |
Run composer self-update --update-keys to set them up | |
Checking composer version: OK | |
Composer version: 1.10.8 | |
PHP version: 7.4.7 | |
PHP binary path: /usr/local/bin/php | |
OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019 | |
$ echo $? | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require vendor/package1:1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require vendor/package1:1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require-dev [vendor/package1] [vendor/package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer init --repository '{"type":"vcs","url":"https://github.com/[YOUR]/[REPO]"}' --require [vendor]/[package]:dev-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer create-project [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose create-project [vendor]/[project] [target-directory] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require [vendor/package1] [vendor/package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require [vendor/package1] [vendor/package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update [vendor]/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer outdated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show -lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer global require "[vendor]/[package]=[version]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install --ignore-platform-reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer dump-autoload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer dump-autoload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install --ignore-platform-reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer dump-autoload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./composer.phar --version | |
$ php ./composer.phar --version | |
$ php /path/to/downloaded/composer.phar --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require vendor/package1:1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package]:dev-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config repositories.github.com vcs https://github.com/[YOUR]/[REPO] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http_proxy=[URL Proxy] composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package]:dev-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config repositories.github.com vcs https://github.com/[YOUR]/[REPO] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update --dry-run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config repositories.github.com '{"type": "vcs", "url": "https://github.com/[YOUR]/[REPO]", "//url": "https://github.com/[YOUR]/[REPO].git"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer update [vendor]/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer outdated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show -lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package1] [vendor]/[package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # composer.phar があるか確認 | |
$ ls ./ | |
composer.phar | |
$ # PHP 本体(ランタイム)の保存先ディレクトリを確認 | |
$ dirname $(which php) | |
$ # PHP と同じディレクトリに拡張子なしで移動し、実行権限を与える | |
$ mv ./composer.phar $(dirname $(which php))/composer && chmod +x $_ | |
$ # 動作確認 | |
$ composer --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # カレント・ディレクトリに composer.phar があるか確認 | |
$ ls ./ | |
composer.phar | |
$ # PHP 本体(ランタイム)の保存先ディレクトリを確認 | |
$ dirname $(which php) | |
/usr/bin/php | |
$ # PHP と同じディレクトリに拡張子なしで移動し、実行権限を与える | |
$ mv ./composer.phar $(dirname $(which php))/composer && chmod +x "$_" | |
$ # 動作確認 | |
$ composer --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update --stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer clear-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update --preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer dump-autoload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update -r | |
$ composer self-update --rollback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer dump-autoload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config --unset [setting-key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update --update-keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require --dev [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package]:dev-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require vendor/package1:1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # "||" 区切りで指定する | |
$ composer require phpunit/phpunit:^5.0||^4.0||^3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer check-platform-reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package]:dev-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # "||" 区切りで指定する | |
$ composer require phpunit/phpunit:^5.0||^4.0||^3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config repositories.github.com vcs https://github.com/[YOUR]/[REPO] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config repositories.github.com '{"type": "vcs", "url": "https://github.com/[YOUR]/[REPO]", "//url": "https://github.com/[YOUR]/[REPO].git"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show -lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package1] [vendor]/[package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"config": { | |
"bin-dir": "bin/" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer remove [vendor]/[package1] [vendor]/[package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer clear-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer create-project [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config [options] [setting-key] [setting-value1] ... [setting-valueN] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config bin-dir phar/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config repositories.[ID] vcs https://qithub.com/[foo]/[bar] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config --unset [setting-key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer prohibits [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config sort-packages true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 検証バージョン | |
$ composer --version | |
Composer version 1.9.0 2019-08-02 20:55:32 | |
$ # 作業ディレクトリの作成と移動 | |
$ mkdir hello-world && cd $_ | |
$ # composer の動作確認 | |
$ composer diagnose | |
... | |
$ # パッケージの初期化 | |
$ composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
$ # 依存パッケージのインストール | |
$ composer install | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Package operations: 1 install, 0 updates, 0 removals | |
- Installing rivsen/hello-world (dev-master 82d892b): Cloning 82d892b200 from cache | |
Writing lock file | |
Generating autoload files | |
$ # ディレクトリ構造の確認 | |
$ tree | |
. | |
├── composer.json | |
├── composer.lock | |
└── vendor | |
├── autoload.php | |
├── composer | |
│ ├── ClassLoader.php | |
│ ├── LICENSE | |
│ ├── autoload_classmap.php | |
│ ├── autoload_namespaces.php | |
│ ├── autoload_psr4.php | |
│ ├── autoload_real.php | |
│ ├── autoload_static.php | |
│ └── installed.json | |
└── rivsen | |
└── hello-world | |
├── composer.json | |
├── readme.md | |
├── src | |
│ └── Hello.php | |
└── test.php | |
5 directories, 15 files | |
$ # プログラムのファイルを作成 | |
$ touch hello-world.php | |
$ # プログラムを記載(好きなエディタで。以下は vim ) | |
$ vi hello-world.php | |
... | |
$ # プログラムの内容 | |
$ cat hello-world.php | |
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
$ # プログラムの実行 | |
$ php hello-world.php | |
Hello World! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ compose diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer run-script [script name] [args] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec [script name] [args] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer search [package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show -i | |
$ composer show --installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer help [command] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init --require [vendor/package1] [vendor/package2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:cli-alpine | |
# Install composer | |
RUN \ | |
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"; \ | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"; \ | |
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"; \ | |
[ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] && { >&2 echo 'ERROR: Invalid installer signature'; exit 1; }; \ | |
php composer-setup.php --quiet --install-dir=/bin --filename=composer && \ | |
composer --version && \ | |
rm composer-setup.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer check-platform-reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer check-platform-reqs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show [vendor]/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer outdated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer show -lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer browse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer suggests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer depends [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer why [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer depends [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer why [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer prohibits [vendor]/[package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer licenses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec --list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer exec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global config bin-dir --absolute | |
Changed current directory to /root/.composer | |
/root/.composer/vendor/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @BeforeMethods({"init"}) | |
*/ | |
class HashSampleBench | |
{ | |
public function init() | |
{ | |
// ダミーデータの作成 | |
$this->dummy = strval(\mt_rand()); | |
} | |
public function benchHashMd5() | |
{ | |
$val = hash('md5', $this->dummy); | |
} | |
public function benchHashSha256() | |
{ | |
$val = hash('sha256', $this->dummy); | |
} | |
public function benchHashSha512() | |
{ | |
$val = hash('sha512', $this->dummy); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config vendor-dir hoge | |
$ # 以下の要素が composer.json に追加されます | |
$ # "config": { | |
$ # "vendor-dir": "vendor_dev" | |
$ # } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ COMPOSER_VENDOR_DIR=hoge composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer licenses --format=json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts" :{ | |
"mytest": [ | |
"php --version", | |
"composer --version", | |
"php vendor/squizlabs/php_codesniffer/scripts/phpcs", | |
"php vendor/phpunit/phpunit/phpunit" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer global require "squizlabs/php_codesniffer=*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer prohibits php:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"test": [ | |
"Composer\\Config::disableProcessTimeout", | |
"phpunit" | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php ./composer.phar --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./composer.phar --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer archive [vendor]/[package] [version] --format=tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package]:1.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer self-update 1.0.0-alpha7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require [vendor]/[package]:2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer archive [vendor]/[package] [version] --format=zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config bin-dir bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it -v $(pwd):/app composer:1.4.2 /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require ****/**** | |
[RuntimeException] | |
No composer.json present in the current directory, this may be the cause of the following exception. | |
[InvalidArgumentException] | |
Could not find a version of package ****/**** matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability. | |
require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer global show -i | |
$ composer global show --installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # 文法 | |
$ # composer require [vendor]/[package] | |
$ # 使用例 | |
$ composer require symfony/console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | |
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | |
then | |
>&2 echo 'ERROR: Invalid installer signature' | |
rm composer-setup.php | |
exit 1 | |
fi | |
php composer-setup.php --quiet --install-dir=/bin --filename=composer | |
RESULT=$? | |
rm composer-setup.php | |
exit $RESULT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer search -N [package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./composer.phar --version | |
$ php ./composer.phar --version | |
$ php /path/to/downloaded/composer.phar --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ COMPOSER_BIN_DIR=fuga composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer require phpbench/phpbench @dev --dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rivsen/hello-world を依存パッケージとして指定 | |
composer init --quiet --name sample/hello-world --require rivsen/hello-world:dev-master | |
composer install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # composer require [vendor]/[package] | |
$ composer require keinos/project_x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer install --no-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer require --dev phpunit/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
composer require symfony/console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer config process-timeout 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "vendor/autoload.php"; | |
$hello = new Rivsen\Demo\Hello(); | |
echo $hello->hello(), PHP_EOL; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer search --only-name [package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"config": { | |
"process-timeout": 0 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer bench | |
> Composer\Config::disableProcessTimeout | |
> ./vendor/bin/phpbench run --retry-threshold=1 --revs=1000000 --iterations=10 --report=compare --report=aggregate ./bench/HashSampleBench.php | |
PhpBench @git_tag@. Running benchmarks. | |
\HashSampleBench | |
benchHashMd5............................R1 I1 [μ Mo]/r: 0.373 0.373 (μs) [μSD μRSD]/r: 0.002μs 0.42% | |
benchHashSha256.........................R2 I9 [μ Mo]/r: 0.676 0.675 (μs) [μSD μRSD]/r: 0.003μs 0.49% | |
benchHashSha512.........................R1 I0 [μ Mo]/r: 0.860 0.862 (μs) [μSD μRSD]/r: 0.004μs 0.41% | |
3 subjects, 30 iterations, 3,000,000 revs, 0 rejects, 0 failures, 0 warnings | |
(best [mean mode] worst) = 0.372 [0.636 0.637] 0.377 (μs) | |
⅀T: 19.092μs μSD/r 0.003μs μRSD/r: 0.439% | |
+-----------------+-----------------+-----+---------+-----------------------------------------------------+ | |
| benchmark | subject | set | revs | suite:1343c44d5a2a719c55bde25711d577d5ecbe8468:mean | | |
+-----------------+-----------------+-----+---------+-----------------------------------------------------+ | |
| HashSampleBench | benchHashMd5 | 0 | 1000000 | 0.373μs | | |
| HashSampleBench | benchHashSha256 | 0 | 1000000 | 0.676μs | | |
| HashSampleBench | benchHashSha512 | 0 | 1000000 | 0.860μs | | |
+-----------------+-----------------+-----+---------+-----------------------------------------------------+ | |
suite: 1343c44d5a2a719c55bde25711d577d5ecbe8468, date: 2020-05-16, stime: 06:22:00 | |
+-----------------+-----------------+-----+---------+-----+----------+---------+---------+---------+---------+---------+--------+-------+ | |
| benchmark | subject | set | revs | its | mem_peak | best | mean | mode | worst | stdev | rstdev | diff | | |
+-----------------+-----------------+-----+---------+-----+----------+---------+---------+---------+---------+---------+--------+-------+ | |
| HashSampleBench | benchHashMd5 | 0 | 1000000 | 10 | 420,768b | 0.372μs | 0.373μs | 0.373μs | 0.377μs | 0.002μs | 0.42% | 1.00x | | |
| HashSampleBench | benchHashSha256 | 0 | 1000000 | 10 | 420,768b | 0.672μs | 0.676μs | 0.675μs | 0.683μs | 0.003μs | 0.49% | 1.81x | | |
| HashSampleBench | benchHashSha512 | 0 | 1000000 | 10 | 420,768b | 0.854μs | 0.860μs | 0.862μs | 0.864μs | 0.004μs | 0.41% | 2.30x | | |
+-----------------+-----------------+-----+---------+-----+----------+---------+---------+---------+---------+---------+--------+-------+ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it --network host -v $(pwd):/app composer:1.4.2 /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # global なし → ./vendor/ 下にインストールされます | |
$ composer require keinos/project_x | |
$ # global あり → ~/.composer/vendor/ 下にインストールされます | |
$ composer global require keinos/project_x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment