Welcome Guest, Not a member yet? Register   Sign In
CI Relative Paths
#1

[eluser]stevea[/eluser]
I have the directory structure shown in the attached figure. The
editor.php controller has the line:

Code:
$this->config->load('uploader_settings', TRUE);

But uploader_settings.php is just:

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require('../config.php');



/* End of file uploader_settings.php */
/* Location: ./system/application/config/uploader_settings.php */

My question is, how does require('../config.php') load the config file? Is CI making some assumptions about relative paths?

If the line in editor.php
Code:
$this->config->load('uploader_settings', TRUE);
is actually including uploader_settings.php in editor.php, then ('../config.php'); would be running from editor.php and ../ would take us to the application directory, but there's no config.php there.

If the config-> load line doesn't actually include uploader_settings.php into editor.php, so require('../config.php') is running from config/uploader_settings.php, then ../ would again take us to the application directory, where there is no config.php file.

Does anyone see how require('../config.php'); loads config.php? Is CI making its own directory assumptions, or forgiving an error in the code and going to the right place?

Thanks


Messages In This Thread
CI Relative Paths - by El Forum - 01-11-2013, 09:47 AM
CI Relative Paths - by El Forum - 01-12-2013, 01:04 AM
CI Relative Paths - by El Forum - 01-12-2013, 03:53 PM
CI Relative Paths - by El Forum - 01-12-2013, 04:16 PM
CI Relative Paths - by El Forum - 01-13-2013, 06:36 PM
CI Relative Paths - by El Forum - 01-13-2013, 07:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB