本文整理汇总了PHP中Properties::loadFromFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Properties::loadFromFile方法的具体用法?PHP Properties::loadFromFile怎么用?PHP Properties::loadFromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Properties
的用法示例。
在下文中一共展示了Properties::loadFromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
* Check for login
*/
if (strcmp($_SERVER["PHP_SELF"], '/login.php') != 0) {
if ($_SESSION["ValidLogin"] != 1) {
header("location: login.php?r=" . $_SERVER["PHP_SELF"]);
}
}
include_once "includes/nerdery/net.theirvins.util.Properties.php";
include_once "includes/nerdery/net.theirvins.nerdery.domain.NerderyList.php";
require_once "includes/doctrine/Doctrine.php";
spl_autoload_register(array('Doctrine', 'autoload'));
/*
* get db props and set up doctrine manager
*/
$props = new Properties();
$props->loadFromFile("nerdery.properties");
$db_server = $props->getProperty("db.server");
$db_user = $props->getProperty("db.username");
$db_password = $props->getProperty("db.password");
$db_name = $props->getProperty("db.name");
$dsn = 'mysql://' . $db_user . ':' . $db_password . '@' . $db_server . '/' . $db_name;
$conn = Doctrine_Manager::connection($dsn);
/*
* get a connection to the db
*/
//$conn = new PDO($dsn, $user, $password);
$list = new NerderyList();
$list->title = "Test List " . date_format(date_create(), MySQLUtil::$MYSQL_DATE_FORMAT);
$list->createdDate = date_format(date_create(), MySQLUtil::$MYSQL_DATE_FORMAT);
$list->lastModified = date_format(date_create(), MySQLUtil::$MYSQL_DATE_FORMAT);
$list->owner = 'kirvin';