Skip to content

Commit

Permalink
Merge pull request #5 from Riimu/next
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
Riimu committed Jul 15, 2017
2 parents aab8555 + 858d4be commit 48e1a30
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
56 changes: 30 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,51 @@ The API documentation is available at: http://kit.riimu.net/api/phpencoder/

## Requirements ##

In order to use this library, the following requirements must be met:

* PHP version 5.6
* The minimum supported PHP version is 5.6

## Installation ##

This library can be installed by using [Composer](http://getcomposer.org/). In
order to do this, you must download the latest Composer version and run the
`require` command to add this library as a dependency to your project. The
easiest way to complete these two tasks is to run the following two commands
in your terminal:
### Installation with Composer ###

```
php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar require "riimu/kit-phpencoder:2.*"
```
The easiest way to install this library is to use Composer to handle your
dependencies. In order to install this library via Composer, simply follow
these two steps:

1. Acquire the `composer.phar` by running the Composer
[Command-line installation](https://getcomposer.org/download/)
in your project root.

If you already have Composer installed on your system and you know how to use
it, you can also install this library by adding it as a dependency to your
`composer.json` file and running the `composer install` command. Here is an
example of what your `composer.json` file could look like:
2. Once you have run the installation script, you should have the `composer.phar`
file in you project root and you can run the following command:

```
php composer.phar require "riimu/kit-phpencoder:^2.3"
```

After installing this library via Composer, you can load the library by
including the `vendor/autoload.php` file that was generated by Composer during
the installation.

### Adding the library as a dependency ###

If you are already familiar with how to use Composer, you may alternatively add
the library as a dependency by adding the following `composer.json` file to your
project and running the `composer install` command:

```json
{
"require": {
"riimu/kit-phpencoder": "2.*"
"riimu/kit-phpencoder": "^2.3"
}
}
```

After installing this library via Composer, you can load the library by
including the `vendor/autoload.php` file that was generated by Composer during
the installation.

### Manual installation ###

You can also install this library manually without using Composer. In order to
do this, you must download the [latest release](https://github.com/Riimu/Kit-PHPEncoder/releases/latest)
and extract the `src` folder from the archive to your project folder. To load
the library, you can simply include the `src/autoload.php` file that was
provided in the archive.
If you do not wish to use Composer to load the library, you may also download
the library manually by downloading the [latest release](https://github.com/Riimu/Kit-PHPEncoder/releases/latest)
and extracting the `src` folder to your project. You may then include the
provided `src/autoload.php` file to load the library classes.

## Usage ##

Expand Down
2 changes: 1 addition & 1 deletion examples/config.phtml → examples/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
configuration options, such as a database configuration, and stores that into
a PHP file, which can, for example, later be used in an application. */

require __DIR__ . '/../src/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

$configFile = __DIR__ . '/dbconf.php';
$config = [
Expand Down
2 changes: 1 addition & 1 deletion examples/export_difference.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

$precision = 17;
$normalEncoder = new \Riimu\Kit\PHPEncoder\PHPEncoder(['float.precision' => $precision]);
Expand Down
2 changes: 1 addition & 1 deletion examples/writing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* This simple example demonstrates how to encode a simple array using default
settings and while using minimal whitespace */

require __DIR__ . '/../src/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

$encoder = new \Riimu\Kit\PHPEncoder\PHPEncoder();
echo $encoder->encode(['foo' => 'bar', [1, true, false, null, 1.0]]);
Expand Down

0 comments on commit 48e1a30

Please sign in to comment.