Skip to content

Commit

Permalink
chore: readme typos and wordsmithing
Browse files Browse the repository at this point in the history
  • Loading branch information
samarobaze authored and AdeAttwood committed Mar 22, 2021
1 parent 050fcd3 commit 8bf0d14
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
# 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
```

## 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
Expand All @@ -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/');
Expand All @@ -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/');
Expand All @@ -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
;
Expand Down Expand Up @@ -99,15 +97,15 @@ 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
```

### 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
Expand Down

0 comments on commit 8bf0d14

Please sign in to comment.