/** * 初始化框架 * * @param unknown_type $appPath */ public function init($appPath) { define('DS', DIRECTORY_SEPARATOR); define('PS', PATH_SEPARATOR); $libs = dirname(dirname(__FILE__)); //注册自动加载并加载框架运行的必须类 $this->_autoload($libs); $dr = $_SERVER['DOCUMENT_ROOT'] . DS; $dr = Hi_Tool_Dir::standard($dr); $appPath = realpath($appPath); define('DOC_ROOT', $dr); Hi_Env::$DOC_ROOT = $dr; $this->_setApp($appPath); if (class_exists('Bootstrap') && is_subclass_of('Bootstrap', 'Hi_Bootstrap')) { Bootstrap::boot(); } }
* Movim's core is designed to ease the implementation of XMPP web-based clients, * using massively asynchronous javascript and abstracting XMPP calls into an * events-based API. */ define('DOCUMENT_ROOT', dirname(__FILE__)); require_once DOCUMENT_ROOT . '/bootstrap.php'; use Monolog\Logger; use Monolog\Handler\SyslogHandler; try { if (isset($_GET['q']) && $_GET['q'] == 'admin' || isset($_GET['query']) && $_GET['query'] == 'admin') { define('FAIL_SAFE', true); } else { define('FAIL_SAFE', false); } $bootstrap = new Bootstrap(); $bootstrap->boot(); $rqst = new FrontController(); $rqst->handle(); WidgetWrapper::getInstance(false); // Closing stuff WidgetWrapper::destroyInstance(); } catch (Exception $e) { $log = new Logger('movim'); $log->pushHandler(new SyslogHandler('movim')); $log->addInfo($e->getMessage()); if (ENVIRONMENT === 'development' && !FAIL_SAFE) { ?> <div id="final_exception" class="error debug"> <h2>An error happened</h2> <p><?php print $e->getMessage();
<?php require __DIR__ . '/vendor/autoload.php'; define('DOCUMENT_ROOT', dirname(__FILE__)); require_once DOCUMENT_ROOT . '/bootstrap.php'; gc_enable(); $bootstrap = new Bootstrap(); $booted = $bootstrap->boot(); $loop = React\EventLoop\Factory::create(); $dnsResolverFactory = new React\Dns\Resolver\Factory(); $dns = $dnsResolverFactory->createCached('8.8.8.8', $loop); $connector = new React\SocketClient\Connector($loop, $dns); $stdin = new React\Stream\Stream(STDIN, $loop); fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " widgets before : " . \sizeToCleanSize(memory_get_usage()) . "\n"); // We load and register all the widgets $wrapper = WidgetWrapper::getInstance(); $wrapper->registerAll(true); fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " widgets : " . \sizeToCleanSize(memory_get_usage()) . "\n"); $conn = null; $parser = new \Moxl\Parser(); $buffer = ''; $stdin_behaviour = function ($data) use(&$conn, $loop, &$buffer, &$connector, &$xmpp_behaviour, &$parser) { if (substr($data, -1) == "") { $messages = explode("", $buffer . substr($data, 0, -1)); $buffer = ''; foreach ($messages as $message) { #fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received from the browser', 'green')."\n"); $msg = json_decode($message); if (isset($msg)) { if ($msg->func == 'message' && $msg->body != '') { $msg = $msg->body;
* If we are run from another directory, try to change the current * working directory to a directory the script is in */ if (@(!file_exists(getcwd() . '/' . basename($argv[0])))) { chdir(dirname(__FILE__)); } # if require_once "lib/SpotClassAutoload.php"; SpotClassAutoload::register(); require_once "lib/Bootstrap.php"; /* * Create a DAO factory. We cannot use the bootstrapper here, * because it validates for a valid settings etc. version. */ $bootstrap = new Bootstrap(); list($settings, $daoFactory, $req) = $bootstrap->boot(); /* Retrieve the current list */ $conn = $daoFactory->getConnection(); $resultList = $conn->arrayQuery("SELECT mc.tmdb_id\n FROM mastercollections mc\n WHERE tmdb_id IS NOT NULL\n ORDER BY tmdb_id"); $startTime = time(); $counter = 0; $svcTmdbInfo = new Services_MediaInformation_TheMovieDb($daoFactory, $settings); $daoTmdb = $daoFactory->getTmdbInfo(); $prevTmdbId = null; foreach ($resultList as $mc) { if ($prevTmdbId != $mc['tmdb_id']) { echo "Fetching TMDB id: " . $mc['tmdb_id'] . ", "; $svcTmdbInfo->setSearchid($mc['tmdb_id']); $tmdb = $svcTmdbInfo->retrieveInfo(); $counter++; if ($tmdb !== null) {
<?php /** * Global parameters * Do NOT use global variables, it makes baby Jesus cry. Use Config! * * @author Christophe Gosiau <*****@*****.**> * @author Gerry Demaret <*****@*****.**> * @author David Vandemaele <*****@*****.**> */ require_once dirname(__FILE__) . '/../lib/base/Bootstrap.php'; Bootstrap::boot();