File tree Expand file tree Collapse file tree 10 files changed +6
-80
lines changed Expand file tree Collapse file tree 10 files changed +6
-80
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
- require_once 'PAGI/Autoloader/Autoloader.php ' ;
3
- PAGI \Autoloader \Autoloader::register ();
4
- require_once __DIR__ . '/../quickstart/MyPAGIApplication.php ' ;
5
-
6
2
$ variables = array (
7
3
'request ' => 'request.php ' ,
8
4
'channel ' => 'SIP/blah-00803890 ' ,
27
23
);
28
24
29
25
$ mock = new PAGI \Client \Impl \MockedClientImpl (array (
30
- 'log4php.properties ' => __DIR__ . '/../quickstart/log4php.properties ' ,
31
26
'variables ' => $ variables
32
27
));
33
28
$ mock
Original file line number Diff line number Diff line change 1
1
<?php
2
- date_default_timezone_set ('America/Buenos_Aires ' );
3
- require_once 'PAGI/Autoloader/Autoloader.php ' ;
4
- PAGI \Autoloader \Autoloader::register ();
5
2
$ variables = array (
6
3
'request ' => 'request.php ' ,
7
4
'channel ' => 'SIP/blah-00803890 ' ,
Original file line number Diff line number Diff line change @@ -68,10 +68,5 @@ public function shutdown()
68
68
{
69
69
$ this ->asteriskLogger ->notice ('Shutdown ' );
70
70
}
71
-
72
- public function setLogger (\Logger $ logger )
73
- {
74
- $ this ->logger = $ logger ;
75
- }
76
71
}
77
72
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
- define ('ROOT_PATH ' , realpath (__DIR__ . '/../../.. ' ));
7
- ini_set ('include_path ' , implode (PATH_SEPARATOR , array (
8
- ROOT_PATH . '/src/mg ' ,
9
- ROOT_PATH . '/vendor/php/log4php ' ,
10
- ini_get ('include_path ' )
11
- )));
12
- require_once ROOT_PATH . '/src/mg/PAGI/Autoloader/Autoloader.php ' ;
13
- PAGI \Autoloader \Autoloader::register ();
14
6
15
7
require_once __DIR__ . '/example.php ' ;
16
8
17
9
use PAGI \Client \Impl \ClientImpl as PagiClient ;
18
10
19
11
// Go, go, gooo!
20
- $ pagiClientOptions = array (
21
- 'log4php.properties ' => ROOT_PATH . '/resources/log4php.properties ' ,
22
- );
12
+ $ pagiClientOptions = array ();
23
13
$ pagiClient = PagiClient::getInstance ($ pagiClientOptions );
24
14
$ pagiAppOptions = array (
25
15
'pagiClient ' => $ pagiClient ,
Original file line number Diff line number Diff line change 1
1
<?php
2
2
date_default_timezone_set ('America/Buenos_Aires ' );
3
- define ('ROOT_PATH ' , realpath (__DIR__ . '/../../.. ' ));
4
- ini_set ('include_path ' , implode (PATH_SEPARATOR , array (
5
- ROOT_PATH . '/src/mg ' ,
6
- ROOT_PATH . '/vendor/php/log4php ' ,
7
- ini_get ('include_path ' )
8
- )));
9
- require_once ROOT_PATH . '/src/mg/PAGI/Autoloader/Autoloader.php ' ;
10
- PAGI \Autoloader \Autoloader::register ();
11
-
12
3
require_once __DIR__ . '/example.php ' ;
13
4
14
5
use PAGI \Client \Impl \ClientImpl as PagiClient ;
15
6
use PAGI \Node \Node ;
16
7
17
8
// Go, go, gooo!
18
- $ pagiClientOptions = array (
19
- 'log4php.properties ' => ROOT_PATH . '/resources/log4php.properties ' ,
20
- );
9
+ $ pagiClientOptions = array ();
21
10
$ pagiClient = new \PAGI \Client \Impl \MockedClientImpl ($ pagiClientOptions );
22
11
$ pagiAppOptions = array (
23
12
'pagiClient ' => $ pagiClient ,
Original file line number Diff line number Diff line change @@ -360,10 +360,5 @@ public function shutdown()
360
360
{
361
361
$ this ->asteriskLogger ->notice ('Shutdown ' );
362
362
}
363
-
364
- public function setLogger (\Logger $ logger )
365
- {
366
- $ this ->logger = $ logger ;
367
- }
368
363
}
369
364
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
- define ('ROOT_PATH ' , realpath (__DIR__ . '/../../.. ' ));
7
- ini_set ('include_path ' , implode (PATH_SEPARATOR , array (
8
- ROOT_PATH . '/src/mg ' ,
9
- ROOT_PATH . '/vendor/php/log4php ' ,
10
- ini_get ('include_path ' )
11
- )));
12
- require_once ROOT_PATH . '/src/mg/PAGI/Autoloader/Autoloader.php ' ;
13
- PAGI \Autoloader \Autoloader::register ();
14
-
15
6
require_once __DIR__ . '/example.php ' ;
16
7
17
8
use PAGI \Client \Impl \ClientImpl as PagiClient ;
18
9
19
10
// Go, go, gooo!
20
- $ pagiClientOptions = array (
21
- 'log4php.properties ' => ROOT_PATH . '/resources/log4php.properties ' ,
22
- );
11
+ $ pagiClientOptions = array ();
23
12
$ pagiClient = PagiClient::getInstance ($ pagiClientOptions );
24
13
$ pagiAppOptions = array (
25
14
'pagiClient ' => $ pagiClient ,
Original file line number Diff line number Diff line change 1
1
<?php
2
- define ('ROOT_PATH ' , getenv ('root ' )); // Only used inside log4php.properties
3
-
4
2
/**
5
3
* PAGI basic use example. Please see run.sh in this same directory for an
6
4
* example of how to actually run this from your dialplan.
7
5
*
8
6
* Note: The client accepts an array with options. The available options are
9
7
*
10
- * log4php.properties => Optional. If set, should contain the absolute
11
- * path to the log4php.properties file.
12
- *
13
8
* stdin => Optional. If set, should contain an already open stream from
14
9
* where the client will read data (useful to make it interact with fastagi
15
10
* servers or even text files to mock stuff when testing). If not set, stdin
54
49
*
55
50
* Note: The client accepts an array with options. The available options are
56
51
*
57
- * log4php.properties => Optional. If set, should contain the absolute
58
- * path to the log4php.properties file.
59
- *
60
52
* stdin => Optional. If set, should contain an already open stream from
61
53
* where the client will read data (useful to make it interact with fastagi
62
54
* servers or even text files to mock stuff when testing). If not set, stdin
@@ -95,9 +87,7 @@ public function init()
95
87
public function log ($ msg )
96
88
{
97
89
$ agi = $ this ->getAgi ();
98
- if ($ this ->logger ->isDebugEnabled ()) {
99
- $ this ->logger ->debug ($ msg );
100
- }
90
+ $ this ->logger ->debug ($ msg );
101
91
$ agi ->consoleLog ($ msg );
102
92
}
103
93
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# ###############################################################################
3
3
# Sample application to run from your dialplan.
4
- # ###############################################################################
4
+ # ###############################################################################
5
5
# Get our base directory (the one where this script is located)
6
6
me=$( dirname ${0} )
7
7
root=${me} /../../..
@@ -10,18 +10,12 @@ export root=`cd ${root}; pwd`
10
10
# This is the application that will be run.
11
11
export PAGIApplication=MyPAGIApplication
12
12
13
- # Location for your log4php.properties
14
- export log4php_properties=${root} /resources/log4php.properties
15
-
16
13
# Make sure this is in the include path.
17
14
export PAGIBootstrap=MyPAGIApplication.php
18
15
19
- # Your copy of log4php
20
- log4php=${root} /vendor/php/log4php
21
-
22
16
# PHP to run and options
23
17
php=/usr/php/bin/php
24
- phpoptions=" -c ${root} /resources/php.ini -d include_path=${root} /src/mg:${log4php} : ${ root} /docs/examples/quickstart"
18
+ phpoptions=" -c ${root} /resources/php.ini -d include_path=${root} /src/mg:${root} /docs/examples/quickstart"
25
19
26
20
# Standard.. the idea is to have a common launcher.
27
21
launcher=${root} /src/mg/PAGI/Application/PAGILauncher.php
Original file line number Diff line number Diff line change 19
19
* limitations under the License.
20
20
*
21
21
*/
22
-
23
- ini_set ('include_path ' , implode (PATH_SEPARATOR , array (
24
- realpath (__DIR__ .'/../../../src/mg ' ),
25
- ini_get ('include_path ' )
26
- )));
27
- require_once 'PAGI/Autoloader/Autoloader.php ' ; // Include PAGI autoloader.
28
- \PAGI \Autoloader \Autoloader::register (); // Call autoloader register for PAGI autoloader.
29
-
30
22
use PAGI \CallSpool \CallFile ;
31
23
use PAGI \CallSpool \Impl \CallSpoolImpl ;
32
24
use PAGI \DialDescriptor \SIPDialDescriptor ;
You can’t perform that action at this time.
0 commit comments