Exemplo n.º 1
0
 /**
  * handle 一个 SoapServer
  *
  * Uses:
  * <code>
  * Watt_Service_Servicer::handleSoapServer( "Your_Class_Servicer", "demo.wsdl" );
  * </code>
  * 
  * @param string $className
  * @param mixed $wsdl
  * @param array $options
  */
 public static function handleSoapServer($className, $wsdl, array $options = array())
 {
     if (!class_exists($className)) {
         Watt::loadClass($className);
     }
     //$server = new SoapServer( null, array('uri' => "http://test-uri/") );
     $server = new SoapServer(Watt_Config::getConfigPath() . "wsdl/" . $wsdl);
     $server->setClass($className);
     $server->handle();
     exit;
 }
Exemplo n.º 2
0
 /**
  * 自动选择路径加文件
  * 规则是:
  * 先从 pri 配置中寻找文件,如果存在,则选择这个路径,
  * 如果不存在,则从 sce 中找,依次类推。
  * 在最后一组配置时不判断文件是否存在,直接选择路径。
  * 返回值是 路径加文件的完整文件名
  * 
  *
  * @param string $sysPathName 系统路径的名称,如 PATH_APP
  * @param string $relPathFilename 相对路径文件名
  * @return string 完整的路径文件名
  */
 public static function getAbsPathFilename($sysPathName, $relPathFilename)
 {
     $pathFile = self::$_priCfg[$sysPathName] . $relPathFilename;
     if (is_array(self::$_secCfg) && !Watt::isReadable($pathFile)) {
         $pathFile = self::$_secCfg[$sysPathName] . $relPathFilename;
     }
     return $pathFile;
 }
Exemplo n.º 3
0
 /**
  * 渲染
  *
  * @param boolean $show
  * @return string
  */
 public function render($show = true)
 {
     /**
      * 改为不Buffer的形式
      * @author terry
      * @version 0.1.0
      * Mon Jan 14 15:10:36 CST 2008
      */
     if (defined('ENABLE_CTRL_BUFFER') && ENABLE_CTRL_BUFFER) {
         ob_start();
     }
     if (Watt::isReadable($this->_viewFile)) {
         //如果存在 view file, 则提供给他一个 $data 变量
         if (is_array($this->_data)) {
             reset($this->_data);
         }
         $data = $this->_data;
         //在新的分离的目标下,这段分解变量没有什么太大意义了
         /*
         foreach ( $data as $key => $val )
         {
         	//此处根据变量定义render变量
         	//$$key = $this->renderVar( $val , $theCtrl->getVarDef( $key ));
         	$$key = $val;
         	
         	//初始化 $this->_vnameList[]
         	//设置该名称变量的vname 在 renderVar() 里
         	$this->_vnameList[$key] = $key;
         }
         */
         //view file 中,将只看到一个 $data 的输入
         extract($this->_data);
         include $this->_viewFile;
     } else {
         if (DEBUG) {
             //此处使用默认方法render modal
             echo "<pre>";
             echo var_export($this->_data);
             /*
             reset( $this->_data );
             echo htmlspecialchars( Watt_Util_Array::varToXml( $this->_data ) ); 
             */
             /*
             while ( list( $key ) = each( $this->_data ) )
             {
             	echo $$key;
             }
             */
             echo "</pre>";
         }
     }
     /**
      * 改为不Buffer的形式
      * @author terry
      * @version 0.1.0
      * Mon Jan 14 15:10:36 CST 2008
      */
     if (defined('ENABLE_CTRL_BUFFER') && ENABLE_CTRL_BUFFER) {
         $this->_lastOut = ob_get_clean();
         define('PAGE_BUFFER_SIZE', strlen($this->_lastOut));
         if ($show) {
             echo $this->_lastOut;
         }
         return $this->_lastOut;
     } else {
         return null;
     }
 }