Ejemplo n.º 1
0
 /**
  * @param string $wsdlType The type as represented by the SOAP client.
  */
 public function __construct($wsdlType)
 {
     $this->wsdlType = $wsdlType;
     // The first line of the WSDL type contains the type name and restriction. Extract them.
     $lines = $this->getWsdlLines();
     $firstLineElements = explode(" ", $lines[0]);
     $this->restriction = $firstLineElements[0];
     $this->name = $firstLineElements[1];
     parent::__construct();
 }
Ejemplo n.º 2
0
 /**
  * testAppend method
  *
  * @access public
  * @return void
  */
 function testAppend()
 {
     $parentNode = new XmlNode('ourParentNode');
     $parentNode->append(new XmlNode('ourChildNode'));
     $first =& $parentNode->first();
     $this->assertEqual($first->name, 'ourChildNode');
     $string = 'ourChildNode';
     $parentNode = new XmlNode('ourParentNode');
     $parentNode->append($string);
     $last =& $parentNode->last();
     $this->assertEqual($last->name, 'ourChildNode');
     $this->expectError();
     $parentNode->append($parentNode);
 }
Ejemplo n.º 3
0
 /**
  * Construct an Xml element
  *
  * @param  string  $name name of the node
  * @param  string  $value value of the node
  * @param  array  $attributes
  * @param  string  $namespace
  * @return string A copy of $data in XML format
  */
 function __construct($name = null, $value = null, $attributes = array(), $namespace = false)
 {
     parent::__construct($name, $value, $namespace);
     $this->addAttribute($attributes);
 }
Ejemplo n.º 4
0
function fillXmlNodeWithDBData(&$xmlNode, $dbResource, $objectName)
{
    if (!$dbResource) {
        return;
    }
    while ($arrObject = mysql_fetch_assoc($dbResource)) {
        $objectNode = new XmlNode();
        $objectNode->name = $objectName;
        foreach ($arrObject as $dataName => $dataValue) {
            if ($_GET['applylang'] and $dataName == 'Name') {
                $dataValue = _t($_GET['applylang'] . $dataValue);
            }
            $dataName = htmlspecialchars_adv($dataName);
            $dataValue = htmlspecialchars(htmlspecialchars($dataValue));
            $objectDataNode = new XmlNode();
            $objectDataNode->name = $dataName;
            $objectDataNode->value = $dataValue;
            $objectNode->addChild($objectDataNode);
        }
        $xmlNode->addChild($objectNode);
    }
}
Ejemplo n.º 5
0
 function tag_open($parser, $tag, $attributes)
 {
     $this->currentXPath[$this->currentIndex++] = $tag;
     if ($this->compareXPath()) {
         $this->innerXmlBeginIndex = xml_get_current_byte_index($this->parser);
         $newNode = new XmlNode();
         $newNode->SetXmlNodeAttributes($attributes);
         $newNode->SetXmlNodeName($tag);
         $this->selectResult[] = $newNode;
     }
 }
Ejemplo n.º 6
0
function serProductAndCategoriesSerialization($fileName)
{
    $f = gzopen($fileName, "w");
    $xmlTables = new XmlNode();
    $xmlTables->LoadInnerXmlFromFile(DATABASE_STRUCTURE_XML_PATH);
    $array = $xmlTables->SelectNodes("DataBaseStructure/tables/table");
    foreach ($array as $xmlTable) {
        $attrubtes = $xmlTable->GetXmlNodeAttributes();
        if (isset($attrubtes["PRODUCTANDCATEGORYSYNC"])) {
            if (strtoupper($attrubtes["PRODUCTANDCATEGORYSYNC"]) == "TRUE") {
                $res = _tableSerialization($xmlTable);
                gzputs($f, $res . "\n");
            }
        }
    }
    gzclose($f);
}
Ejemplo n.º 7
0
function GetColumnDataType($columnName, $tableName, $fileName)
{
    $xmlTables = new XmlNode();
    $xmlTables->LoadInnerXmlFromFile($fileName);
    $array = $xmlTables->SelectNodes("DataBaseStructure/tables/table");
    foreach ($array as $xmlTable) {
        $attr = $xmlTable->GetXmlNodeAttributes();
        $tableName = $attr["NAME"];
        if (trim($tableName) == trim($tableName)) {
            $arrayColumn = $xmlTable->SelectNodes("table/column");
            foreach ($arrayColumn as $xmlColumn) {
                if (trim($xmlColumn->GetXmlNodeData()) == trim($columnName)) {
                    $attributes = $xmlColumn->GetXmlNodeAttributes();
                    return strtoupper($attributes["TYPE"]);
                }
            }
        }
    }
    return false;
}