CodeIgniter Forums
Rather silly question - extending core library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Rather silly question - extending core library (/showthread.php?tid=70873)



Rather silly question - extending core library - rtofnt - 06-12-2018

Hi everyone, 
I tho up to now I know codeigniter very well ... well - I don't. 
I have some CMS system build using CI2.0 + DataMapper (I know, I know - but I'm just employee) and trying to add some function to Upload library, so I can do:

PHP Code:
$this->upload->something($some_data); 

however adding in core folder MY_Upload that extends CI_Upload, throws an error. 
Is it possible in CI to extend Upload this way ?
Thanks - Matt.


RE: Rather silly question - extending core library - Wouter60 - 06-12-2018

Have a look at this:
https://www.codeigniter.com/userguide3/general/creating_libraries.html


RE: Rather silly question - extending core library - dave friend - 06-12-2018

Are you adding MY_Upload.php to /application/core/ or to system/core/?

It should be the former. Also check config.php and confirm that

PHP Code:
$config['subclass_prefix'] = 'MY_; 



RE: Rather silly question - extending core library - skunkbad - 06-12-2018

The upload class isn't a core file. It doesn't belong in core, it belongs in libraries.


RE: Rather silly question - extending core library - dave friend - 06-12-2018

(06-12-2018, 12:26 PM)skunkbad Wrote: The upload class isn't a core file. It doesn't belong in core, it belongs in libraries.

Well, ya. There is that. Confused