/** * Large bit numbers allowing the returning of numbers as a string * It allows you to store data in a database or program very compactly. * */ class LargeBitNumbers{ /** 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/LargeBitNumbers/server.php"; $this->ws = new SoapClient(null,array("uri"=>"$this->serverId","location"=>"$this->serverId")); $this->setCookies($cookies_csv); return $this->ws->__soapCall("__construct",array()); } public function multipleBitSetSmart($bits,$numbers=0){ return $this->ws->__soapCall("multipleBitSetSmart",array($bits,$numbers)); } /** * If you feed a number and an array of bits it will find out which bits are currently on * @param type $number * @param array $bits * @return type */ public function multipleBitDetect($number,$bits){ return $this->ws->__soapCall("multipleBitDetect",array($number,$bits)); } /** * Performs a bitwise gmp and on two numbers * Finds numbers that are the same * @param type $number1 * @param type $number2 * @return type */ public function bitAnd($number1,$number2){ return $this->ws->__soapCall("bitAnd",array($number1,$number2)); } /** * Performs a bitwise Or on two numbers, Combines NUMBERS * @param type $number1 * @param type $number2 * @return type */ public function bitOr($number1,$number2){ return $this->ws->__soapCall("bitOr",array($number1,$number2)); } /** * Removes Multiple Bits * @param type $number * @param array $bits * @return type */ public function multipleBitRemove($number,$bits){ return $this->ws->__soapCall("multipleBitRemove",array($number,$bits)); } }