Welcome Guest, Not a member yet? Register   Sign In
Bugs with the name of files Linux/Windows


I develloped my application in Windows. My controllers names is '$name'Controller.php

Ex: indexController.php

Yersteday, I've will export my application in a linux server.

But, every problems. All files in controllers/ and models/ with a capital letter in middle name cannot be called. For all models and only for the default controller.

Ex: my default controller is indexController. He can't be called. (strtolower is use in a CI CORE...) But if I call, with this URL, an other controller, with capital letter in middle, it's works.

So... Why mandatory no capital letter in default controller if it's authorized by URL call ?

And WHY it's not say in the documentation ?! It's a shame...

** Sorry for my bad english, I'm french. **

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

class MY_Router extends CI_Router{
   * Set the route mapping
   * This function determines what should be served based on the URI request,
   * as well as any "routes" that have been set in the routing config file.
   * @access  private
   * @return  void
  function _set_routing()
    // Are query strings enabled in the config file?  Normally CI doesn't utilize query strings
    // since URI segments are more search-engine friendly, but they can optionally be used.
    // If this feature is enabled, we will gather the directory/class/method a little differently
    $segments = array();
    if ($this->config->item('enable_query_strings') === TRUE AND isset($_GET[$this->config->item('controller_trigger')]))
      if (isset($_GET[$this->config->item('directory_trigger')]))
        $segments[] = $this->fetch_directory();

      if (isset($_GET[$this->config->item('controller_trigger')]))
        $segments[] = $this->fetch_class();

      if (isset($_GET[$this->config->item('function_trigger')]))
        $segments[] = $this->fetch_method();

    // Load the routes.php file.
    if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/routes.php'))
    elseif (is_file(APPPATH.'config/routes.php'))

    $this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route;

    // Set the default controller so we can display it in the event
    // the URI doesn't correlated to a valid controller.
     * *****************************************************
     * Don't strtolower the name of the default controller !
     * @Update by Vadorequest.
     * *****************************************************
    $this->default_controller = ( ! isset($this->routes['default_controller']) OR $this->routes['default_controller'] == '') ? FALSE : $this->routes['default_controller'];

    // Were there any query string segments?  If so, we'll validate them and bail out since we're done.
    if (count($segments) > 0)
      return $this->_validate_request($segments);

    // Fetch the complete URI string

    // Is there a URI string? If not, the default controller specified in the "routes" file will be shown.
    if ($this->uri->uri_string == '')
      return $this->_set_default_controller();

    // Do we need to remove the URL suffix?

    // Compile the segments into an array

    // Parse any custom routing that may exist

    // Re-index the segment array so that it starts with 1 rather than 0


Path: \application\core

Upload all your files in lower case, some servers are case sensitive.

I have my ftp upload auto set to change the filenames to lower case on upload.

Theme © iAndrew 2016 - Forum software by © MyBB