Ticket #2 (closed Feature Request: fixed)

Opened 17 months ago

Last modified 14 months ago

external classes

Reported by: danfreak Owned by:
Priority: minor Milestone: 2.0
Component: Core Version: SVN HEAD
Keywords: Cc:

Description

Add a kinda "vendor" (like in CAKEphp) folder where wo include all external classes and scripts. In order to make it working even with complex classes with several files and folder extend the php 'include_path' directory.

I always do it with a post-controller hook: [code] <?php

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

class Myclasses {

/**

  • includes the directory application\my_classes\ in your includes directory * */

function index() {

//includes the directory application\my_classes\Swift\

ini_set('include_path', ini_get('include_path').';'.BASEPATH.'application/my_classes/');

}

}

?> /code

Change History

Changed 17 months ago by danfreak

  • summary changed from ecternal classes to external classes
  • milestone set to 1.1

Changed 17 months ago by danfreak

see more suggestions on this thread

Changed 14 months ago by Shadowhand

  • status changed from new to closed
  • component set to Kohana Framework
  • priority changed from major to minor
  • version set to SVN HEAD
  • milestone changed from 1.1 (Development Stopped) to 2.0
  • resolution set to fixed

This can be accomplished as of Kohana 2.0. The syntax is:

{{{<?php

Kohana::find_file('vendor', 'path/filename');

?>}}}

This will search (in this order): APPPATH, $configinclude_paths?, SYSPATH.

Note: See TracTickets for help on using tickets.