Пример #1
0
/*
    Set the platform objects location
 */
PUBLIC int httpSetPlatformDir(cchar *path)
{
    Http    *http;

    http = HTTP;
    if (path) {
        if (mprPathExists(path, X_OK)) {
            http->platformDir = mprGetAbsPath(path);
        } else {
            /*
                Possible source tree platform directory
             */
            http->platformDir = mprJoinPath(mprGetPathDir(mprGetPathDir(mprGetPathDir(mprGetAppPath()))), path);
            if (!mprPathExists(http->platformDir, X_OK)) {
                http->platformDir = mprGetAbsPath(path);
            }
        }
    } else {
        http->platformDir = mprGetPathDir(mprGetPathDir(mprGetAppPath()));
    }
    return 0;
}
Пример #2
0
/*  
    Get the application's executable filename.
    static function get exePath(): Path
 */
static EjsPath *app_exePath(Ejs *ejs, EjsObj *unused, int argc, EjsObj **argv)
{
    return ejsCreatePathFromAsc(ejs, mprGetAppPath());
}
Пример #3
0
/*
 *  Get the application's executable filename.
 *
 *  static function get exePath(): Path
 */
static EjsVar *exePath(Ejs *ejs, EjsObject *unused, int argc, EjsVar **argv)
{
    return (EjsVar*) ejsCreatePath(ejs, mprGetAppPath(ejs));
}