Skip to content

Commit

Permalink
Instructions on how to install using composer
Browse files Browse the repository at this point in the history
  • Loading branch information
llagerlof authored Dec 20, 2019
1 parent 9ddccb8 commit 1bd7e73
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,40 @@ If you need a detailed explanation about the **$parameters** format of the **req

## To the code

Include the **MoodleRest.php** class in your script.
**You have 2 options to add this lib to your project:**

**Option One:** Use Composer to include it in your project.

- Inside your project directory create or modify the file `composer.json`:

```json
{
"require": {
"llagerlof/moodlerest": "2.3.0"
}
}
```

- In the same directory of the `composer.json`, run:
```bash
$ composer install
```

- In your project, load the lib using composer autoloader:

```php
<?php
require_once dirname(__FILE__) . '/vendor/autoload.php'
```

**Option Two:** Include the **MoodleRest.php** class in your script.

```php
require_once('MoodleRest.php');
```



### Example 1

Query 2 Moodle groups with IDs 1 and 2, passing the server URL and token in constructor.
Expand Down

0 comments on commit 1bd7e73

Please sign in to comment.