Esempio n. 1
0
<?php

require __DIR__ . '/vendor/autoload.php';
define('DOCUMENT_ROOT', dirname(__FILE__));
gc_enable();
use Movim\Bootstrap;
//memprof_enable();
$bootstrap = new Bootstrap();
$booted = $bootstrap->boot();
$loop = React\EventLoop\Factory::create();
$connector = new React\SocketClient\TcpConnector($loop);
$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 = \Movim\Widget\Wrapper::getInstance();
$wrapper->registerAll($bootstrap->getWidgets());
fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " widgets : " . \sizeToCleanSize(memory_get_usage()) . "\n");
$conn = null;
$parser = new \Moxl\Parser();
$buffer = '';
$timestamp = time();
function handleSSLErrors($errno, $errstr)
{
    fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " : " . colorize($errstr, 'red') . "\n");
}
// Temporary linker killer
$loop->addPeriodicTimer(5, function () use(&$conn, &$timestamp) {
    if ($timestamp < time() - 3600 * 6) {
        $conn->close();
    }
});
Esempio n. 2
0
#!/usr/bin/php
<?php 
require __DIR__ . '/vendor/autoload.php';
define('DOCUMENT_ROOT', dirname(__FILE__));
use Movim\Bootstrap;
use Movim\Console\DatabaseCommand;
use Movim\Console\ConfigCommand;
use Symfony\Component\Console\Application;
$bootstrap = new Bootstrap();
$bootstrap->boot();
$application = new Application();
$application->add(new DatabaseCommand());
$application->add(new ConfigCommand());
$application->run();