Source for file smsapi.php
Documentation is available at smsapi.php
* Copyright (c) 2010, ComVision
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* - Neither the name of the smsAPI.pl nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @author ComVision <info@smsapi.pl>
* @copyright 2010 ComVision
* @version 1.0 14.10.2010
* require_once 'smsapi.php';
* //Instrukcja odpowiedziala za automatyczne wczytywanie class
* spl_autoload_register(array('smsAPI','__autoload'));
const UDH_VCARD =
'06050423F40000';
const UDH_WAPPUSH =
'0605040b8423f0';
* DATACODING BIN dla vCard i WAPPush
const DATACODING_BIN =
'bin';
* Generator wiadomości WAPPush
* $msg->datacoding = smsAPI::DATACODING_BIN;
* $msg->udh = smsAPI::UDH_WAPPUSH;
* $msg->message = smsAPI::make_WAPPush_message(
* 'smsapi.pl', 'Link do http://smsapi.pl');
$url =
self::ascii_to_hex( $url );
$message =
self::ascii_to_hex( $message );
'860601ae02056a0045c60c03'.
* nie obsługiwane przez wszystkie telefony
* $msg->datacoding = smsAPI::DATACODING_BIN;
* $msg->udh = smsAPI::UDH_VCARD;
* $msg->message = smsAPI::make_vCard_message(
* 'smsAPI', 'smsAPI', '500123321', 'bok@smsapi.pl', 'http://www.smsapi.pl');
$msg =
"BEGIN:VCARD\r\nVERSION:2.1\r\n";
$msg .=
'FN:'.
$name .
' '.
$surname .
"\r\nN:".
$surname .
';'.
$name .
";;;\r\n";
if ( $name ) $msg .=
'FN:'.
$name .
"\r\nN:".
$name .
";;;;\r\n";
else if ( $surname ) $msg .=
"FN:$surname\r\nN:$surname;;;;\r\n";
if ( $phone ) $msg .=
'TEL;PREF;CELL:'.
$phone .
"\r\n";
if ( $email ) $msg .=
'EMAIL;INTERNET:'.
$email .
"\r\n";
if ( $www ) $msg .=
'URL:'.
$www .
"\r\n";
return self::ascii_to_hex( $msg );
for ($i =
0; $i <
strlen($ascii); $i++
)
protected static $listners =
array();
* smsAPI::add_listner('var_dump');
* smsAPI::add_listner(array('myClass','log'));
* @param callback $listner
if( !isset
($listner) OR empty($listner) ) return;
self::$listners[] =
$listner;
public static function call_listners()
foreach (self::$listners as $listner)
call_user_func_array($listner, $args);
protected static $base_dir =
null;
* require_once 'smsapi.php';
* //Instrukcja odpowiedziala za automatyczne wczytywanie class
* spl_autoload_register(array('smsAPI','__autoload'));
if( self::$base_dir ==
null ) self::$base_dir =
dirname(__FILE__
) .
DIRECTORY_SEPARATOR;
$pos =
strpos($class, 'smsapi_');
if( $pos ===
false OR $pos >
0 ) return;
$class =
str_replace('_', DIRECTORY_SEPARATOR, $class);
require_once self::$base_dir .
$class .
'.php';
Documentation generated on Thu, 27 Jan 2011 16:17:34 +0100 by phpDocumentor 1.4.3