diff --git a/doc/examples/mock/MyPAGIApplication.php b/doc/examples/mock/MyPAGIApplication.php index 7adc79a..48af46e 100644 --- a/doc/examples/mock/MyPAGIApplication.php +++ b/doc/examples/mock/MyPAGIApplication.php @@ -1,8 +1,4 @@ 'request.php', 'channel' => 'SIP/blah-00803890', @@ -27,7 +23,6 @@ ); $mock = new PAGI\Client\Impl\MockedClientImpl(array( - 'log4php.properties' => __DIR__ . '/../quickstart/log4php.properties', 'variables' => $variables )); $mock diff --git a/doc/examples/mock/mocktest.php b/doc/examples/mock/mocktest.php index f860d2f..c8b97e8 100644 --- a/doc/examples/mock/mocktest.php +++ b/doc/examples/mock/mocktest.php @@ -1,7 +1,4 @@ 'request.php', 'channel' => 'SIP/blah-00803890', diff --git a/doc/examples/node/example.php b/doc/examples/node/example.php index 55400c0..7d5010c 100644 --- a/doc/examples/node/example.php +++ b/doc/examples/node/example.php @@ -68,10 +68,5 @@ public function shutdown() { $this->asteriskLogger->notice('Shutdown'); } - - public function setLogger(\Logger $logger) - { - $this->logger = $logger; - } } diff --git a/doc/examples/node/run.php b/doc/examples/node/run.php index 7c4924c..55d020a 100755 --- a/doc/examples/node/run.php +++ b/doc/examples/node/run.php @@ -3,23 +3,13 @@ declare(ticks=1); date_default_timezone_set('America/Buenos_Aires'); -define('ROOT_PATH', realpath(__DIR__ . '/../../..')); -ini_set('include_path', implode(PATH_SEPARATOR, array( - ROOT_PATH . '/src/mg', - ROOT_PATH . '/vendor/php/log4php', - ini_get('include_path') -))); -require_once ROOT_PATH . '/src/mg/PAGI/Autoloader/Autoloader.php'; -PAGI\Autoloader\Autoloader::register(); require_once __DIR__ . '/example.php'; use PAGI\Client\Impl\ClientImpl as PagiClient; // Go, go, gooo! -$pagiClientOptions = array( - 'log4php.properties' => ROOT_PATH . '/resources/log4php.properties', -); +$pagiClientOptions = array(); $pagiClient = PagiClient::getInstance($pagiClientOptions); $pagiAppOptions = array( 'pagiClient' => $pagiClient, diff --git a/doc/examples/node/test_example.php b/doc/examples/node/test_example.php index c138c1f..34055a0 100644 --- a/doc/examples/node/test_example.php +++ b/doc/examples/node/test_example.php @@ -1,23 +1,12 @@ ROOT_PATH . '/resources/log4php.properties', -); +$pagiClientOptions = array(); $pagiClient = new \PAGI\Client\Impl\MockedClientImpl($pagiClientOptions); $pagiAppOptions = array( 'pagiClient' => $pagiClient, diff --git a/doc/examples/nodecontroller/example.php b/doc/examples/nodecontroller/example.php index c1d44cb..4da198b 100644 --- a/doc/examples/nodecontroller/example.php +++ b/doc/examples/nodecontroller/example.php @@ -360,10 +360,5 @@ public function shutdown() { $this->asteriskLogger->notice('Shutdown'); } - - public function setLogger(\Logger $logger) - { - $this->logger = $logger; - } } diff --git a/doc/examples/nodecontroller/run.php b/doc/examples/nodecontroller/run.php index 7c4924c..173c1a1 100755 --- a/doc/examples/nodecontroller/run.php +++ b/doc/examples/nodecontroller/run.php @@ -3,23 +3,12 @@ declare(ticks=1); date_default_timezone_set('America/Buenos_Aires'); -define('ROOT_PATH', realpath(__DIR__ . '/../../..')); -ini_set('include_path', implode(PATH_SEPARATOR, array( - ROOT_PATH . '/src/mg', - ROOT_PATH . '/vendor/php/log4php', - ini_get('include_path') -))); -require_once ROOT_PATH . '/src/mg/PAGI/Autoloader/Autoloader.php'; -PAGI\Autoloader\Autoloader::register(); - require_once __DIR__ . '/example.php'; use PAGI\Client\Impl\ClientImpl as PagiClient; // Go, go, gooo! -$pagiClientOptions = array( - 'log4php.properties' => ROOT_PATH . '/resources/log4php.properties', -); +$pagiClientOptions = array(); $pagiClient = PagiClient::getInstance($pagiClientOptions); $pagiAppOptions = array( 'pagiClient' => $pagiClient, diff --git a/doc/examples/quickstart/MyPAGIApplication.php b/doc/examples/quickstart/MyPAGIApplication.php index f947781..c5a79ba 100644 --- a/doc/examples/quickstart/MyPAGIApplication.php +++ b/doc/examples/quickstart/MyPAGIApplication.php @@ -1,15 +1,10 @@ Optional. If set, should contain the absolute - * path to the log4php.properties file. - * * stdin => Optional. If set, should contain an already open stream from * where the client will read data (useful to make it interact with fastagi * servers or even text files to mock stuff when testing). If not set, stdin @@ -54,9 +49,6 @@ * * Note: The client accepts an array with options. The available options are * - * log4php.properties => Optional. If set, should contain the absolute - * path to the log4php.properties file. - * * stdin => Optional. If set, should contain an already open stream from * where the client will read data (useful to make it interact with fastagi * servers or even text files to mock stuff when testing). If not set, stdin @@ -95,9 +87,7 @@ public function init() public function log($msg) { $agi = $this->getAgi(); - if ($this->logger->isDebugEnabled()) { - $this->logger->debug($msg); - } + $this->logger->debug($msg); $agi->consoleLog($msg); } diff --git a/doc/examples/quickstart/run.sh b/doc/examples/quickstart/run.sh index c8170d7..a3b78a1 100755 --- a/doc/examples/quickstart/run.sh +++ b/doc/examples/quickstart/run.sh @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ # Sample application to run from your dialplan. -################################################################################ +################################################################################ # Get our base directory (the one where this script is located) me=$(dirname ${0}) root=${me}/../../.. @@ -10,18 +10,12 @@ export root=`cd ${root}; pwd` # This is the application that will be run. export PAGIApplication=MyPAGIApplication -# Location for your log4php.properties -export log4php_properties=${root}/resources/log4php.properties - # Make sure this is in the include path. export PAGIBootstrap=MyPAGIApplication.php -# Your copy of log4php -log4php=${root}/vendor/php/log4php - # PHP to run and options php=/usr/php/bin/php -phpoptions="-c ${root}/resources/php.ini -d include_path=${root}/src/mg:${log4php}:${root}/docs/examples/quickstart" +phpoptions="-c ${root}/resources/php.ini -d include_path=${root}/src/mg:${root}/docs/examples/quickstart" # Standard.. the idea is to have a common launcher. launcher=${root}/src/mg/PAGI/Application/PAGILauncher.php diff --git a/doc/examples/quickstart/spooling.php b/doc/examples/quickstart/spooling.php index 567d946..0951878 100644 --- a/doc/examples/quickstart/spooling.php +++ b/doc/examples/quickstart/spooling.php @@ -19,14 +19,6 @@ * limitations under the License. * */ - -ini_set('include_path', implode(PATH_SEPARATOR, array( - realpath(__DIR__ .'/../../../src/mg'), - ini_get('include_path') -))); -require_once 'PAGI/Autoloader/Autoloader.php'; // Include PAGI autoloader. -\PAGI\Autoloader\Autoloader::register(); // Call autoloader register for PAGI autoloader. - use PAGI\CallSpool\CallFile; use PAGI\CallSpool\Impl\CallSpoolImpl; use PAGI\DialDescriptor\SIPDialDescriptor;