Exemplo n.º 1
0
function Fapp_first()
{
    try {
        global $Grot_path;
        # Fcom_setLogInfo( "debug" , "app first:".$Grot_path );
        $map = Net_URL_Mapper::getInstance();
        $map->connect('/:app/');
        $url = $map->match($Grot_path);
        if ($url) {
            /* match */
            /* check func */
            if (0 === strcmp($url["app"], DROT_APP_NAME)) {
                /* '/ayawave' request */
                $cont = Frot_getInit(DROT_INITTYP_BSC);
                Frot_setSession(DROT_SESROT_SUBSTT, DROT_SUBSTT_INI, false);
                echo $cont;
                return;
            } else {
                /* func is not app */
                Fapp_jumpFirst();
            }
        } else {
            Fapp_jumpFirst();
        }
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}
Exemplo n.º 2
0
function Fapp_ready()
{
    try {
        global $Grot_path;
        # Fcom_setLogInfo( "debug" , "Fapp_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)) {
                Fcom_setLogInfo(DCOM_LOGLV_ERR, "invalid function " . $Grot_path);
                Fapp_jumpFirst();
            }
            if (0 === strcmp($url["func"], DROT_FUNC_SRC)) {
                Fapp_rdySrc($url);
            } else {
                if (0 === strcmp($url["func"], DROT_FUNC_FNC)) {
                    Fapp_rdyFunc($url);
                }
            }
        } else {
            $map->reset();
            $map->connect("/:app/:type");
            $url = $map->match($Grot_path);
            if ($url) {
                if (0 !== strcmp($url["app"], DROT_APP_NAME)) {
                    Fapp_jumpFirst();
                }
                if (0 === strcmp($url["type"], "item")) {
                    if (0 === strcmp($_GET["func"], "new")) {
                        echo Frot_getInit(DROT_INITTYP_NEW);
                    } else {
                        if (0 === strcmp($_GET["func"], "edit")) {
                            echo Frot_getInit(DROT_INITTYP_EDT);
                        }
                    }
                }
            } else {
                Fapp_jumpFirst();
            }
        }
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}