Skip to content

Commit

Permalink
=creating laravel package for nexmo messaging service.
Browse files Browse the repository at this point in the history
  • Loading branch information
CPeterson committed May 21, 2014
1 parent 8963d33 commit 1f71d50
Show file tree
Hide file tree
Showing 26 changed files with 1,451 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor
composer.phar
composer.lock
.DS_Store
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/nexmo.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/scopes/scope_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

391 changes: 391 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm

before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev

script: phpunit
31 changes: 31 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "artistan/nexmo",
"description": "",
"authors": [
{
"name": "Charles Peterson",
"email": "[email protected]"
}
],
"repositories": [
{
"type": "vcs",
"url": "git://github.com/orchestral/phpseclib.git"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.1.*"
},
"require-dev":{
"phpunit/phpunit": "3.7.*",
"orchestra/testbench": "2.1.*",
"mockery/mockery": "dev-master@dev"
},
"autoload": {
"psr-0": {
"Artistan\\Nexmo": "src/"
}
},
"minimum-stability": "stable"
}
18 changes: 18 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
14 changes: 14 additions & 0 deletions src/Artistan/Nexmo/Facades/Account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* User: Charles Peterson
*/
namespace Artistan\Nexmo\Facades;
use Illuminate\Support\Facades\Facade;

class Account extends Facade {

protected static function getFacadeAccessor()
{
return 'nexmoaccount';
}
}
14 changes: 14 additions & 0 deletions src/Artistan/Nexmo/Facades/Message/Sms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* User: Charles Peterson
*/
namespace Artistan\Nexmo\Facades\Message;
use Illuminate\Support\Facades\Facade;

class Sms extends Facade {

protected static function getFacadeAccessor()
{
return 'nexmosmsmessage';
}
}
14 changes: 14 additions & 0 deletions src/Artistan/Nexmo/Facades/Receipt.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* User: Charles Peterson
*/
namespace Artistan\Nexmo\Facades;
use Illuminate\Support\Facades\Facade;

class Receipt extends Facade {

protected static function getFacadeAccessor()
{
return 'nexmoreceipt';
}
}
81 changes: 81 additions & 0 deletions src/Artistan/Nexmo/NexmoServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php namespace Artistan\Nexmo;

use Illuminate\Support\ServiceProvider;
use Artistan\Nexmo\Service\Account;
use Artistan\Nexmo\Service\Receipt;
use Artistan\Nexmo\Service\Message\Sms as MessageSms;

class NexmoServiceProvider extends ServiceProvider {

/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->package('artistan/nexmo');
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// Receipt
$this->app['nexmoreceipt'] = $this->app->share(function($app)
{
return new Account();
});

$this->app->booting(function()
{
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('NexmoReceipt', 'Artistan\Nexmo\Facades\Receipt');
});

// Account
$this->app['nexmoaccount'] = $this->app->share(function($app)
{
return new Account();
});

$this->app->booting(function()
{
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('NexmoAccount', 'Artistan\Nexmo\Facades\Account');
});

// SMS Message
$this->app['nexmosmsmessage'] = $this->app->share(function($app)
{
return new MessageSms();
});

$this->app->booting(function()
{
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('NexmoSmsMessage', 'Artistan\Nexmo\Facades\Message\Sms');
});
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('nexmosmsmessage','nexmoreceipt','nexmoaccount');
}

}
Loading

0 comments on commit 1f71d50

Please sign in to comment.