本文整理汇总了PHP中Engine::getLocalDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Engine::getLocalDir方法的具体用法?PHP Engine::getLocalDir怎么用?PHP Engine::getLocalDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine::getLocalDir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_getLocalDir
public function test_getLocalDir()
{
//Get directory
$dir = Engine::getLocalDir();
//Test that the directory exists
$this->assertEquals(true, file_exists($dir));
//get the path to where we think the engine SHOULD exist
$getPath = realpath(__DIR__ . "/../engine/");
//Check whether the engine exists to where we think it is.
$this->assertEquals(true, $dir == $getPath);
}
示例2: instance
<?php
require Engine::getLocalDir() . "/structure/ReflectiveObject.php";
class User extends ReflectiveObject
{
public $id, $name, $email;
const YEARS_TO_GO_BACK = 2;
const MOST_POST_AVG_PER_DAY = 10;
public static function instance()
{
static $instance;
if (is_null($instance)) {
$instance = new User();
}
return $instance;
}
public function __construct()
{
$this->isLoggedIn = $this->authenticate();
}
public function getToken()
{
return isset($_SESSION['facebook_sdk_access_token']) ? $_SESSION['facebook_sdk_access_token'] : null;
}
public function setToken($value)
{
$_SESSION['facebook_sdk_access_token'] = $value;
}
private $isLoggedIn;
private function authenticate()
{