Welcome Guest, Not a member yet? Register   Sign In
base_url really necessary?
#5

[eluser]John_Betong[/eluser]
I define a LOCALHOST constant and use extensively:
Code:
// config.php
  define('LOCALHOST', 'localhost' === $_SERVER['SERVER_NAME']);

  if (! defined('ADSENSE'))  define('ADSENSE', ( ! LOCALHOST));  // maybe used in views

  $config['log_date_format'] = 'Y-m-d H:i:s';
  define('LOG_FILE_TODAY', $config['log_path'] .'log-' .date('Y-m-d') .'.php'); // maybe used in views



// MY_Controller.php
  $this->output->enable_profiler(LOCALHOST);


// view
if (LOCALHOST AND file_exists(LOG_FILE_TODAY) AND (filesize(LOG_FILE_TODAY) > 42))
{
echo "<div style='float:right; position:fixed;top:10px;right:0;font-size:2.2em;color:#f00'>";
    echo 'YES we have errors';    
echo '</div>';    
}
&nbsp;
&nbsp;
&nbsp;


Messages In This Thread
base_url really necessary? - by El Forum - 06-16-2010, 02:28 AM
base_url really necessary? - by El Forum - 06-16-2010, 03:13 AM
base_url really necessary? - by El Forum - 06-16-2010, 03:22 AM
base_url really necessary? - by El Forum - 06-16-2010, 08:39 AM
base_url really necessary? - by El Forum - 06-16-2010, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB