本文整理匯總了PHP中Fuel::is_test方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fuel::is_test方法的具體用法?PHP Fuel::is_test怎麽用?PHP Fuel::is_test使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Fuel
的用法示例。
在下文中一共展示了Fuel::is_test方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rtrim
/**
* Set error reporting and display errors settings. You will want to change these when in production.
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
$app_path = rtrim($_SERVER['app_path'], '/') . '/';
$package_path = rtrim($_SERVER['package_path'], '/') . '/';
$vendor_path = rtrim($_SERVER['vendor_path'], '/') . '/';
$core_path = rtrim($_SERVER['core_path'], '/') . '/';
/**
* Website docroot
*/
define('DOCROOT', realpath(__DIR__ . DIRECTORY_SEPARATOR . $_SERVER['doc_root']) . DIRECTORY_SEPARATOR);
!is_dir($app_path) and is_dir(DOCROOT . $app_path) and $app_path = DOCROOT . $app_path;
!is_dir($core_path) and is_dir(DOCROOT . $core_path) and $core_path = DOCROOT . $core_path;
!is_dir($vendor_path) and is_dir(DOCROOT . $vendor_path) and $vendor_path = DOCROOT . $vendor_path;
!is_dir($package_path) and is_dir(DOCROOT . $package_path) and $package_path = DOCROOT . $package_path;
define('APPPATH', realpath($app_path) . DIRECTORY_SEPARATOR);
define('PKGPATH', realpath($package_path) . DIRECTORY_SEPARATOR);
define('VENDORPATH', realpath($vendor_path) . DIRECTORY_SEPARATOR);
define('COREPATH', realpath($core_path) . DIRECTORY_SEPARATOR);
unset($app_path, $core_path, $package_path, $_SERVER['app_path'], $_SERVER['core_path'], $_SERVER['package_path']);
// Get the start time and memory for use later
defined('FUEL_START_TIME') or define('FUEL_START_TIME', microtime(true));
defined('FUEL_START_MEM') or define('FUEL_START_MEM', memory_get_usage());
// Boot the app
require_once APPPATH . 'bootstrap.php';
// Set test mode
Fuel::$is_test = true;
// Import the TestCase class
import('testcase');