本文整理汇总了PHP中core\Database::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Database::config方法的具体用法?PHP Database::config怎么用?PHP Database::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core\Database
的用法示例。
在下文中一共展示了Database::config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoload
<?php
use Core\Route;
use Core\Database;
session_start();
//Set up composer autoloader
require "../vendor/autoload.php";
//Set up autoloader which uses namespaces as directory names, starting from the 'app' directory
spl_autoload_register(autoload);
function autoload($class)
{
$filename = ".." . DIRECTORY_SEPARATOR . "app" . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
include_once $filename;
}
//Database connection Setttings
Database::config(getenv('IP'), getenv('C9_USER'), "", "c9");
//Start the routing process
//Add any URI Aliases
Route::addAlias(['/login' => '/Auth/Login', '/logout' => '/Auth/Logout', '/signup' => '/Auth/Signup', '/' => 'StaticPage/Home', '' => 'StaticPage/Home']);
Route::route($_SERVER['REQUEST_URI']);
//Actually start the route
//Put test code below
/*
echo "TEST UPDATE";
$usr = new Model\User(1);
print_r($usr);
$usr->fname = "LOLOLOL";
$usr->save();
print_r($usr);
echo "TEST INSERT";