Home >php教程 >php手册 >PHP顶层类

PHP顶层类

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-22 18:38:412093browse

<?php
/**
 * Object
 * base class
 */
class Object {
    /* 是否输出调试信息 */
    var $debug = true;
    /**
     * Object
     * @deprecated 析构方法
     *
     * @return void
     */
    function Object() {
        //用户是否从主页进入,做判定
        if (!defined(&#39;INDEX&#39;)) {
            die("Hacking attempt");
        }
        //echo &#39;create Object success!&#39;;
        
    }
    /**
     * msg_die
     * @deprecated 调试信息输出
     * @param string
     * @return void
     */
    function msg_die($info, $file, $line) {
        if ($this->debug) {
            $format = "There is happen error information: %s ." . " the file name: %s , on line : %s . ";
            printf($format, $info, $file, $line);
            $error = debug_backtrace();
            print_r($error[0]);
        }
    }
    /**
     * setDebug
     * @deprecated 设置是否输出调试信息
     * @param boolean true or false
     * @return void
     */
    function setDebug($bool) {
        $this->debug = is_bool($bool) ? $bool : false;
    }
    /**
     * getDebug * @deprecated 查看是否打开调试信息
     * @param void
     * @return boolean
     */
    function getDebug() {
        return $this->debug;
    }
}
?>


文章网址:

随意转载^^但请附上教程地址。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn