Location: PHPKode > projects > phpWork > appconfig.inc
<?php

    /*********************************************************************************
     *                             LOAD CONTROLLER
     *********************************************************************************/
    include_once("system/controller.inc");



    /*********************************************************************************
     *                             CONFIG APPLICATION
     *********************************************************************************/
    $application = TApplication::createInstance();
    $application->setName("app-name1"); // change it to whatever you want
    $application->setCheckForSqlInjection(TRUE);
    $application->setDevMode(TRUE); // TRUE for development, FALSE for production
    $application->setDefaultLocale("en");



    /*********************************************************************************
     *                             CONFIG DATABASE
     *********************************************************************************/
    $dbRef = TPostgreSql::create("host=localhost dbname=db1 user=user1 password=pass1");
    $dbRef->setAutoConnect(TRUE);
    //$dbRef->setDebugMode(TRUE);
    //$dbRef->setPersistent(TRUE);

    $application->setDatabase($dbRef);



    /*********************************************************************************
     *                             CONFIG ERROR HANDLER
     *********************************************************************************/
    $application->errorHandler->setLogToFile(TRUE); // can be omitted, the default value is TRUE
    $application->errorHandler->setLogToScreen(FALSE); // can be omitted, the default value is FALSE
    //$application->errorHandler->start(); // uncomment this line for production mode, keep in mind this handler can't catch fatal errors



    /*********************************************************************************
     *                             CONFIG "WWW" APPLICATION CONTEXT
     *********************************************************************************/
    $appCtx = new TApplicationContext("www.mysite.com");
    $appCtx->addHostAlias("mysite.com");
    // $appCtx->setLookAndFeel("/assets/css/standard/index.php");
    // $appCtx->setLoginPage("/admin/login.php", "AdminToken"); // just a sample
    // $appCtx->addAuthPage("/admin/index.php", "AdminToken"); // just a sample
    // $appCtx->addAuthPage("/admin/(.*).php", "AdminToken"); // just a sample, this line makes the above one useless

    $application->addContext($appCtx);



    /*********************************************************************************
     *                             CONFIG CACHE
     *********************************************************************************/
    // TCache::setFileBased();



    /*********************************************************************************
     *            THE WIDGETS REGISTERED HERE WILL BE AVAILABLE FOR EVERY PAGE
     *********************************************************************************/
    //registerWidgets(Array("clock","date_field","data_grid"));
?>
Return current item: phpWork