本文整理汇总了PHP中Load::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Load::init方法的具体用法?PHP Load::init怎么用?PHP Load::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Load
的用法示例。
在下文中一共展示了Load::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public static function run()
{
require_once 'Database.php';
require_once 'Route.php';
require_once 'Load.php';
require_once 'Engine.php';
DB::init('localhost', 'icourse', 'root', '');
Route::init();
Load::$path = OBJ_ROOT . Route::$class . '.php';
Load::init();
foreach ($_REQUEST as $key => $val) {
Engine::$oil[$key] = $val;
}
Engine::$class = Route::$class;
Engine::$function = Route::$function;
Engine::init();
}
示例2: init
class Load
{
public static function init()
{
if (isset($_COOKIE["PHPSESSID"]) && !empty($_COOKIE["PHPSESSID"])) {
if (file_exists("../helpers/_getUserInfo.php")) {
include_once "../helpers/_getUserInfo.php";
User_get::info();
}
}
$exception = new Exception();
switch (_MODE_) {
case "local":
ob_start();
ini_set('display_errors', 1);
error_reporting(E_ALL);
break;
case "production":
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
ob_start(null, 0, PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_REMOVABLE);
} else {
ob_start(null, 0, false);
Logger::write("index.php; #8; ошибка ob_start PHP < 5.4");
}
ini_set("memory_limit", "256M");
break;
}
}
}
Load::init();
示例3: Load
<?php
/*
Plugin Name: rtRestaurants
Plugin URI: http://rtcamp.com
Description: Restaurat directory
Version: 0.1
Author: vaishuagola27
Author URI: http://rtcamp.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Domain Path: /languages
Text Domain: rt-restaurants
*/
// Custom code starts here
//namespace declaration
namespace rtCamp\WP\rtRestaurants;
//define constant for plugin directory path
define('rtCamp\\WP\\rtRestaurants\\PATH', plugin_dir_path(__FILE__));
//define constant for plugin directory url
define('rtCamp\\WP\\rtRestaurants\\URL', plugin_dir_url(__FILE__));
//include classes
require_once \rtCamp\WP\rtRestaurants\PATH . 'includes/class-load.php';
require_once \rtCamp\WP\rtRestaurants\PATH . 'includes/class-theme.php';
require_once \rtCamp\WP\rtRestaurants\PATH . 'includes/class-admin.php';
require_once \rtCamp\WP\rtRestaurants\PATH . 'includes/class-review.php';
//instanciate class Load and call init()
$load_data = new Load();
$load_data->init();