Skip to content

Commit

Permalink
Merge pull request #32 from marcelog/v2.0.0
Browse files Browse the repository at this point in the history
updating examples
  • Loading branch information
marcelog committed Jan 3, 2016
2 parents 1ca5492 + 304a4de commit 3293664
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ composer.json:
}
```

# Using it

First, make sure you include the [autoloader shipped with composer](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```php
require __DIR__ . '/vendor/autoload.php';
```

# Quickstart

You can start by *docs/examples/quickstart* for a very basic example. You'll need something like this in your dialplan:
Expand Down
18 changes: 18 additions & 0 deletions doc/examples/mock/MyPAGIApplication.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
<?php
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
'',
'..',
'..',
'..',
'vendor',
'autoload.php'
));

require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
implode(DIRECTORY_SEPARATOR, array(
'',
'..',
'quickstart',
'MyPAGIApplication.php'
))
));

$variables = array(
'request' => 'request.php',
'channel' => 'SIP/blah-00803890',
Expand Down
8 changes: 8 additions & 0 deletions doc/examples/mock/mocktest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
'',
'..',
'..',
'..',
'vendor',
'autoload.php'
));
$variables = array(
'request' => 'request.php',
'channel' => 'SIP/blah-00803890',
Expand Down
11 changes: 10 additions & 1 deletion doc/examples/node/run.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/usr/bin/env php
<?php
declare(ticks=1);
ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);

date_default_timezone_set('America/Buenos_Aires');
require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
'',
'..',
'..',
'..',
'vendor',
'autoload.php'
));

require_once __DIR__ . '/example.php';

Expand Down
11 changes: 11 additions & 0 deletions doc/examples/node/test_example.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?php
date_default_timezone_set('America/Buenos_Aires');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);

require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
'',
'..',
'..',
'..',
'vendor',
'autoload.php'
));
require_once __DIR__ . '/example.php';

use PAGI\Client\Impl\ClientImpl as PagiClient;
Expand Down
12 changes: 12 additions & 0 deletions doc/examples/nodecontroller/run.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
declare(ticks=1);

date_default_timezone_set('America/Buenos_Aires');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);

require __DIR__ . implode(DIRECTORY_SEPARATOR, array(
'',
'..',
'..',
'..',
'vendor',
'autoload.php'
));

require_once __DIR__ . '/example.php';

use PAGI\Client\Impl\ClientImpl as PagiClient;
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/quickstart/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export PAGIBootstrap=MyPAGIApplication.php

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

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

0 comments on commit 3293664

Please sign in to comment.