1

I'm trying to develop an app using Kohana 3.3 and Heroku.

The main problem is when I have controllers in sub directory as follow example

dirname\Class1 dirname\Class2

Class2 extends Class1

Then I have a route set to this location which works great on my local environment (tried on Ubuntu with Apache 2.4 and PHP 5.6 and Windows with XAMPP), but when I try to access this route on Heroku fails to open the route with error that Class1 is not found.

I have tried also to update the htaccess and to update the routing file couple of times with different options which are still working on my local env. but not possible to get this to work on Heroku.

Here is the route I'm using for this:

Route::set('dashboard', 'dashboard(/<controller>(/<action>))')
->defaults(array(
    'directory' => '/dashboard',
    'controller' => 'Main',
    'action' => 'index'
));

So when I access to example.com/dashboard works well on Heroku, but when I try example.com/dashboard/something then it is able to find the controller that I'm trying to reach (in this case called Controller_Dashboard_Something) but it is unable to find the Main controller (named Controller_Dashboard_Main). Once again locally this is working well, but on Heroku I'm not sure am I doing something wrong or it doesn't understand the autoloader properly....

So anyone that can help I would be thankful.

Thanks

2 Answers2

0

I found one workaround that may be helpful to others. It is not the bright solution but it works.

I have added just the following line in Class2 file.

require "Class1"
0

Controller in dirname\Class1, must have class name Controller_dirname_Class1. All parts are case-sensitive for linux hosting, that maybe problem in Heroku, because in windows this does not matter.

MisterX
  • 310
  • 1
  • 4