File tree Expand file tree Collapse file tree 7 files changed +68
-2
lines changed Expand file tree Collapse file tree 7 files changed +68
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ composer.json:
31
31
}
32
32
```
33
33
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
+
34
42
# Quickstart
35
43
36
44
You can start by * docs/examples/quickstart* for a very basic example. You'll need something like this in your dialplan:
Original file line number Diff line number Diff line change 1
1
<?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
+
2
20
$ variables = array (
3
21
'request ' => 'request.php ' ,
4
22
'channel ' => 'SIP/blah-00803890 ' ,
Original file line number Diff line number Diff line change 1
1
<?php
2
+ require __DIR__ . implode (DIRECTORY_SEPARATOR , array (
3
+ '' ,
4
+ '.. ' ,
5
+ '.. ' ,
6
+ '.. ' ,
7
+ 'vendor ' ,
8
+ 'autoload.php '
9
+ ));
2
10
$ variables = array (
3
11
'request ' => 'request.php ' ,
4
12
'channel ' => 'SIP/blah-00803890 ' ,
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env php
2
2
<?php
3
3
declare (ticks=1 );
4
+ ini_set ('error_reporting ' , E_ALL );
5
+ ini_set ('display_errors ' , true );
4
6
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
+ ));
6
15
7
16
require_once __DIR__ . '/example.php ' ;
8
17
Original file line number Diff line number Diff line change 1
1
<?php
2
2
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
+ ));
3
14
require_once __DIR__ . '/example.php ' ;
4
15
5
16
use PAGI \Client \Impl \ClientImpl as PagiClient ;
Original file line number Diff line number Diff line change 3
3
declare (ticks=1 );
4
4
5
5
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
+
6
18
require_once __DIR__ . '/example.php ' ;
7
19
8
20
use PAGI \Client \Impl \ClientImpl as PagiClient ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export PAGIBootstrap=MyPAGIApplication.php
15
15
16
16
# PHP to run and options
17
17
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"
19
19
20
20
# Standard.. the idea is to have a common launcher.
21
21
launcher=${root} /src/mg/PAGI/Application/PAGILauncher.php
You can’t perform that action at this time.
0 commit comments