This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
dim Conn | |
dim rs | |
dim rs2 | |
dim cn | |
dim str | |
dim msg | |
dim from | |
dim message | |
dim stmt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `adsense_settings` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`ad_border` varchar(15) NOT NULL, | |
`ad_pub_id` varchar(25) NOT NULL, | |
`ad_channel` varchar(25) NOT NULL, | |
`ad_size` int(11) NOT NULL, | |
`ad_type` varchar(11) NOT NULL, | |
`ad_placement` int(11) NOT NULL, | |
`ad_border_color` varchar(15) NOT NULL DEFAULT 'FFFFFF', | |
`ad_text_color` varchar(15) NOT NULL DEFAULT '000000', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To check tags, run this in the browser | |
# https://api.github.com/repos/ushahidi/Ushahidi_Web/tags | |
CURRENT_TAG='2.2b1' | |
PREVIOUS_TAG='2.1-stable' | |
# You can get this from the sql/ushahidi.sql script | |
CURRENT_VERSION='2.2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//switch this code | |
return ($this->response_type == 'json') | |
? $this->array_as_json($response) | |
: $this->array_as_xml($response, array()); | |
//to | |
return ($this->response_type == 'xml') | |
? $this->array_as_xml($response, array()); | |
: $this->array_as_json($response); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$filter_crlf = array("\n", "\r"); | |
$message = date("Y-m-d H:i:s")." : ".$message; | |
$mesg = str_replace($filter_crlf,'',$message); | |
$mesg .= "\n"; | |
$logfile = DOCROOT."application/logs/upgrade_".$this->session->get('upgrade_session').".txt"; | |
$logfile = fopen($logfile, 'a+'); | |
fwrite($logfile, $mesg); | |
fclose($logfile); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ $# -lt 2 ]] | |
then | |
echo "Usage: gen_updates.sh [previous-tag] [current-tag]" | |
exit 1 | |
fi | |
CURRENT_TAG=$2 | |
PREVIOUS_TAG=$1 | |
TMPDIR="/tmp/upgrade_ushahidi" |
OlderNewer