PHP 8.1.33
Preview: Xml.php Size: 3.48 KB
/home/jambtst2015/public_html/ckfinder/core/connector/php/php4/Core/Xml.php

<?php

/*

 * CKFinder

 * ========

 * http://ckfinder.com

 * Copyright (C) 2007-2011, CKSource - Frederico Knabben. All rights reserved.

 *

 * The software, this file and its contents are subject to the CKFinder

 * License. Please read the license.txt file before using, installing, copying,

 * modifying or distribute this file or part of its contents. The contents of

 * this file is part of the Source Code of CKFinder.

 */

if (!defined('IN_CKFINDER')) exit;



/**

 * @package CKFinder

 * @subpackage Core

 * @copyright CKSource - Frederico Knabben

 */



/**

 * Include basic Xml library

 */

require_once CKFINDER_CONNECTOR_LIB_DIR . "/Utils/XmlNode.php";



/**

 * XML document

 *

 * @package CKFinder

 * @subpackage Core

 * @copyright CKSource - Frederico Knabben

 */

class CKFinder_Connector_Core_Xml

{

    /**

     * Connector node (root)

     *

     * @var Ckfinder_Connector_Utils_XmlNode

     * @access private

     */

    var $_connectorNode;

    /**

     * Error node

     *

     * @var Ckfinder_Connector_Utils_XmlNode

     * @access private

     */

    var $_errorNode;



    function CKFinder_Connector_Core_Xml()

    {

        $this->sendXmlHeaders();

        echo $this->getXMLDeclaration();

        $this->_connectorNode = new Ckfinder_Connector_Utils_XmlNode("Connector");

        $this->_errorNode = new Ckfinder_Connector_Utils_XmlNode("Error");

        $this->_connectorNode->addChild($this->_errorNode);

    }



    /**

     * Return connector node

     *

     * @access public

     * @return Ckfinder_Connector_Utils_XmlNode

     */

    function &getConnectorNode()

    {

    	return $this->_connectorNode;

    }



    /**

     * Return error node

     *

     * @access public

     * @return Ckfinder_Connector_Utils_XmlNode

     */

    function &getErrorNode()

    {

    	return $this->_errorNode;

    }



    /**

     * Send XML headers to the browser (and force browser not to use cache)

     * @access private

     */

    function sendXmlHeaders()

    {

        // Prevent the browser from caching the result.

        // Date in the past

        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT') ;

        // always modified

        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT') ;

        // HTTP/1.1

        header('Cache-Control: no-store, no-cache, must-revalidate') ;

        header('Cache-Control: post-check=0, pre-check=0', false) ;

        // HTTP/1.0

        header('Pragma: no-cache') ;



        // Set the response format.

        header( 'Content-Type:text/xml; charset=utf-8' ) ;

    }



    /**

     * Return XML declaration

     *

     * @access private

     * @return string

     */

    function getXMLDeclaration()

    {

    	return '<?xml version="1.0" encoding="utf-8"?>';

    }



    /**

     * Send error message to the browser. If error number is set to 1, $text (custom error message) will be displayed

     * Don't call this function directly

     *

     * @access public

     * @param int $number error number

     * @param string $text Custom error message (optional)

     */

    function raiseError( $number, $text = false)

    {

        $this->_errorNode->addAttribute("number", intval($number));

        if (false!=$text) {

            $this->_errorNode->addAttribute("text", $text);

        }



        echo $this->_connectorNode->asXML();

    }

}

Directory Contents

Dirs: 0 × Files: 12

Name Size Perms Modified Actions
8.32 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
14.30 KB lrw-r--r-- 2024-11-22 17:53:10
Edit Download
3.57 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.59 KB lrw-r--r-- 2025-10-27 23:48:34
Edit Download
1.91 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
7.38 KB lrw-r--r-- 2024-11-22 17:53:10
Edit Download
6.15 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.52 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.63 KB lrw-r--r-- 2024-11-22 17:53:10
Edit Download
9.70 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
5.11 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
3.48 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).