Exemplo n.º 1
0
<?php

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
mysqli_report(MYSQLI_REPORT_ALL);
//autoload classes
require_once $_SERVER['DOCUMENT_ROOT'] . "/Abstract/libs/models/classes/autoloadManager.php";
$autoloadManager = new AutoloadManager();
$autoloadManager->setSaveFile($_SERVER['DOCUMENT_ROOT'] . '/Abstract/libs/settings/autoload.inc');
$autoloadManager->addFolder($_SERVER['DOCUMENT_ROOT'] . '/Abstract/libs/models');
$autoloadManager->register();
//instantiate Db connection
$db = new Mysqlidb('localhost', 'root', '', 'local');
//initiate secondary DB
$secondary_db = new Mysqlidb('localhost', 'root', '', 'test');
Exemplo n.º 2
0
 *
 * @version    1.00
 * @create     2014/06/09 18:14:27
 * @update     2014/06/09 18:14:36
 * @author     seki
 * @copyright  (C)2014 seki All Rights Reserved
 * @since      none
 * @package    none
 * @link       none
 * @see        none
 * @deprecated none
 */
try {
    define("DIR_ENTRY", dirname(__FILE__));
    define("DS", DIRECTORY_SEPARATOR);
    include DIR_ENTRY . DS . 'autoloadManager.php';
    $autoloadManager = new \AutoloadManager();
    $autoloadManager->setSaveFile(DIR_ENTRY . DS . 'autoload.php');
    $autoloadManager->addFolder(DIR_ENTRY . "hgoe");
    $autoloadManager->register();
    //include(dirname(__FILE__) . "./SplClassLoader.php");
    //$classLoader = new SplClassLoader('A9b\Battle', dirname(dirname(dirname(__FILE__))));
    //$classLoader->register();
    $skill = new field();
    echo "<pre>";
    var_dump($skill);
    exit;
} catch (\Exception $e) {
    var_dump($e);
}
//try
Exemplo n.º 3
0
<?php

session_start();
ob_start();
@(include_once MPATH_INCLUDES . 'auto_loader.php');
$autoloadManager = new AutoloadManager();
$autoloadManager->setSaveFile(MPATH_INCLUDES . 'autoload.php');
$autoloadManager->addFolder(MPATH_INCLUDES);
$autoloadManager->addFolder(MPATH_LIBRARIES);
$autoloadManager->addFolder(MPATH_MODULES);
$autoloadManager->register();
// ---------------------------------------------------
//  Configuration Database
// ---------------------------------------------------
$db_host = MCfg::get('host');
// server name
$db_user = MCfg::get('user');
// user name
$db_pass = MCfg::get('pass');
// password
$db_dbname = MCfg::get('database');
$db = new MySQL(true, $db_dbname, $db_host, $db_user, $db_pass);
Exemplo n.º 4
0
 * See the GNU Lesser General Public License for more details.
 */
/**
 * File:        init.php
 * Project:     DHL API
 *
 * @author      Al-Fallouji Bashar
 * @version     0.1
 *
 * Initialize API (autloader and configuration file)
 * Simply include this file in order to use the DHL API
 */
define('DHL_API_DIR', __DIR__ . '/');
require_once DHL_API_DIR . 'vendor/autoloadManager/autoloadManager.php';
// Load adequate configuration file based on the APPLICATION_ENVIRONMENT
if ($applicationEnvironment = getenv('APPLICATION_ENVIRONMENT')) {
    $configFilename = 'config-' . $applicationEnvironment . '.php';
} else {
    $configFilename = 'config.php';
}
//Allow to place the config file anywhere in project
if (!defined('DHL_CONF_API_DIR')) {
    define('DHL_CONF_API_DIR', __DIR__ . '/');
}
$config = (require DHL_CONF_API_DIR . 'conf/' . $configFilename);
$scanOption = isset($config['autoloader']['scanOption']) ? $config['autoloader']['scanOption'] : autoloadManager::SCAN_ONCE;
$autoloadDir = isset($config['autoloader']['dir']) ? $config['autoloader']['dir'] : sys_get_temp_dir() . '/dhl-api-autoload.php';
$autoloadManager = new AutoloadManager($autoloadDir, $scanOption);
$autoloadManager->addFolder(DHL_API_DIR . 'vendor');
$autoloadManager->addFolder(DHL_API_DIR . 'DHL');
$autoloadManager->register();