Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Some File Cleanups in PHP API #2

Merged
merged 2 commits into from

1 participant

@arunoda
Collaborator

No description provided.

arunoda added some commits
arunoda removed md5 password encryption
added comments for smaples
7aba9fc
arunoda cleanup 385039b
@arunoda arunoda merged commit ab5fd21 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 6, 2010
  1. removed md5 password encryption

    arunoda authored
    added comments for smaples
  2. cleanup

    arunoda authored
This page is out of date. Refresh to see the latest.
View
5 php/.buildpath
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<buildpath>
- <buildpathentry kind="src" path=""/>
- <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
-</buildpath>
View
22 php/.project
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>appzone</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.dltk.core.scriptbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.php.core.PHPNature</nature>
- </natures>
-</projectDescription>
View
3  php/.settings/org.eclipse.php.core.prefs
@@ -1,3 +0,0 @@
-#Sun Jun 13 15:26:02 IST 2010
-eclipse.preferences.version=1
-include_path=0;/appzone
View
0  php/AppZoneReciever.php 100644 → 100755
File mode changed
View
4 php/AppZoneSender.php 100644 → 100755
@@ -71,7 +71,7 @@ private function sendRequest($postfields){
}
private function getAuthHeader(){
- $auth=$this->username . ':' . md5($this->password);
+ $auth=$this->username . ':' . $this->password;
$auth=base64_encode($auth);
return 'Authorization: Basic ' . $auth;
}
@@ -120,4 +120,4 @@ public function getStatusMessage(){
public function getRawResponse(){
return $this->response;
}
-}
+}
View
0  php/README 100644 → 100755
File mode changed
View
BIN  php/releases/appzone-client-php-1.0.zip
Binary file not shown
View
0  php/sample/log.php 100644 → 100755
File mode changed
View
17 php/sample/recieve.php 100644 → 100755
@@ -3,21 +3,36 @@
/**
* Listen to the AppZone MO Message and reply back
*/
+
+//include the api for sending and receiving
include_once '../AppZoneSender.php';
include_once '../AppZoneReciever.php';
include_once 'log.php';
try{
+ //create the receiver
$reciever=new AppZoneReciever();
+ //getting the message content
$rtn="{$reciever->getAddress()} :: {$reciever->getMessage()} :: {$reciever->getCorrelator()}";
logFile($rtn);
- $sender=new AppZoneSender("http://localhost:65182", "PD_ET_e0550", "098f6bcd4621d373cade4e832627b4f6");
+ /*
+ creating the sender object with
+ server url
+ appId
+ password
+ */
+ $sender=new AppZoneSender("http://localhost:8080/appzone-simulator/simulator", "PD_ET_e0550", "098f6bcd4621d373cade4e832627b4f6");
+
+ //sending a one message
$res=$sender->sms("Thanks", $reciever->getAddress());
+
+ //broadcasting a message
$res=$sender->smsToAll("Hi all, we got a new message");
logFile($res);
}
catch(AppZoneException $ex){
+ //throws when failed sending or receiving the sms
logFile("ERROR: {$ex->getStatusCode()} | {$ex->getStatusMessage()}");
}
View
15 php/sample/send.php 100644 → 100755
@@ -4,18 +4,29 @@
* StandAlone SMS Sending
*/
+ //include the api for sending
include_once '../AppZoneSender.php';
+ /*
+ creating the sender object with
+ server url
+ appId
+ password
+ */
$sender=new AppZoneSender(
- "http://localhost:65182",
+ "http://localhost:8080/appzone-simulator/simulator",
"PD_ET_e0550",
"098f6bcd4621d373cade4e832627b4f6");
try{
+ //sending a one message
var_dump( $sender->sms("Message is this", array(78688,'0721683234')));
echo "<br>";
+
+ //broadcasting a message
var_dump( $sender->smsToAll("Message is this"));
}
catch(AppZoneException $ex){
+ //throws when failed sending or receiving the sms
echo "ERROR::{$ex->getStatusMessage()}";
- }
+ }
Something went wrong with that request. Please try again.