Habari\AtomHandler::act_introspection PHP Метод

act_introspection() публичный Метод

Handle incoming requests for the introspection document
public act_introspection ( )
    public function act_introspection()
    {
        Utils::check_request_method(array('GET', 'HEAD', 'POST'));
        $cache_xml = null;
        if (Cache::has('atom:introspection:xml')) {
            $cache_xml = Cache::get('atom:introspection:xml');
            $cache_xml = simplexml_load_string($cache_xml);
        }
        if ($cache_xml instanceof SimpleXMLElement) {
            $xml = $cache_xml;
        } else {
            $xml = new SimpleXMLElement('<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom"></service>');
            $service_workspace = $xml->addChild('workspace');
            $workspace_title = $service_workspace->addChild('atom:title', Utils::htmlspecialchars(Options::get('title')), 'http://www.w3.org/2005/Atom');
            $workspace_collection = $service_workspace->addChild('collection');
            $workspace_collection->addAttribute('href', URL::get('atom_feed', 'index=1'));
            $collection_title = $workspace_collection->addChild('atom:title', 'Blog Entries', 'http://www.w3.org/2005/Atom');
            $collection_accept = $workspace_collection->addChild('accept', 'application/atom+xml;type=entry');
            Cache::set('atom:introspection:xml', $xml->asXML());
        }
        Plugins::act('atom_introspection', $xml, $this->handler_vars);
        $xml = $xml->asXML();
        ob_clean();
        header('Content-Type: application/atomsvc+xml');
        print $xml;
    }