diff --git a/README.md b/README.md index f51d0fd..08c97d3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # Preloader -PHP preloading for PHP ^7.4. Preloading is a feature of php that will pre -compile php functions and classes in to opcache. This is then available in your -programs with out needing to require the files for speed improvements. To read -more on php preloading you can see the [opcache.preloading -documentation](https://www.php.net/manual/en/opcache.preloading.php) +PHP preloading for PHP ^7.4. Preloading is a feature of php that will pre-compile php functions and classes to opcache. Thus, this becomes available in your +programs with out needing to require the files, which improves speed. To read more on php preloading you can see the [opcache.preloading +documentation](https://www.php.net/manual/en/opcache.preloading.php). ## Installation -The preferred way is with composer. +The preferred method is with composer. ```bash composer require practically/preloader @@ -16,7 +14,7 @@ composer require practically/preloader ## Usage -After installation you will need to create a preload executable. +After installation you need to create a preload executable. ```php #!/usr/bin/env php @@ -41,7 +39,7 @@ $preloader = new Preloader($autoloader); /** * Set regex patterns of classes you want to exclude from preloading. In this - * example any of the yii2 dev classes and the `Object` class that got removed + * example any of the yii2 dev classes and the `Object` class that has been removed * and is no longer used */ $preloader->exclude('/^yii\\\composer/'); @@ -50,7 +48,7 @@ $preloader->exclude('/yii\\\base\\\Object/'); /** * A regex pattern of classes to preload this will get of the preloader and - * preload all of the yii2 classes excluding the above and all off the app + * preload all of the yii2 classes excluding the above and all of the app * classes */ $preloader->preload('/^yii/'); @@ -62,16 +60,16 @@ $preloader->preload('/^app/'); $preloader->preloadDirectory(__DIR__ . '/views'); ``` -The preloader uses the composer class map under the hood so you will need to +The preloader uses the composer class map under the hood, so you will need to generate the class map using composer optimised autoloader with the `-o` flag -when running composer +when running composer. ```bash composer install -o ``` Once all that is done you will need to configure you `php.ini` to use the -preload script to preload classes and files into the opcache +preload script to preload classes and files into the opcache. ```ini ; @@ -99,7 +97,7 @@ Then start hacking! ### Testing All new features of bug fixes must be tested. Testing is with phpunit and can -be run with the following command +be run with the following command: ```bash composer run-script test @@ -107,7 +105,7 @@ composer run-script test ### Coding Standards -This library uses practically coding standards and `squizlabs/php_codesniffer` +This library uses [Practically](https://practically.io/) coding standards and `squizlabs/php_codesniffer` for linting. There is a composer script for this: ```bash