コード例 #1
0
ファイル: reloadcache.php プロジェクト: Zartas/appDB
<?php

require_once __DIR__ . '/../lib/hydrogen/hydrogen.inc.php';
require_once __DIR__ . '/../lib/appdb/appdb.inc.php';
use appdb\usersession\UserSession;
use hydrogen\recache\RECacheManager;
// Open up our session
UserSession::open_session(false);
if (!($ubean = UserSession::getUserBean())) {
    die('Hey. Log in.');
}
// Are we allowed in?
$group = $ubean->getMapped('group');
if ($group->group_name != 'Administrator' && $group->group_name != 'Moderator') {
    die('Your permissions suck.');
}
$reset = false;
$success = false;
if (isset($_POST['submit'])) {
    $cm = RECacheManager::getInstance();
    if (isset($_POST['apiprofiles'])) {
        $success = $cm->clearGroup('apiprofiles');
        $reset = "apiprofiles";
    } else {
        if (isset($_POST['appdetails'])) {
            $success = $cm->clearGroup('appdetails');
            $reset = "appdetails";
        } else {
            if (isset($_POST['applinks'])) {
                $success = $cm->clearGroup('applinks');
                $reset = "applinks";
コード例 #2
0
ファイル: buildindex.php プロジェクト: Zartas/appDB
<?php

// Includes
require_once __DIR__ . '/../lib/hydrogen/hydrogen.inc.php';
require_once __DIR__ . '/../lib/appdb/appdb.inc.php';
use appdb\usersession\UserSession;
use appdb\models\ApplicationModel;
use hydrogen\database\Query;
use hydrogen\recache\RECacheManager;
// Open up our session
UserSession::open_session();
if (!($ubean = UserSession::getUserBean())) {
    die('Hey. Log in.');
}
// Are we allowed in?
$group = $ubean->getMapped('group');
if ($group->group_name != 'Administrator' && $group->group_name != 'Moderator') {
    die('Your permissions suck.');
}
// Clear the current index
$query = new Query('DELETE');
$query->from('search_name_index');
$stmt = $query->prepare();
$stmt->execute();
echo "Index deleted.<br />\n";
// Find total apps
$query = new Query('SELECT');
$query->field('COUNT(*)', 'count');
$query->from('applications');
$stmt = $query->prepare();
$stmt->execute();