public function __construct()
 {
     $this->ROOT = realpath(dirname(__FILE__) . '/../../../');
     //imports
     require_once $this->ROOT . '/inc/config.inc.php';
     Bootstrap::start();
     $this->db = Database::obtain(INIT::$DB_SERVER, INIT::$DB_USER, INIT::$DB_PASS, INIT::$DB_DATABASE);
     $this->db->connect();
     //init params
     $this->path = $this->ROOT . '/lib/Utils/converter_checker';
     $resultSet = $this->db->fetch_array(self::selectAllNotOffline);
     if (empty($resultSet)) {
         self::_prettyEcho("------------------------------------");
         self::_prettyEcho("************* WARNING **************");
         self::_prettyEcho("------------------------------------");
         $this->alertForEmptyPool();
         die(1);
     }
     foreach ($resultSet as $conv) {
         //            self::$ipLog = $conv[ 'ip_converter' ];
         $this->resultSet[$conv['ip_converter']] = $conv;
         $this->host_machine_map[$conv['ip_converter']] = array('ip_machine_host' => $conv['ip_machine_host'], 'machine_host_user' => $conv['machine_host_user'], 'machine_host_pass' => $conv['machine_host_pass'], 'instance_name' => $conv['instance_name']);
         //            self::_prettyEcho( "Retrieving Processes Info on " . $conv[ 'ip_converter' ] );
         //            $converter_json_top = self::getNodeProcessInfo( $conv[ 'ip_converter' ] );
         //            if ( !empty( $converter_json_top ) ) {
         //                $this->convertersTop[ $conv[ 'ip_converter' ] ] = array(
         //                    'converter_load'     => $converter_json_top[ 0 ],
         //                    'converter_json_top' => $converter_json_top[ 1 ]
         //                );
         //            }
     }
     $this->converterFactory = new FileFormatConverter();
 }
Ejemplo n.º 2
0
 public static function run()
 {
     self::$start = microtime();
     self::prepare();
     self::parseDomain();
     $response = self::$frontController->dispatch();
     self::sendResponse($response);
     self::logStats();
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     if (!class_exists("INIT")) {
         include_once "../../inc/config.inc.php";
         Bootstrap::start();
     }
     $this->opt['httpheader'] = array("Content-Type:multipart/form-data;charset=UTF-8");
     $this->lang_handler = Langs_Languages::getInstance();
     $this->conversionObject = new ArrayObject(array('ip_machine' => null, 'ip_client' => null, 'path_name' => null, 'file_name' => null, 'path_backup' => null, 'file_size' => 0, 'direction' => null, 'error_message' => null, 'src_lang' => null, 'trg_lang' => null, 'status' => 'ok', 'conversion_time' => 0), ArrayObject::ARRAY_AS_PROPS);
     $db = Database::obtain();
     $converters = $db->fetch_array("SELECT ip_converter, cpu_weight, ip_storage, segmentation_rule FROM converters WHERE status_active = 1 AND status_offline = 0");
     foreach ($converters as $converter_storage) {
         self::$converters[$converter_storage['ip_converter']] = $converter_storage['cpu_weight'];
         self::$Storage_Lookup_IP_Map[$converter_storage['ip_converter']] = $converter_storage['ip_storage'];
         self::$converter2segmRule[$converter_storage['ip_converter']] = $converter_storage['segmentation_rule'];
     }
     //        self::$converters = array('10.11.0.98' => 1);//for debugging purposes
     //        self::$Storage_Lookup_IP_Map = array('10.11.0.98' => '10.11.0.99');//for debugging purposes
     $this->storage_lookup_map = self::$Storage_Lookup_IP_Map;
 }
Ejemplo n.º 4
0
<?php

if (!@(include_once 'inc/Bootstrap.php')) {
    header("Location: configMissing");
}
Bootstrap::start();
$db = Database::obtain(INIT::$DB_SERVER, INIT::$DB_USER, INIT::$DB_PASS, INIT::$DB_DATABASE);
$db->connect();
Log::$uniqID = isset($_COOKIE['PHPSESSID']) ? substr($_COOKIE['PHPSESSID'], 0, 13) : uniqid();
$controller = controller::getInstance();
$controller->doAction();
$controller->finalize();
$db->close();
Ejemplo n.º 5
0
<?php

/*  
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; under version 2
 * of the License (non-upgradable).
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
 *               2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
 * 
 */
require_once dirname(__FILE__) . '/../../tao/includes/class.Bootstrap.php';
$bootStrap = new Bootstrap('taoCampaign');
$bootStrap->start();
Ejemplo n.º 6
0
<?php

session_start();
require_once 'config.php';
require_once 'controllers/bootstrap.php';
require_once 'controllers/controller.php';
//$controller = new Controller();
//$controller->start();
$bootstrap = new Bootstrap();
$bootstrap->start();
?>


Ejemplo n.º 7
0
<?php

error_reporting(E_ERROR & ~E_NOTICE);
include '../application/Bootstrap.php';
$boot = new Bootstrap();
$boot->start();