代码拉取完成,页面将自动刷新
同步操作将从 ownfire/phpfun 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
/**
* php大量自定义的方便的函数
*
* @author wuxiao
* @date 20140626
*/
defined('DS') or define('DS',DIRECTORY_SEPARATOR);
defined('EXT') or define('EXT','.php');
defined('FUN_ROOT') or define('FUN_ROOT', realpath(dirname(__FILE__)).DS);
defined('FUN_CACHE') or define('FUN_CACHE', FUN_ROOT.'runtime'.DS.'cache'.DS);
defined('FUN_LOG') or define('FUN_LOG', FUN_ROOT.'runtime'.DS.'log'.DS);
defined('FUN_LIB') or define('FUN_LIB', FUN_ROOT.'lib'.DS);
defined('FUN_FUNC') or define('FUN_FUNC', FUN_ROOT.'func'.DS);
defined('FUN_KEY') or define('FUN_KEY', '1d2sbFIHzJLmaCSIB8aVsdPj2teSEvUqvxY7femSB2OLsbXs12DMlbPe');
//date_default_timezone_set('PRC');
class PHPFun{
protected $debug = true;
protected static $_instance;
public function __construct($namespace = null) {
$this->init($namespace);
self::$_instance = $this;
}
public static function getInstance(){
return self::$_instance;
}
public function load($namespace){
$namespace = basename($namespace, EXT);
$namespace = FUN_FUNC . $namespace . EXT;
return req_once($namespace);
}
private function init($namespace = null){
require_once FUN_ROOT.'init.php';
if (empty($namespace)){
$libs = glob(FUN_FUNC.'*.php');
array_walk($libs,'req_once');
}else{
$this->load($namespace);
}
spl_autoload_register(array($this,'lib_autoload'));
}
//php debug开启
public function debug(){
$this->debug = true;
ini_set('display_errors', true);
error_reporting(E_ALL);
}
//php debug关闭
public function nodebug(){
$this->debug = false;
ini_set('display_errors', false);
error_reporting(0);
}
private function lib_autoload($name){
$name = strtolower($name);
$file = FUN_LIB.'class_'.$name.EXT;
if (!is_file($file)){
if (!is_file($file = FUN_LIB.$name.DS.$name.EXT)){
return false;
}
}
include_once $file;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。