Esempio n. 1
12
function setCommonConfig(Config &$config, $serverName = null)
{
    // Config that can be carried over to any server
    if (empty($serverName) && isset($_SERVER["SERVER_NAME"])) {
        $serverName = $_SERVER["SERVER_NAME"];
    }
    // clientAndServer configs are readable via javascript.
    if ($serverName == 'localhost' || $serverName == 'test') {
        $serverConfigAdd = array('imagecachesPath' => BASE_PATH . 'images/cache/', 'isDevMode' => false, 'logSql' => false);
        $clientAndServerConfigAdd = array('baseUrl' => 'http://localhost/skully-project/', 'publicDir' => 'public/');
    } else {
        $serverConfigAdd = array('imagecachesPath' => BASE_PATH . 'images/cache/', 'isDevMode' => false, 'logSql' => false);
        $clientAndServerConfigAdd = array('baseUrl' => 'http://onlinesite.com/', 'publicDir' => 'public/');
    }
    $config_r = array_merge(array('freeze' => true, 'namespace' => 'App', 'caching' => 2, 'maintenance' => false, 'maintenanceIp' => '139.195.146.93', 'notFoundPath' => 'home/notFound', 'maintenancePath' => 'home/maintenance', "dateFormatDb" => "Y-m-d H:i:s", 'dateFormat' => 'd M Y', 'longDateTimeFormat' => 'M j, Y h:i A', 'shortDateTimeFormat' => 'd/m H:i', 'longDateFormat' => 'M j, Y', 'shortDateFormat' => 'd/m', 'adminLongDateTimeFormat' => 'd/m/Y H:i', 'adminLongDateFormat' => 'd/m/Y', 'urlRules' => array('' => 'home/index', 'admin' => 'admin/home/index', 'admin/index' => 'admin/home/index', 'admin/loginProcess' => 'admin/admins/loginProcess', 'admin/login' => 'admin/admins/login'), 'language' => 'en', 'languages' => array('en' => array('value' => 'english', 'code' => 'en')), 'smtpPort' => '465', 'smtpHost' => 'smtp.google.com', 'smtpPassword' => 'password', 'smtpUsername' => '*****@*****.**', 'senderEmail' => '*****@*****.**', 'senderName' => 'SenderName', 'replyToEmail' => '*****@*****.**', 'replyToName' => 'yoursite.com Contact', 'smtpSecurity' => 'ssl', 'basePath' => BASE_PATH, 'globalSalt' => 'hakunamatata', 'ruckusingConfig' => array('migrations_dir' => array('default' => BASE_PATH . 'migrations'), 'db_dir' => BASE_PATH . 'db', 'log_dir' => BASE_PATH . 'logs' . DIRECTORY_SEPARATOR . 'migrations', 'ruckusing_base' => RUCKUSING_BASE)), $serverConfigAdd);
    $clientAndServerConfig = array_merge(array('theme' => 'default', 'formDateFormat' => 'M d, yy', 'serverFormDateFormat' => "%b %e, %Y", 'formTimeFormat' => 'hh:mm TT', 'serverFormDateTimeFormat' => "%b %e, %Y %I:%M %p"), $clientAndServerConfigAdd);
    $config_r = array_merge($config_r, $clientAndServerConfig);
    $config->setProtectedFromArray($config_r);
    $clientConfig = array();
    $clientConfig = array_merge($clientConfig, $clientAndServerConfig);
    $config->setPublicFromArray($clientConfig);
}