Skip to content

Instantly share code, notes, and snippets.

@ken-muturi
Last active July 8, 2016 08:05
Show Gist options
  • Save ken-muturi/0fb7283282f4f29157ee05f4c6f9e4b2 to your computer and use it in GitHub Desktop.
Save ken-muturi/0fb7283282f4f29157ee05f4c6f9e4b2 to your computer and use it in GitHub Desktop.
ODK config
<?php
preg_match_all("/\/([^\/]+)\//i", $_SERVER['REQUEST_URI'], $match);
define('REQUEST_URI', $_SERVER['REQUEST_URI']);
define('BASE_DIR', $match[1][0] . '/');
define ('FS_PATH', str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'] . '/' . BASE_DIR));
define ('BASE_URL', 'http://' . str_replace('//', '/', $_SERVER['SERVER_NAME'] . '/' . BASE_DIR));
/* Log stuff */
error_reporting(E_ALL);
ini_set('log_errors', 'On');
ini_set('error_log', BASE_DIR . 'logs/'.date('d-m-Y') . '.log');
ini_set('log_level', 4);
set_error_handler(function($errno, $errstr, $errfile, $errline )
{
error_log( "$errno, $errstr, $errfile, $errline");
echo "<pre>";
echo("Error : " . $errstr);
echo "FILE : $errfile, $errline";
echo "</pre>";
exit();
});
$realm = 'PHP ODK Aggregate';
$users = array('admin' => 'mypass', 'guest' => 'guest');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment