Example #1
0
function Flgn_iniSrc($url)
{
    try {
        global $Grot_path;
        # Fcom_setLogInfo( "debug" , "Flgn_iniSrc:".$Grot_path );
        $cont = Frot_getConts($url["type"], $url["cont"], $tgt);
        if (null === $cont) {
            Frot_jumpFirst();
            return;
        }
        Frot_setSession($tgt, true, false);
        $conts_lst = Frot_getContsList(array(DROT_STT_LGN, DROT_SUBSTT_INI));
        $chk_flg = true;
        foreach ($conts_lst as $key => $val) {
            $chk_flg = Frot_getSession($val);
            if (null === $chk_flg) {
                # Fcom_setLogInfo( "debug" , "null session:".$val );
                break;
            }
        }
        if (true === $chk_flg) {
            Frot_resetSession();
            Frot_setSession(DROT_SESROT_STT, DROT_STT_LGN);
            Frot_setSession(DROT_SESROT_SUBSTT, DROT_SUBSTT_RDY);
            Fcom_setLogInfo("debug", "ready");
        }
        echo $cont;
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}
Example #2
0
function Flgn_first()
{
    try {
        global $Grot_path;
        # Fcom_setLogInfo( "debug" , "Frot_lgnFirst : ".$Grot_path );
        $map = Net_URL_Mapper::getInstance();
        $map->connect('/:app/');
        $url = $map->match($Grot_path);
        if ($url) {
            if (0 === strcmp($url["app"], DROT_APP_NAME)) {
                /* '/ayawave/' request */
                $cont = Frot_getInit(DROT_INITTYP_BSC);
                Frot_setSession(DROT_SESROT_SUBSTT, DROT_SUBSTT_INI, true);
                echo $cont;
                return;
            } else {
                Frot_jumpFirst();
            }
        } else {
            Frot_jumpFirst();
        }
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}
Example #3
0
function Flgn_ctrl()
{
    try {
        global $Grot_path;
        global $Grot_state;
        # Frot_logSession();
        $sub_sts = Frot_getSession(DROT_SESROT_SUBSTT);
        if (null === $sub_sts) {
            Frot_setSession(DROT_SESROT_SUBSTT, DROT_SUBSTT_FST, false);
            $sub_sts = DROT_SUBSTT_FST;
        }
        if (0 === strcmp($sub_sts, DROT_SUBSTT_FST)) {
            # Fcom_setLogInfo( "debug" , "first:".$Grot_path );
            Flgn_first();
            return;
        } else {
            if (0 === strcmp($sub_sts, DROT_SUBSTT_INI)) {
                # Fcom_setLogInfo( "debug" , "init:".$Grot_path );
                Flgn_init();
                return;
            } else {
                if (0 === strcmp($sub_sts, DROT_SUBSTT_RDY)) {
                    # Fcom_setLogInfo( "debug" , "ready:".$Grot_path );
                    Flgn_ready();
                    return;
                } else {
                    Frot_jumpFirst();
                    return;
                }
            }
        }
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}
Example #4
0
function Flgn_ready()
{
    try {
        global $Grot_path;
        Fcom_setLogInfo("debug", "login ready:" . $Grot_path);
        $map = Net_URL_Mapper::getInstance();
        $map->connect('/:app/:func/:type/:cont');
        $url = $map->match($Grot_path);
        if ($url) {
            if (0 !== strcmp($url["app"], DROT_APP_NAME) || 0 !== strcmp($url["func"], DROT_FUNC_FNC)) {
                Frot_jumpFirst();
            }
            if (0 === strcmp($url["type"], DROT_FTYPE_ATH)) {
                $ret = Fath_ctrl($url["cont"]);
                echo json_encode($ret);
                return;
            }
        } else {
            # Fcom_setLogInfo( DCOM_LOGLV_ERR , "".$Grot_path );
            Fapp_jumpFirst();
        }
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}