コード例 #1
0
 /**
  * Refresh the in-memory set of variables. Useful after a page request is made
  * that changes a variable in a different thread.
  *
  * In other words calling a settings page with $this->drupalPost() with a changed
  * value would update a variable to reflect that change, but in the thread that
  * made the call (thread running the test) the changed variable would not be
  * picked up.
  *
  * This method clears the variables cache and loads a fresh copy from the database
  * to ensure that the most up-to-date set of variables is loaded.
  */
 protected function refreshVariables()
 {
     global $conf;
     cache_clear_all('variables', 'cache');
     $conf = variable_init();
 }
コード例 #2
0
ファイル: index.php プロジェクト: h07r0d/leaguerunner
    } else {
        $temp_pdo_flags = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::ATTR_EMULATE_PREPARES => true);
    }
    $dbh = new PDO($CONFIG['database']['dsn'], $CONFIG['database']['username'], $CONFIG['database']['password'], $temp_pdo_flags);
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die;
}
require_once "includes/smarty.php";
require_once "includes/KLogger.php";
require_once "includes/common.php";
require_once "includes/menu.php";
require_once "includes/permissions.php";
require_once "includes/mail.php";
// Initialise configuration variables and Logger
$conf = variable_init();
if (variable_get('log_messages', 0)) {
    if (!isset($log)) {
        $log = new KLogger($_SERVER['DOCUMENT_ROOT'] . $CONFIG['paths']['base_url'] . '/logs', variable_get('log_threshold', Klogger::DEBUG));
    }
}
/*
 * PayPal IPN transactions are purely B2B, so most of the leaguerunner codebase isn't needed.
 * The main functions are:
 *  - Update registration payments
 *  - ensure registrations/payments are matched up for players
 */
// Check Request for IPN
if ($_GET['q'] == 'ipn') {
    require_once "Handler/PaypalHandler.php";
    // PayPal has its own logger
コード例 #3
0
ファイル: scrape.php プロジェクト: benced/anarchotv
// $Id: scrape.php,v 1.4.2.7 2007/09/22 05:10:21 bradfordcp Exp $
/**
 * @file
 * The scrape portion of the tracker module.
 *
 * Accepts the input from the users torrent client
 * and acts accordingly.
 */
// Require the bt functions
require_once 'bt_common.inc';
// Include bootstrap.inc and run the bootstrap
include_once "includes/bootstrap.inc";
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
// Initializes $conf so we can use variable_get
$conf = variable_init(isset($conf) ? $conf : array());
// Do not continue parsing if the module is not enabled
$active = db_result(db_query("SELECT status FROM {system} WHERE name = '%s'", 'bt_tracker'));
if ($active == 1) {
    $response = array('files' => array());
    $hashes = array();
    $request_variables = split('&', $_SERVER['QUERY_STRING']);
    foreach ($request_variables as &$request_var) {
        preg_match('/info_hash=/', $request_var, $matches);
        if (count($matches) == 0) {
            unset($request_var);
        } else {
            // Strip 'info_hash=' from the begining of the value and urldecode it.
            $hashes[] = urldecode(substr($request_var, 10));
        }
    }
コード例 #4
0
 /**
  * Makes sure all variables and branches have been reset.
  */
 function resetBranchesAndCache()
 {
     cache_clear_all('variables', 'cache');
     variable_init();
     api_get_branches(TRUE);
     menu_rebuild();
 }