Welcome Guest, Not a member yet? Register   Sign In
Put Extensions into a folder ?
#1

[eluser]MartinF[/eluser]
Hello,

is there any way i can put all my extensions of the system/libraries/ in a folder inside the application/libraries/ folder ?

For example I would like my MY_Form_validation extension to go into application/libraries/extensions/
instead of the root of the /libraries/ folder.

I would also like to get rid of the MY_ prefix, but changing the "subclass_prefix" to an empty string does not seem to work.

It does not work to put the folder name in front of the extensions it seems.


Best regards

Martin
#2

[eluser]toopay[/eluser]
Why you need to put it into subfolder? I mean, what for? I think 'libraries' folder is the best place for any library class file!

If you want to modify 'MY_' prefix, look at config.php under 'config' folder, find and replace this line
Code:
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries.  For more information please see the user guide:
|
| http://ellislab.com/codeigniter/user-guide/general/core_classes.html
| http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html
|
*/
//$config['subclass_prefix'] = 'MY_';
$config['subclass_prefix'] = 'EXTENSION_';
#3

[eluser]MartinF[/eluser]
Hello,

thanks for the answer.
I know how to change the subclass_prefix as i also mention in my post.

The reason why i want to put them in a folder is because i will have a lot of other Libraries and i dont want to mess it all up.

It would be nice to keep everything separated.

But i think i have come to the conclusion that I will just put all my own libraries in a subfolder and let the extensions of the system/libraries/ go into the root of application/libraries/.
#4

[eluser]toopay[/eluser]
If you use some prefix, lets say 'MY_', then in your directory structure, they already (automaticly) grouped right?
Code:
application - conrollers
              ...
              libraries - Awesomelib.php
                          Coollib.php
                          MY_Session.php
                          MY_Form_validation.php
                          MY_...php
                          Somelibrary.php
                          Xxxlib.php
                          
system      - ...
index.php
.htaccess
#5

[eluser]MartinF[/eluser]
Yeah,

but if you have +30 php files it is a mess.

But after putting all my own libraries into folders, it is okay.
Now only the system/libraries extensions are in the root.




Theme © iAndrew 2016 - Forum software by © MyBB