Skip to content

Instantly share code, notes, and snippets.

View eyedol's full-sized avatar
:octocat:
WWWorking...

Henry Addo eyedol

:octocat:
WWWorking...
View GitHub Profile
jsonObject = new JSONObject(response);
JSONObject payloadObject = jsonObject.getJSONObject("payload");
if (payloadObject != null) {
task = payloadObject.getString("task");
if (task.equals("sendsms")) {
jsonArray = payloadObject.getJSONArray("messages");
for (int index = 0; index < jsonArray.length(); ++index) {
jsonObject = jsonArray.getJSONObject(index);
if (Kohana::find_file('libraries/api',
Kohana::config('config.extension_prefix').$library_file_name)) // Library file exists
{
include Kohana::find_file('libraries/api', Kohana::config('config.extension_prefix').$library_file_name);
print_r(die($library_file_name));
// Create instance of the implementing library/class
$api_object = new $library_file_name(&$this);
<?php defined('SYSPATH') or die('No direct script access allowed');
/**
* Api_Service
*
* This class runs the API service. It abstracts the details of handling of the API
* requests from the API controller. All task switching and routing is handled by
* this class.
*
* The API routing works through inversion of control (IoC). The name of the library
* that services the api request is inferred from the name of the task. Not all API
<?php defined('SYSPATH') or die('No direct script access allowed');
/**
* Api_Service
*
* This class runs the API service. It abstracts the details of handling of the API
* requests from the API controller. All task switching and routing is handled by
* this class.
*
* The API routing works through inversion of control (IoC). The name of the library
* that services the api request is inferred from the name of the task. Not all API