0

In kohana 3.3 i need to include one of the controller file in the another controller

I used require_once( realpath(dirname(FILE) . '/Twitteroauth.php' ) );

Its showing the server error.

Thanks in advance.

mangala
  • 143
  • 1
  • 2
  • 13

2 Answers2

1

You should do this:

require_once( realpath(dirname(__FILE__) . '/Twitteroauth.php' ) );
Ramesh
  • 4,223
  • 2
  • 16
  • 24
0

Function realpath returns false when file does not exist, so you should maybe check result before require:

$path = realpath(dirname(__FILE__) . '/Twitteroauth.php' );
if(!empty($path))
    require_once($path);
else
    die("$path not found!");
Mariyo
  • 486
  • 7
  • 15