/** * Description of 64Bit_to_Integer * * @author peter */ class Sixty_Four_Bit_to_Integer{ /** Connects to the webservice @var soapClient */ public $ws; public $serverId; /** This is to call hidden functions */ public function __call($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to call functions using old code */ public function __soapCall($name,$arguments){ return $this->ws->__soapCall($name, $arguments); } /** This is to set cookie values functions */ public function setCookies($cookies_csv){ if($cookies_csv != null){ $splitCookies = explode(",",$cookies_csv); foreach($splitCookies as $currentCookie){ $subSplit= explode("=",$currentCookie); $this->ws->__setCookie($subSplit[0], $subSplit[1]); } } } public function __construct($cookies_csv=null){ $this->serverId="http://soap.peterdownie.com/webServices/sixty_four_bit_numbers/server.php"; $this->ws = new SoapClient(null,array("uri"=>"$this->serverId","location"=>"$this->serverId")); $this->setCookies($cookies_csv); return $this->ws->__soapCall("__construct",array()); } /** This is the primary function of this project. It takes a 64 bit stored value as a single character and converts it into an Integer with a base of ten. The purpose of this is to access mysql databases with a 64 bit conversion. I will likely build a mysql version of this for fun if I ever get around to doing that This takes 0 - 9, a - z, A - Z and - and finally _ It returns an array with an output of SUCCESS and a payload of the value this is in case I make modifications to this project. Please note that this uses PHP gmp which allows integers of large values, however this is very wasteful when compaired to storing the same number as a flaot. However the persicion is needed. Does not work with negative numbers */ public function generateInteger($Sixty_four_base){ return $this->ws->__soapCall("generateInteger",array($Sixty_four_base)); } /** * This generates a base 64 letter from a base 10 integer. * Does not work with negative numbers * @param type $Integer * As of 0.03 release this should work. */ public function generate_64BaseNumber($Integer){ return $this->ws->__soapCall("generate_64BaseNumber",array($Integer)); } }