<?php
// use \core\router as Router,
// \helpers\url as Url;
date_default_timezone_set('UTC');
/** is TEST set to true : localhost else site **/
define('TEST',false);
if(TEST){
	/* Folders paths definitions */
	define('CORE_PATH', 'core/');
	define('HELPER_PATH', 'helpers/');
	define('LANGUAGE_PATH', 'language/');
	define('CONTROLLER_PATH', 'controllers/');
	define('MODEL_PATH', 'models/');
	define('VIEW_PATH', 'views/');
}else{
	/* Folders paths definitions Uncomment on real site */
	define('CORE_PATH', '/home/rglxhost/public_html/date-in.com/core/');
	define('HELPER_PATH', '/home/rglxhost/public_html/date-in.com/helpers/');
	define('LANGUAGE_PATH', '/home/rglxhost/public_html/date-in.com/language/');
	define('CONTROLLER_PATH', '/home/rglxhost/public_html/date-in.com/controllers/');
	define('MODEL_PATH', '/home/rglxhost/public_html/date-in.com/models/');
	define('VIEW_PATH', '/home/rglxhost/public_html/date-in.com/views/');
}
/* may be use of composer (class loader, psr4...) will be better??? */
/* for now i'm requiring the autoloader that sets definitions and it's session */
require('core/autoloader.php');
/* Instance of system wide configuration */
new Config();
/** Mobile device routing **/
Router::any('mobile/msg_send', 'mobile@msg_send');
Router::any('mobile/msg_check', 'mobile@msg_check');
Router::any('mobile/msg_chat', 'mobile@msg_chat');
Router::any('mobile/login', 'mobile@login');
Router::any('mobile/reg', 'mobile@reg');
Router::any('mobile/inbox', 'mobile@inbox');
Router::any('mobile/pictures', 'mobile@pictures');
Router::any('mobile/edit', 'mobile@edit');
Router::any('mobile/info', 'mobile@info');
Router::any('mobile/users', 'mobile@users');
Router::any('mobile/image_upload', 'mobile@image_Upload');
Router::any('mobile/image_delete', 'mobile@image_Delete');

Router::any('', 'welcome@index');
/** Login routing **/
Router::any('login/login', 'login@login');
Router::any('login/logout', 'login@logout');
Router::any('login/register', 'login@register');
Router::any('login/register/action', 'login@register_action');
Router::any('login/verify/(:num)/(:any)', 'login@verify');
Router::any('login/forgotpassword', 'login@forgotpassword');
Router::any('login/changepassword', 'login@changepassword');
Router::any('login/passreset/(:num)/(:any)', 'login@passwordreset');
/** Users routing **/
Router::any('users', 'users@index');
Router::any('users/(:num)', 'users@id');
Router::any('users/search/(:num)', 'users@search');
/** Profile routing **/
Router::any('profile/index', 'profile@index');
Router::any('profile/inbox', 'profile@inbox');
Router::any('profile/inbox/(:num)', 'profile@inbox');
Router::any('profile/addimage', 'profile@addimage');
Router::any('profile/imgdelete', 'profile@imgdelete');
Router::any('profile/imgupdate', 'profile@imgupdate');
Router::any('profile/edit', 'profile@edit');
Router::any('profile/update', 'profile@update');
/* if no route found */
Router::error('error@index');
/* execute matched routes */
Router::dispatch();
/* end output buffering */
ob_flush();