function require_things($array, $path)
{
    if ($array == "all") {
        require_all($path);
        return;
    } elseif ($array == "none") {
        return;
    } else {
        foreach ($array as $file) {
            // die($path);
            require "{$path}/{$file}.php";
        }
    }
}
示例#2
0
}
if (!extension_loaded("zlib") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_" : "") . "zlib." . PHP_SHLIB_SUFFIX) === false) {
    console("[ERROR] Unable to find the Zlib extension.", true, true, 0);
    ++$errors;
}
if ($errors > 0) {
    console("[ERROR] Please use the installer provided on the homepage, or recompile PHP again.", true, true, 0);
    exit(1);
    //Exit with error
}
$sha1sum = "";
/***REM_START***/
require_once FILE_PATH . "/src/math/Vector3.php";
require_once FILE_PATH . "/src/world/Position.php";
require_once FILE_PATH . "/src/pmf/PMF.php";
require_all(FILE_PATH . "src/");
$inc = get_included_files();
$inc[] = array_shift($inc);
$srcdir = realpath(FILE_PATH . "src/");
foreach ($inc as $s) {
    if (strpos(realpath(dirname($s)), $srcdir) === false and strtolower(basename($s)) !== "pocketmine-mp.php") {
        continue;
    }
    $sha1sum ^= sha1_file($s, true);
}
/***REM_END***/
define("SOURCE_SHA1SUM", bin2hex($sha1sum));
/***REM_START***/
if (!file_exists(DATA_PATH . "server.properties") and arg("no-wizard", false) != true) {
    $installer = new Installer();
}
<?php

$api_dir = __DIR__;
require_once "{$api_dir}/helpers.php";
require_all("{$base_dir}/classes");
require "{$api_dir}/pages/team/default-fields.php";
$default_fields = $output["fields"];
$user = array("organization_id" => 1, "id" => 1);
$dbh = new DBHandler(json_decode(file_get_contents("{$api_dir}/dbconfig.json"), 1));
$sdb = new ScoutingDB($dbh, $user["organization_id"], 1, $user["id"]);
$tba = new TBA();
$file = $argv[1];
if (!file_exists($file)) {
    die("{$file} does not exist");
}
$file_contents = file_get_contents($file);
$data = array("stats" => array("defenses" => json_decode($file_contents, 1)));
$team_stats = array();
foreach ($data["stats"] as $stat => $teams) {
    if (is_string($teams)) {
        $teams = json_decode($teams, 1);
    }
    foreach ($teams as $team_number => $stats) {
        if (!isset($team_stats[$team_number])) {
            $team_stats[$team_number] = array();
        }
        $team_stats[$team_number][$stat] = $stats;
    }
}
$json_fields = array("questions", "stats");
foreach ($team_stats as $team_number => $stats) {
示例#4
0
function require_all($path, &$count = 0)
{
    $dir = dir($path . "/");
    $dirs = array();
    while (false !== ($file = $dir->read())) {
        if ($file !== "." and $file !== "..") {
            if (!is_dir($path . $file) and strtolower(substr($file, -3)) === "php") {
                require_once $path . $file;
                ++$count;
            } elseif (is_dir($path . $file)) {
                $dirs[] = $path . $file . "/";
            }
        }
    }
    foreach ($dirs as $dir) {
        require_all($dir, $count);
    }
}
示例#5
0
        echo '</entry>' . "\n";
    }
} else {
    function rel2abs($article)
    {
        // convertit les URL relatives en absolues
        $article = str_replace(' src="/', ' src="http://' . $_SERVER['HTTP_HOST'] . '/', $article);
        $article = str_replace(' href="/', ' href="http://' . $_SERVER['HTTP_HOST'] . '/', $article);
        $base = $GLOBALS['racine'];
        $article = preg_replace('#(src|href)=\\"(?!http)#i', '$1="' . $base, $article);
        return $article;
    }
    $fcache = $GLOBALS['dossier_cache'] . '/' . 'cache_rss_array.dat';
    $liste = array();
    if (!file_exists($fcache)) {
        require_all();
        $GLOBALS['db_handle'] = open_base($GLOBALS['db_location']);
        rafraichir_cache();
    }
    // this function exists in SQLI.PHP. It is replaced here, because including sqli.php and the other files takes 10x more cpu load than this
    if (file_exists($fcache)) {
        $liste = unserialize(base64_decode(substr(file_get_contents($fcache), strlen('<?php /* '), -strlen(' */'))));
        if (!is_array($liste)) {
            $liste = array();
            unlink($fcache);
        }
    }
    $liste_rss = array();
    $modes_url = '';
    if (!empty($_GET['mode'])) {
        $found = 0;
示例#6
0
define('EXT', '.php');
//define('__ROOT__', dirname( dirname(__FILE__) ) . DS );
define('__ROOT__', '.' . DS);
define('__ADMIN__', dirname(dirname(__FILE__)) . DS . 'front' . DS);
@session_start();
// Autoloader
require_once dirname(__FILE__) . '/vendor/autoload.php';
// Config
require_once dirname(__FILE__) . '/config.php';
// Debug
require_once dirname(__FILE__) . '/debug.php';
// Models
require_all(dirname(__FILE__) . '/api/Includes');
require_all(dirname(__FILE__) . '/api/Model');
require_all(dirname(__FILE__) . '/services');
require_all(dirname(__FILE__) . '/helpers');
# add Configuration
// Create Application
$app = new \api\App($config['app']);
// Only invoked if mode is "api"
$app->configureMode('api', function () use($app) {
    $app->config(array('view' => new api\View\JsonApiView(), 'log.enable' => true, 'log.level' => \Slim\Log::DEBUG, 'debug' => false));
});
// Only invoked if mode is "production"
$app->configureMode('production', function () use($app) {
    $app->config(array('base' => $app->request->getScriptName(), 'log.enable' => true, 'log.level' => \Slim\Log::WARN, 'debug' => false));
});
// Only invoked if mode is "development"
$app->configureMode('development', function () use($app) {
    $app->config(array('base' => dirname($app->request->getScriptName()) . '/www', 'log.enable' => true, 'log.level' => \Slim\Log::DEBUG, 'debug' => true));
});
示例#7
0
function require_all($path, $recursive = true)
{
    foreach (scandir($path) as $fname) {
        if (!preg_match("/^\\./", $fname)) {
            if (is_file($path . $fname)) {
                require_once $path . $fname;
            } else {
                if ($recursive && is_dir($path . $fname)) {
                    require_all($path . $fname . "/", true);
                }
            }
        }
    }
}
示例#8
0
文件: loader.php 项目: necota/pachira
<?php

// -*- mode: php; -*-
/* load system */
require_once SYSTEM_DIR . "functions.php";
require_once SYSTEM_DIR . "classes/request.php";
require_once SYSTEM_DIR . "classes/session.php";
require_once SYSTEM_DIR . "classes/pachira.php";
/* load application */
require_all(APPLICATION_DIR . "plugins/", false);
require_all(APPLICATION_DIR . "models/", true);
require_once APPLICATION_DIR . "bootstrap.php";
示例#9
0
     if (require_all($data, array('auth', 'names', 'locations', 'epiweeks'))) {
         if ($_REQUEST['auth'] === $AUTH['sensors']) {
             // parse the request
             $names = extract_values($_REQUEST['names'], 'str');
             $locations = extract_values($_REQUEST['locations'], 'str');
             $epiweeks = extract_values($_REQUEST['epiweeks'], 'int');
             // get the data
             $epidata = get_sensors($names, $locations, $epiweeks);
             store_result($data, $epidata);
         } else {
             $data['message'] = 'unauthenticated';
         }
     }
 } else {
     if ($source === 'nowcast') {
         if (require_all($data, array('locations', 'epiweeks'))) {
             // parse the request
             $locations = extract_values($_REQUEST['locations'], 'str');
             $epiweeks = extract_values($_REQUEST['epiweeks'], 'int');
             // get the data
             $epidata = get_nowcast($locations, $epiweeks);
             store_result($data, $epidata);
         }
     } else {
         if ($source === 'meta') {
             // get the data
             $epidata = get_meta();
             store_result($data, $epidata);
         } else {
             $data['message'] = 'no data source specified';
         }
示例#10
0
<?php

namespace Eventio;

require_once __DIR__ . '/BBQException.php';
require_once __DIR__ . '/BBQ/Job/JobInterface.php';
require_once __DIR__ . '/BBQ/Job/Job.php';
require_once __DIR__ . '/BBQ/Queue/QueueInterface.php';
require_all(__DIR__ . '/BBQ/Job/');
require_all(__DIR__ . '/BBQ/Job/Payload/');
require_all(__DIR__ . '/BBQ/Queue/');
use Eventio\BBQ\BBQException;
use Eventio\BBQ\Job\JobException;
use Eventio\BBQ\Job\JobInterface;
use Eventio\BBQ\Job\Payload\JobPayloadInterface;
use Eventio\BBQ\Job\Payload\StringPayload;
use Eventio\BBQ\Queue\QueueInterface;
function require_all($path)
{
    foreach (glob($path . '*.php') as $filename) {
        require_once $filename;
    }
}
/**
 * @author Ville Mattila <*****@*****.**>
 */
class BBQ
{
    /**
     * @var array
     */