Welcome Guest, Not a member yet? Register   Sign In
CI3 core code bug
#3

@Ryuu

About get_instance(): CodeIgniter 2 & 3 uses the "God object" pattern, which at its early (no namespaced) times seems to be a natural choice. But IMO once a God object is used, it should be created first, and as the system bootstraps, the object's properties should have been added/modified gradually.

Currently, several classes are initialized first - Config, Loader, Router, etc., and after routing is resolved, the God object CI_Controller gets created with its full capabilities, however moment of creation is quite late. This is an architectural mistake (my opinion). Here you are additional thoughts: https://github.com/bcit-ci/CodeIgniter/i...t-54097544 Fixing this mistake would require lots of refactoring and testing, today this maybe is worthless.

If you badly need to do some hacking about system bootstrapping, see this comment and do something similar: https://github.com/bcit-ci/CodeIgniter/c...nt-6985684
Reply


Messages In This Thread
CI3 core code bug - by Ryuu - 01-12-2017, 03:59 AM
RE: CI3 core code bug - by ciadmin - 01-12-2017, 08:30 AM
RE: CI3 core code bug - by ivantcholakov - 01-12-2017, 12:24 PM
RE: CI3 core code bug - by Ryuu - 01-12-2017, 03:26 PM
RE: CI3 core code bug - by ciadmin - 01-12-2017, 08:50 PM
RE: CI3 core code bug - by Ryuu - 01-12-2017, 09:41 PM
RE: CI3 core code bug - by ivantcholakov - 01-12-2017, 11:57 PM
RE: CI3 core code bug - by Ryuu - 01-15-2017, 08:35 PM
RE: CI3 core code bug - by ciadmin - 01-15-2017, 10:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB