Exemple #1
0
 */
require_once 'config/config.php';
require_once 'config/route.php';
// Create Upload Directory if Not Exist
if (!is_dir(UPLOAD_DIR)) {
    mkdir(UPLOAD_DIR, 0777);
}
if (php_sapi_name() == 'cli') {
    system_log('cli execute');
    $ControllerFile = DIR_CONTROLLER . DS . 'socket.php';
    require_once $ControllerFile;
    $Controller = new Socket();
    $input = array();
    $input['key'] = 'app_secreat_key';
    $input['command'] = $argv[1];
    $response = $Controller->socketServer($input);
    die(json_encode($response));
}
$GET = array();
$GET[0] = $Url->getUrlSegment(0);
//$GET = explode('/',$GET);
$isApiRequest = isset($GET[0]) && strtolower($GET[0]) == 'api' ? true : false;
//$isAdmin = isset($GET[0])&&strtolower($GET[0])=='admin'?true:false;
if ($isApiRequest) {
    /////*****	 API		*****/////
    require_once DIR_SYS . DS . 'core' . DS . 'class.api-request.php';
    require_once BASE_PATH . '/api/route.api.php';
    require_once BASE_PATH . '/api/index.php';
    return true;
    /////*****	/API		*****/////
} else {