Skip to content

Commit 3293664

Browse files
committed
Merge pull request #32 from marcelog/v2.0.0
updating examples
2 parents 1ca5492 + 304a4de commit 3293664

File tree

7 files changed

+68
-2
lines changed

7 files changed

+68
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ composer.json:
3131
}
3232
```
3333

34+
# Using it
35+
36+
First, make sure you include the [autoloader shipped with composer](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
37+
38+
```php
39+
require __DIR__ . '/vendor/autoload.php';
40+
```
41+
3442
# Quickstart
3543

3644
You can start by *docs/examples/quickstart* for a very basic example. You'll need something like this in your dialplan:

doc/examples/mock/MyPAGIApplication.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
<?php
2+
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
3+
'',
4+
'..',
5+
'..',
6+
'..',
7+
'vendor',
8+
'autoload.php'
9+
));
10+
11+
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
12+
implode(DIRECTORY_SEPARATOR, array(
13+
'',
14+
'..',
15+
'quickstart',
16+
'MyPAGIApplication.php'
17+
))
18+
));
19+
220
$variables = array(
321
'request' => 'request.php',
422
'channel' => 'SIP/blah-00803890',

doc/examples/mock/mocktest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<?php
2+
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
3+
'',
4+
'..',
5+
'..',
6+
'..',
7+
'vendor',
8+
'autoload.php'
9+
));
210
$variables = array(
311
'request' => 'request.php',
412
'channel' => 'SIP/blah-00803890',

doc/examples/node/run.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#!/usr/bin/env php
22
<?php
33
declare(ticks=1);
4+
ini_set('error_reporting', E_ALL);
5+
ini_set('display_errors', true);
46

5-
date_default_timezone_set('America/Buenos_Aires');
7+
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
8+
'',
9+
'..',
10+
'..',
11+
'..',
12+
'vendor',
13+
'autoload.php'
14+
));
615

716
require_once __DIR__ . '/example.php';
817

doc/examples/node/test_example.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22
date_default_timezone_set('America/Buenos_Aires');
3+
ini_set('error_reporting', E_ALL);
4+
ini_set('display_errors', true);
5+
6+
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
7+
'',
8+
'..',
9+
'..',
10+
'..',
11+
'vendor',
12+
'autoload.php'
13+
));
314
require_once __DIR__ . '/example.php';
415

516
use PAGI\Client\Impl\ClientImpl as PagiClient;

doc/examples/nodecontroller/run.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
declare(ticks=1);
44

55
date_default_timezone_set('America/Buenos_Aires');
6+
ini_set('error_reporting', E_ALL);
7+
ini_set('display_errors', true);
8+
9+
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
10+
'',
11+
'..',
12+
'..',
13+
'..',
14+
'vendor',
15+
'autoload.php'
16+
));
17+
618
require_once __DIR__ . '/example.php';
719

820
use PAGI\Client\Impl\ClientImpl as PagiClient;

doc/examples/quickstart/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export PAGIBootstrap=MyPAGIApplication.php
1515

1616
# PHP to run and options
1717
php=/usr/php/bin/php
18-
phpoptions="-c ${root}/resources/php.ini -d include_path=${root}/src/mg:${root}/docs/examples/quickstart"
18+
phpoptions="-c ${root}/resources/php.ini -d include_path=${root}/docs/examples/quickstart"
1919

2020
# Standard.. the idea is to have a common launcher.
2121
launcher=${root}/src/mg/PAGI/Application/PAGILauncher.php

0 commit comments

Comments
 (0)