예제 #1
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
//引用静态资源管理类
require_once 'Resource.class.php';
//设置配置和模板文件夹
$root = dirname(__FILE__) . DIRECTORY_SEPARATOR;
FISResource::setConfig(array('config_dir' => $root . '/tpl/config/', 'template_dir' => $root . '/tpl/'));
//渲染首页
display("page/index.php");
예제 #2
0
                        }
                    } else {
                        self::$arrStaticCollection[$arrRes['type']][] = $strURI;
                    }
                    return $strURI;
                } else {
                    self::triggerError($strName, 'undefined resource "' . $strName . '"', E_USER_NOTICE);
                }
            } else {
                self::triggerError($strName, 'missing map file of "' . $strNamespace . '"', E_USER_NOTICE);
            }
        }
        self::triggerError($strName, 'unknown resource "' . $strName . '" load error', E_USER_NOTICE);
    }
    /**
     * 用户代码自定义js组件,其没有对应的文件
     * 只有有后缀的组件找不到时进行报错
     * @param $strName       组件ID
     * @param $strMessage    错误信息
     * @param $errorLevel    错误level
     */
    private static function triggerError($strName, $strMessage, $errorLevel)
    {
        $arrExt = array('js', 'css', 'tpl', 'html', 'xhtml');
        if (preg_match('/\\.(' . implode('|', $arrExt) . ')$/', $strName)) {
            trigger_error(date('Y-m-d H:i:s') . '   ' . $strName . ' ' . $strMessage, $errorLevel);
        }
    }
}
FISResource::setConfig(C('FIS_CONIFG'));