Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<?php
/* Copyright by Chun Kang (ck@qsok.com)
* 
* @file __env.php
* @brief environments for staging and production \n
* @author Chun Kang (ck@qsok.com)
*
*
* @notes
* 2018.11.13 created
* 
**/

if (! defined('__CK_ENV__')) {
// Basic DB Library ------------------------------------------------------------------------------------------------------

	define( '__CK__ENV__', 'RUNTIME_ENVIRONMENT_ESTABLISHED');

	if (preg_match( "/staging/", getcwd())) // checking if the environment is staging or not by the current working directory
	{
		// define include path to load necessary from staging environment
		set_include_path( ".:/web/staging_server");
	}
	else
	{
		set_include_path( ".:/web/production_server");

		error_reporting(0); // turn off all error reporting
	}

// End of Basic DB Library ------------------------------------------------------------------------------------------------------
}

?>

...