Composer

依存関係マネージャ

目次一覧

 状態:-  閲覧数:1,801  投稿日:2016-11-20  更新日:2019-05-13  
Composer経由でインストール / Composer経由でインストールした後の使い方 / Composer経由でインストールした後、後日現状確認

composer 更新(アップデート)

Composer経由でインストール / Composer経由でインストールした後の使い方 / Composer経由でインストールした後、後日現状確認

 閲覧数:361 投稿日:2019-05-13 更新日:2019-05-13 

Composer経由でインストール


phpmailer
$ sudo mkdir -p /var/www/html/lib/composer
$ sudo chown -R ★★:★★ /var/www/html/lib/composer
$ composer require phpmailer/phpmailer
Using version ^6.0 for phpmailer/phpmailer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
 - Installing phpmailer/phpmailer (v6.0.7): Loading from cache
phpmailer/phpmailer suggests installing psr/log (For optional PSR-3 debug logging)
phpmailer/phpmailer suggests installing league/oauth2-google (Needed for Google XOAUTH2 authentication)
phpmailer/phpmailer suggests installing hayageek/oauth2-yahoo (Needed for Yahoo XOAUTH2 authentication)
phpmailer/phpmailer suggests installing stevenmaguire/oauth2-microsoft (Needed for Microsoft XOAUTH2 authentication)
phpmailer/phpmailer suggests installing symfony/polyfill-mbstring (To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2))
Writing lock file
Generating autoload files


Composer経由でインストールした後の使い方


require
・「vendorディレクトリに作成されるautoload.php」に対して指定

use
・namespaceを登録

上記指定を行うと
・自動的に必要なファイルをrequireしてくれる

Composer経由でインストールした後、後日現状確認


composer でインストール済みのパッケージ情報を確認する
・廃止予定のオプション "installed"を使用
$ composer show -i
You are using the deprecated option "installed". Only installed packages are shown by default now. The --all option can be used to show all packages.
matthiasmullie/minify         1.3.59 CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, c...
matthiasmullie/path-converter 1.1.1  Relative path converter


・インストール済みのパッケージのみがデフォルトで表示されるようになった
$ composer show
matthiasmullie/minify         1.3.59 CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, c...
matthiasmullie/path-converter 1.1.1  Relative path converter


composer でグローバール・インストール済みのパッケージ情報を確認する
$ composer global show
Changed current directory to /home/★★/.config/composer
guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client library
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.5.2 PSR-7 message implementation that also provides common utility methods
laravel/installer v2.1.0 Laravel application installer.
psr/http-message 1.0.1 Common interface for HTTP messages
ralouphie/getallheaders 2.0.5 A polyfill for getallheaders.
symfony/console v4.2.7 Symfony Console Component
symfony/contracts v1.0.2 A set of abstractions extracted out of the Symfony components
symfony/filesystem v4.2.7 Symfony Filesystem Component
symfony/polyfill-ctype v1.11.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.11.0 Symfony polyfill for the Mbstring extension
symfony/process v4.2.7 Symfony Process Component


composer 更新(アップデート)

 閲覧数:292 投稿日:2019-05-13 更新日:2019-05-13 

composer 更新(アップデート)


アップデートの事前動作確認
・「composer.json に記載されているパッケージや依存をすべて最新にする」前に挙動を確認する
$ composer update --dry-run
・matthiasmullie/path-converter (1.1.1) が (1.1.2)へアップデートされることが分かる
・matthiasmullie/minify (1.3.59)が (1.3.61)へアップデートされることが分かる
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
 - Updating matthiasmullie/path-converter (1.1.1) to matthiasmullie/path-converter (1.1.2)
 - Updating matthiasmullie/minify (1.3.59) to matthiasmullie/minify (1.3.61)


アップデート実行
・composer.json に記載されているパッケージや依存をすべて最新にする
$ composer update
・matthiasmullie/path-converter (1.1.1) が (1.1.2)へアップデートされた
・matthiasmullie/minify (1.3.59)が (1.3.61)へアップデートされた
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
 - Updating matthiasmullie/path-converter (1.1.1 => 1.1.2): Downloading (100%)        
 - Updating matthiasmullie/minify (1.3.59 => 1.3.61): Downloading (100%)        
Writing lock file
Generating autoload files


Twitter検索結果。「Composer 」に関する最新ツイート

Mint(ミント) @jr_mincham
吟川 鈴音 @Junior_Composer
小田実結子 Miyuko Oda @composer_miyuko
字余アクセル @ac_zamr
しゅれしす@金冠周回終わった @SchroSis
おぎ@にわかPHPer🐘 @ogi_chotdake_se
しゅれしす@金冠周回終わった @SchroSis
小田実結子 Miyuko Oda @composer_miyuko
ロキ(ボカロP) @Loki_Composer
フカ@ "現実病"リリース! @FUKA_composer

PECL

コメント投稿(ログインが必要)



類似度ページランキング
順位 ページタイトル抜粋
1 Propel 53
2 syntax error 48
3 parse_url( ) 48
4 popen 43
5 Generators 42
6 preg_match 42
7 Cookie 40
8 foreach文 35
9 ob_start 35
10 Doctrine 35
11 realpath 35
12 spliceImageメソッド 33
13 array_map 33
14 session_start() 33
15 register_globals 32
16 var_dump() 32
17 ErrorExceptionクラス 31
18 SHA-1(Secure Hash Algorithm 1) 31
19 set_error_handler 31
20 session_destroy関数 31
2023/6/02 5:20 更新
週間人気ページランキング / 5-26 → 6-1
順位 ページタイトル抜粋 アクセス数
1 ブラウザを閉じたらセッションデータはどうなるの? | セッション 30
2 Parse error: syntax error, unexpected 'public' (T_PUBLIC) | Parse error(エラーメッセージ) 13
3 PHP用語 12
3 Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): failed to open stream: Permission denied in | Fatal error(エラーメッセージ) 12
4 スコープ | 変数 11
5 Fatal error: Access level to ▲::$△ must be protected (as in class ●) or weaker | Fatal error(エラーメッセージ) 10
5 ブラウザを閉じたらセッションデータはどうなるの? | セッション 10
6 Fatal error: require_once(): Failed opening required 'PEAR.php' | Fatal error(エラーメッセージ) 9
7 セッションID | セッション 8
8 セッション管理が必要な理由は、HTTPプロトコルには状態を保持する機能がないため | セッション 7
9 Warning: strlen() expects parameter 1 to be string, array given in ○○.php on line △△ | Warning(エラーメッセージ) 5
9 Warning: include() [function.include]: Failed opening '**.php' for inclusion (in | Warning(エラーメッセージ) 5
9 コード例 … 「例外処理」はネストすることができる 5
10 curl | その他のサービス 4
10 型の種類 | 型 4
10 Cookie | クッキー 4
10 @ | 演算子 4
10 Warning: PDO::query(): LOAD DATA LOCAL INFILE forbidden | Warning(エラーメッセージ) 4
10 Fatal error: Call to undefined method MDB2_Error::execute() in ○○ on line △△ | Fatal error(エラーメッセージ) 4
11 Fatal error: Cannot access protected property ○○ in △△ on □□ | Fatal error(エラーメッセージ) 3
2023/6/2 1:01 更新