Cml\Debug::addTipInfo PHP Method

addTipInfo() public static method

添加调试信息
public static addTipInfo ( string $msg, integer $type = self::TIP_INFO_TYPE_INFO ) : void
$msg string 调试消息字符串
$type integer 消息的类型
return void
    public static function addTipInfo($msg, $type = self::TIP_INFO_TYPE_INFO)
    {
        if (Cml::$debug) {
            switch ($type) {
                case self::TIP_INFO_TYPE_INFO:
                    self::$tipInfo[] = $msg;
                    break;
                case self::TIP_INFO_TYPE_INCLUDE_LIB:
                    self::$includeLib[] = $msg;
                    break;
                case self::TIP_INFO_TYPE_SQL:
                    self::$sql[] = $msg;
                    break;
                case self::TIP_INFO_TYPE_INCLUDE_FILE:
                    self::$includeFile[] = str_replace('\\', '/', str_replace([Cml::getApplicationDir('secure_src'), CML_PATH], ['{secure_src}', '{cmlphp_src}'], $msg));
                    break;
            }
        }
    }

Same methods

Debug::addTipInfo ( string $msg, integer $type = self::TIP_INFO_TYPE_INFO, string $color = '' ) : void

Usage Example

Example #1
0
 /**
  * require 引入文件
  *
  * @param string $file 要引入的文件
  * @param array $args 要释放的变量
  *
  * @return mixed
  */
 public static function requireFile($file, $args = [])
 {
     empty($args) || extract($args, EXTR_PREFIX_SAME, "xxx");
     Cml::$debug && Debug::addTipInfo($file, Debug::TIP_INFO_TYPE_INCLUDE_FILE);
     return require $file;
 }
All Usage Examples Of Cml\Debug::addTipInfo