Welcome Guest, Not a member yet? Register   Sign In
FTP (and other class) Default Config Files

Hey everyone,

For a few of the CI classes, there is a variant of this line in the documentation:

Quote:Setting FTP Preferences in a Config File

If you prefer you can store your FTP preferences in a config file. Simply create a new file called the ftp.php, add the $config array in that file. Then save the file at config/ftp.php and it will be used automatically.

I was wondering if anyone knew if there is anywhere in the code where this specifically happens and these variables from the config file are initialized. I can't seem to find anything in the FTP, Loader or Config classes.

I know that there are a few classes that have this (I believe the Email class has one as well). I'm writing a class that would be great to use this feature with, but I'm at a loss of how to make that happen.

Any pointers would be appreciated!

[eluser]Phil Sturgeon[/eluser]
That actually happens in Loader::_ci_init_class(). Take a look at line 860.

To let the classes not dependent on the config class the settings are loaded as a class parameter.

The down side is that the settings aren't a part of the config class as the config file content is added to the class directly.

Thanks! There it is. I missed it in the Loader there.

That's too bad that the settings aren't part of the config class though. I guess it's handy in certain circumstances, though.

Theme © iAndrew 2016 - Forum software by © MyBB