Put the vendor
folder inside the application
folder.
The location of the application
, modules
and system
folders can be set in index.php
and will be stored in the APPPATH
, MODPATH
and SYSPATH
constants. Kohana::find_files() will look in APPPATH
, then in all the loaded modules under MODPATH
(ok, modules can be located anywhere, but I am assuming they are all under MODPATH
in your case) and finally SYSPATH
. Kohana::find_files() won't magically look anywhere else.
Also, why not put the require_once outside the class defenition? Like this.
<?php defined('SYSPATH') or die ('No direct script access.');
// require_once(APPPATH.'vendor/twitter-api-php/TwitterAPIExchange.php');
require_once Kohana::find_file('vendor/twitter-api-php', 'TwitterAPIExchange');
class Controller_Twitter extends Controller {
public function action_index()
{
$view = new View('twitter/index');
$this->response->body($view);
}
}