diff --git a/install/composer.xml b/install/composer.xml new file mode 100644 index 000000000000..cd64f32c2bb8 --- /dev/null +++ b/install/composer.xml @@ -0,0 +1,51 @@ + + + + + Installation of Composer and third-party packages + + + Introduction to Composer + + &link.composer; is a dependency manager for PHP that makes it possible + to define third-party packages of code that a project uses that can + then be easily installed and updated. It leverages the the built-in + class autoloading features + of PHP, repositories of PHP packages such as + Packagist, and common project + layout and coding conventions. + + + For example, if a PHP application or website needs + to work with UUID values, + Ben Ramsey's + ramsey/uuid package that implements the + widely known and used types of UUIDs that are defined by + RFC 4122 could be used. + + + Briefly, this is done by creating a composer.json + in the project, using Composer to install the latest version of the + package, and including Composer's autoload script to make it available + to the code. The Composer + "Basic Usage" documentation goes into this in more depth. + + + + + <literal>composer.json</literal> that requires a single package + + + + + + + + + diff --git a/language/oop5/autoload.xml b/language/oop5/autoload.xml index 91f8b902f0aa..8c7b4e8e39c6 100644 --- a/language/oop5/autoload.xml +++ b/language/oop5/autoload.xml @@ -79,6 +79,26 @@ string(5) "ITest" Fatal error: Interface 'ITest' not found in ... */ ?> +]]> + + + + Using Composer's autoloader + + &link.composer; generates a vendor/autoload.php + with is set up to automatically load packages that are being managed + by Composer. By including this file, those packages can be used without + any additional work. + + + ", $uuid->toString(), "\n"; +?> ]]>