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

PHP用語集

カテゴリー: 依存関係マネージャ  閲覧数:618 配信日:2019-05-13 09:35


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


週間人気ページランキング / 10-12 → 10-18
順位 ページタイトル抜粋 アクセス数
1 register_shutdown_function | 関数処理 関数 5
2 Parse error: syntax error, unexpected 'public' (T_PUBLIC) | Parse error(エラーメッセージ) 4
3 セッション管理が必要な理由は、HTTPプロトコルには状態を保持する機能がないため | セッション 3
3 Fatal error: Access level to ▲::$△ must be protected (as in class ●) or weaker | Fatal error(エラーメッセージ) 3
4 Fatal error: Uncaught Error: Call to a member function modify() on string | Fatal error(エラーメッセージ) 2
4 session.gc_maxlifetime | セッション 2
4 ErrorExceptionクラス | 例外処理(制御構造) 2
4 php-devel とは? 2
4 ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined | Fatal error(エラーメッセージ) 2
4 SQLインジェクション | セキュリティ 2
4 エラー設定(エラーメッセージ) カテゴリー 2
4 可変変数 | 変数 2
4 or(||) | 演算子 2
4 Warning: strlen() expects parameter 1 to be string, array given in ○○.php on line △△ | Warning(エラーメッセージ) 2
4 Cookie | クッキー 2
5 抽象メソッド/抽象クラス | クラスとオブジェクト 1
5 session_start() | セッション 1
5 ( ! ) Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in ★★★ headless-chromium-php/vendor/wrench/wrench/lib/Wrench/Protocol/Protocol.php | エラーメッセージ 1
5 PHPにおけるメソッドのオーバーライドについて /「引数の数や型は、親クラスのメソッドと完全に一致していなければなりません。」とは具体的にどういう意味ですか? 1
5 クラス | クラスとオブジェクト 1
2025/10/19 1:01 更新
指定期間人気ページランキング / 2020-5-28 → 2025-10-18
順位 ページタイトル抜粋 アクセス数
1 PHP用語 6700
2 ブラウザを閉じたらセッションデータはどうなるの? | セッション 2533
3 Parse error: syntax error, unexpected 'public' (T_PUBLIC) | Parse error(エラーメッセージ) 2489
4 ブラウザを閉じたらセッションデータはどうなるの? | セッション 1689
5 【テスト投稿】テスト | 1133
6 セッション管理が必要な理由は、HTTPプロトコルには状態を保持する機能がないため | セッション 1076
7 PHPで定数を定義する方法は2種類ある / 配列定数の定義 1027
8 Fatal error: Access level to ▲::$△ must be protected (as in class ●) or weaker | Fatal error(エラーメッセージ) 899
9 Fatal error: Uncaught Error: Call to a member function modify() on string | Fatal error(エラーメッセージ) 861
10 コード例 … 「例外処理」はネストすることができる 852
11 Fatal error: require_once(): Failed opening required 'PEAR.php' | Fatal error(エラーメッセージ) 851
12 curl で Cookie を使用する 846
13 Fatal error: Uncaught RuntimeException: SplFileObject::__construct(): failed to open stream: Permission denied in | Fatal error(エラーメッセージ) 741
14 定数 738
15 インターフェイス | クラスとオブジェクト 697
16 Fatal error: Uncaught HeadlessChromium\Exception\OperationTimedOut: Operation timed out (3sec) in | Fatal error(エラーメッセージ) 690
17 メンバー | クラスとオブジェクト 646
18 Warning: include() [function.include]: Failed opening '**.php' for inclusion (in | Warning(エラーメッセージ) 637
19 ( ! ) Fatal error: Uncaught PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column | Fatal error(エラーメッセージ) 604
20 Warning: strlen() expects parameter 1 to be string, array given in ○○.php on line △△ | Warning(エラーメッセージ) 593
2025/10/19 1:01 更新