本文整理汇总了PHP中DevblocksPlatform::isDatabaseEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::isDatabaseEmpty方法的具体用法?PHP DevblocksPlatform::isDatabaseEmpty怎么用?PHP DevblocksPlatform::isDatabaseEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::isDatabaseEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
* A legitimate license entitles you to support, access to the developer
* mailing list, the ability to participate in betas and the warm fuzzy
* feeling of feeding a couple obsessed developers who want to help you get
* more done than 'the other guy'.
*
* - Jeff Standen, Mike Fogg, Brenan Cavish, Darren Sugita, Dan Hildebrandt
* and Joe Geck.
* WEBGROUP MEDIA LLC. - Developers of Cerberus Helpdesk
*/
if (version_compare(PHP_VERSION, "5.2", "<")) {
die("Cerberus Helpdesk 5.x requires PHP 5.2 or later.");
}
require getcwd() . '/framework.config.php';
require DEVBLOCKS_PATH . 'Devblocks.class.php';
// If this is our first run, redirect to the installer
if ('' == APP_DB_DRIVER || '' == APP_DB_HOST || '' == APP_DB_DATABASE || null == ($db = DevblocksPlatform::getDatabaseService()) || DevblocksPlatform::isDatabaseEmpty()) {
header('Location: ' . dirname($_SERVER['PHP_SELF']) . '/install/index.php');
// [TODO] change this to a meta redirect
exit;
}
require APP_PATH . '/api/Application.class.php';
DevblocksPlatform::init();
DevblocksPlatform::setExtensionDelegate('C4_DevblocksExtensionDelegate');
// Request
$request = DevblocksPlatform::readRequest();
// Patches (if not on the patch page)
if (@0 != strcasecmp(@$request->path[0], "update") && !DevblocksPlatform::versionConsistencyCheck()) {
DevblocksPlatform::redirect(new DevblocksHttpResponse(array('update', 'locked')));
}
//DevblocksPlatform::readPlugins();
$session = DevblocksPlatform::getSessionService();
示例2: catch
$tpl->assign('db_driver', $db_driver);
$tpl->assign('db_server', $db_server);
$tpl->assign('db_name', $db_name);
$tpl->assign('db_user', $db_user);
$tpl->assign('db_pass', $db_pass);
$tpl->assign('failed', true);
$tpl->assign('result', $result);
$tpl->assign('config_path', APP_PATH . "/framework.config.php");
$tpl->assign('template', 'steps/step_config_file.tpl');
}
break;
// Initialize the database
// Initialize the database
case STEP_INIT_DB:
// [TODO] Add current user to patcher/upgrade authorized IPs
if (DevblocksPlatform::isDatabaseEmpty()) {
// install
try {
DevblocksPlatform::update();
} catch (Exception $e) {
$tpl->assign('error', $e->getMessage());
$tpl->assign('template', 'steps/step_init_db.tpl');
}
// Read in plugin information from the filesystem to the database
DevblocksPlatform::readPlugins();
$plugins = DevblocksPlatform::getPluginRegistry();
// Tailor which plugins are enabled by default
if (is_array($plugins)) {
foreach ($plugins as $plugin) {
/* @var $plugin DevblocksPluginManifest */
switch ($plugin->id) {