当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPParser::getClassesVars方法代码示例

本文整理汇总了PHP中PHPParser::getClassesVars方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPParser::getClassesVars方法的具体用法?PHP PHPParser::getClassesVars怎么用?PHP PHPParser::getClassesVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPParser的用法示例。


在下文中一共展示了PHPParser::getClassesVars方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createWSDL

 /**
  * Generate the WSDL
  *
  */
 public function createWSDL()
 {
     $this->classes = $this->PHPParser->getClasses();
     foreach ($this->classes as $class => $methods) {
         $pbs = array();
         ksort($methods);
         foreach ($methods as $method => $components) {
             if ($components["type"] == "public" || $components["type"] == "") {
                 if (array_key_exists("params", $components)) {
                     $this->createMessage($method, $components["returnType"], $components["params"]);
                 } else {
                     $this->createMessage($method, $components["returnType"]);
                 }
                 $pbs[$class][$method]["documentation"] = $components["description"];
                 $pbs[$class][$method]["input"] = $method;
                 $pbs[$class][$method]["output"] = $method;
             }
         }
         $this->createPortType($pbs);
         $this->createBinding($pbs);
         $this->createService($pbs);
     }
     // adding typens
     foreach ($this->typens as $typenNo => $url) {
         $this->WSDLXML->setAttribute("xmlns:" . $typenNo, $url);
     }
     // add types
     if (is_array($this->typensDefined) && count($this->typensDefined) > 0) {
         $types = new XMLCreator("types");
         $xsdSchema = new XMLCreator("xsd:schema");
         $xsdSchema->setAttribute("xmlns", "http://www.w3.org/2001/XMLSchema");
         $xsdSchema->setAttribute("targetNamespace", "urn:" . $this->name);
         $vars = $this->PHPParser->getClassesVars();
         foreach ($this->typensDefined as $typensDefined) {
             $complexType = new XMLCreator("xsd:complexType");
             $complexType->setAttribute("name", $typensDefined);
             $all = new XMLCreator("xsd:all");
             if (isset($vars[$typensDefined]) && is_array($vars[$typensDefined])) {
                 ksort($vars[$typensDefined]);
                 foreach ($vars[$typensDefined] as $varName => $varType) {
                     $element = new XMLCreator("xsd:element");
                     $element->setAttribute("name", $varName);
                     $varType = isset($this->xsd[$varType]) ? "xsd:" . $this->xsd[$varType] : "anyType";
                     $element->setAttribute("type", $this->xsd[$varType]);
                     $all->addChild($element);
                 }
             }
             $complexType->addChild($all);
             $xsdSchema->addChild($complexType);
         }
         $types->addChild($xsdSchema);
         $this->WSDLXML->addChild($types);
     }
     // adding messages
     foreach ($this->messages as $message) {
         $this->WSDLXML->addChild($message);
     }
     // adding port types
     foreach ($this->portTypes as $portType) {
         $this->WSDLXML->addChild($portType);
     }
     // adding bindings
     foreach ($this->bindings as $binding) {
         $this->WSDLXML->addChild($binding);
     }
     // adding services
     $s = new XMLCreator("service");
     $s->setAttribute("name", $this->name . "Service");
     foreach ($this->services as $service) {
         $s->addChild($service);
     }
     $this->WSDLXML->addChild($s);
     $this->WSDL = "<?xml version='1.0' encoding='UTF-8'?>\n";
     $this->WSDL .= "<!-- WSDL file generated by PHP WSDLCreator (http://www.protung.ro) -->\n";
     $this->WSDL .= $this->WSDLXML->getXML();
 }
开发者ID:edmarbarbosa,项目名称:newt-rtls,代码行数:80,代码来源:WSDLCreator.php


注:本文中的PHPParser::getClassesVars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。