modx->resource instanceof $resourceClass)) { $this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server class.'); } $this->modx->resource->process(); $this->modx->resource->_output= $this->modx->resource->_content; /* collect any uncached element tags in the content and process them */ $this->modx->getParser(); $maxIterations= intval($this->modx->getOption('parser_max_iterations',null,10)); $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, false, '[[', ']]', array(), $maxIterations); $this->modx->parser->processElementTags('', $this->modx->resource->_output, true, true, '[[', ']]', array(), $maxIterations); if (!$this->getServer()) { $this->modx->log(modX::LOG_LEVEL_FATAL, 'Could not load ' . $options['rpc_type'] . '-RPC Server.'); } $this->server->service(); ob_get_level() && @ob_end_flush(); while (ob_get_level() && @ob_end_clean()) {} exit(); } /** * Gets the XML-RPC server for this response * * @access public * @param boolean $execute Whether or not to execute the server as well as * load it * @return boolean True if the server initialized an instance correctly */ public function getServer($execute= false) { if ($this->server === null || !($this->server instanceof xmlrpc_server)) { $this->server= new xmlrpc_server($this->services, $execute); } return $this->server instanceof xmlrpc_server; } /** * Registers a service to this response * * @access public * @param string $key The name of the service * @param string $signature The signature of the service */ public function registerService($key, $signature) { $this->services[$key]= $signature; } /** * Unregisters a service from this response * * @access public * @param string $key The name of the service */ public function unregisterService($key) { unset($this->services[$key]); } }