CodeIgniter Forums
Problem with 2.0.1 environments - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with 2.0.1 environments (/showthread.php?tid=39674)

Pages: 1 2


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]carvingCode[/eluser]
I set a project I'm working on to use the 2.0.1 'environment' switch. I replaced the project's 'system' dir with a new 2.0.1 'system' dir. The project's index file has the ENVIRONMENT constant defined and the error_reporting switch statement.

I created a dir inside the config dir named 'development'. Placed my project's 'config', 'database', 'routes', and 'constants' config files in the new 'development' dir and replaced those with config files from a fresh 'config' dir (from 2.0.1).

When I launch the project in the browser, I get the following PHP error:

Code:
Warning: require(application/config/constants.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\_cogs\ci\system\core\CodeIgniter.php on line 56

Fatal error: require() [function.require]: Failed opening required 'application/config/constants.php' (include_path='.;C:\php5\pear') in C:\wamp\www\_cogs\ci\system\core\CodeIgniter.php on line 56

If I move the 'constants' file out into main 'config' dir, I get:

Code:
An Error Was Encountered

Unable to determine what should be displayed. A default route has not been specified in the routing file.

If I move 'routes' out into the main 'config' dir, the project loads correctly.

Question: Is this the intended behavior?

TIA


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]InsiteFX[/eluser]
That's strange, I just checked the codeigniter.php file and it checks first for the environment constants.php file!

Did you copy over the new index.php file?

InsiteFX


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]bubbafoley[/eluser]
I don't think it's intended.

the constants.php problem was fixed shortly after 2.0.1 released -- https://bitbucket.org/ellislab/codeigniter-reactor/changeset/ec9b4bcf1850

to fix the routes problem is here but hasn't been officially pulled yet. -- https://bitbucket.org/bubbafoley/codeigniter-routes-based-on-environments/changeset/918f22655f07


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]carvingCode[/eluser]
Insite - Yes, I used the new 'index'.

bubba - Thanks. I didn't think this feature was going to be so limited. Glad we'll get a fix. But, I downloaded 2.0.1 late morning today, so perhaps the 'constants' fix didn't get applied. Will wait for an announcement before doing anything else.

Thanks to both!


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]InsiteFX[/eluser]
Well I just tried it with CodeIgniter 2.0.1 not the Reactor!

And it works fine here.

No changes just clean install and copied the files over to development like you did!

InsiteFX


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]carvingCode[/eluser]
Right. I downloaded the 'Reactor' version, from here. Homepage -> upper right corner. Instead, I should have gone to 'Downloads'. The version under 'Downloads' seems to be the updated version. The 'Reactor' version is not.

Cornfusing.... Tongue

EDIT: Even with the other version, it does the same as I described above.


Problem with 2.0.1 environments - El Forum - 03-17-2011

[eluser]bubbafoley[/eluser]
yeah downloading from CodeIgniter.com is the 2.0.1 release version. The link I posted is a change that is yet to be released. Sorry for the confusion.


Problem with 2.0.1 environments - El Forum - 03-25-2011

[eluser]carvingCode[/eluser]
Has this fix been pulled into a release version yet?


Problem with 2.0.1 environments - El Forum - 03-25-2011

[eluser]videoinspector[/eluser]
why?


Problem with 2.0.1 environments - El Forum - 03-29-2011

[eluser]The Wizard[/eluser]
This is a crucial error and should have been fixed long ago.

I can't pull the constants too, changed CodeIgniter.php and now it works.