Welcome Guest, Not a member yet? Register   Sign In
Overwrite core library and change this library methods as well
#1

[eluser]Volder[/eluser]
Hello,

I want to overwrite the core Session library, which is in
system/libraries/Session.php

So for this purpose I put my Session.php file into system/application/libraries/

I'm using CI_Session class name in this, so that the core Session is overwritten. Until this everything is fine. New session library is used.

The next step what I would like to have is to amend some methods in the new Session library, but as this file is an external for me (developped by third paries) I want to put my fixes separately, so that it would be easily compatible with future releases.

I create MY_Session.php in system/application/libraries/ where I put the needed functions.
But after this - the session class which is loaded is from system/libraries/Session.php, but not from system/application/libraries/Session.php

Is there any way to achieve what I would like without putting fixes directly to system/application/libraries/Session.php?
#2

[eluser]Phil Sturgeon[/eluser]
You can't have both an overridden library and an extended library in the application/library folder. Can you not put their fixes into your overridden class?

If not, just directly include the MY_Session class at the bottom of the CI_Session library. Might work Undecided
#3

[eluser]Volder[/eluser]
ok, thanks.

As there is no other workaround for this, I will put it directly in the new library file.




Theme © iAndrew 2016 - Forum software by © MyBB