fXmlRpc\Value\Base64::serialize PHP Method

serialize() public static method

Return new base64 value object by encoded value
public static serialize ( string $string ) : Base64
$string string
return Base64
    public static function serialize($string)
    {
        return new static(null, $string);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function parse($xmlString, &$isFault)
 {
     $result = xmlrpc_decode($xmlString, 'UTF-8');
     $isFault = false;
     $toBeVisited = [&$result];
     while (isset($toBeVisited[0]) && ($value =& $toBeVisited[0])) {
         $type = gettype($value);
         if ($type === 'object') {
             $xmlRpcType = $value->{'xmlrpc_type'};
             if ($xmlRpcType === 'datetime') {
                 $value = DateTime::createFromFormat('Ymd\\TH:i:s', $value->scalar, isset($timezone) ? $timezone : ($timezone = new DateTimeZone('UTC')));
             } elseif ($xmlRpcType === 'base64') {
                 if ($value->scalar !== '') {
                     $value = Base64::serialize($value->scalar);
                 } else {
                     $value = null;
                 }
             }
         } elseif ($type === 'array') {
             foreach ($value as &$element) {
                 $toBeVisited[] =& $element;
             }
         }
         array_shift($toBeVisited);
     }
     if (is_array($result)) {
         reset($result);
         $isFault = xmlrpc_is_fault($result);
     }
     return $result;
 }
All Usage Examples Of fXmlRpc\Value\Base64::serialize