CodeIgniter Forums
Extending codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Extending codeigniter (/showthread.php?tid=66102)



Extending codeigniter - sawbo - 09-05-2016

Hi,

I want to know what is the best method to extend codeigniter and be able to update codeigniter without overriding my own dev.

I mean isolate the core of codeigniter.?


RE: Extending codeigniter - InsiteFX - 09-06-2016

Don't change any files in the core that simple.


RE: Extending codeigniter - dave friend - 09-06-2016

To elaborate on what @InsiteFX said: The "core" files are those found in the "system" directory. When a new version of CI is released it typically means replacing all the files/folders in that directory. So, don't mess with them. If you need to extend or replace any of the "system" files with your own version, or if you want to create your own libraries then follow the guidelines provided by the CI documentation.

The files/folders in the "application" directory don't often need replacement in a upgrade. The "Upgrading from a Previous Version" instructions that accompany each new version will usually make clear what, if any, changes are required in the "application" files.


RE: Extending codeigniter - dmyers - 09-06-2016

I think what you are looking for is this:

http://www.codeigniter.com/user_guide/general/creating_libraries.html#extending-native-libraries

"Extending Native Libraries"

DMyers


RE: Extending codeigniter - spjonez - 09-06-2016

Don't edit files in the system folder and follow the section here on extending core classes. When you upgrade CI you'll need to check if the methods you've overloaded/redefined have changed and patch them appropriately.


RE: Extending codeigniter - sawbo - 09-06-2016

thanks for all answer. I will push a little bit further!

1- I want to be able to update the core
2- I want to add my layer. like my admin management that will be the same for all project. so be able to update/manage git, for this packae, module.
3- the custom layer of each project. git/management


RE: Extending codeigniter - dave friend - 09-07-2016

The answer to your "push" is in the documentation links everybody has been providing and this includes how to create your own libraries (a.k.a. package, module). Any custom libraries you create are easily copied into any other project by any means that will deliver files where you want them.