Welcome Guest, Not a member yet? Register   Sign In
constants core codeigniter
#1

hello guys!
i will say something less important but i want help,
i'm changed my folders as usual:

config/development/constants.php
config/development/database.php
config/development/config.php
config/production/constants.php
config/production/database.php
config/production/config.php

this work in CI 2, but in CI 3 this practice give me an error where constants not found on line 70 of codeigniter.php in core.

my solution is change this:

if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
{
require(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
}
require(APPPATH.'config/constants.php');

for this:
if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/constants.php'))
{
require(APPPATH.'config/'.ENVIRONMENT.'/constants.php');
}
else
{
require(APPPATH.'config/constants.php');
}
Reply
#2

I believe the purpose of this was to have constants in APPATH . 'config/constants.php' which don't change per environment, then the constants.php files in your environments directories can define just those constants which will change per environment.

After all, it would be unusual to change more than a handful of the constants defined in the file included with CI based on the environment.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB