Ticket #489 (closed Feature Request: wontfix)

Opened 9 months ago

Last modified 9 months ago

Modules directory

Reported by: canglan Owned by: Shadowhand
Priority: minor Milestone: 2.1.2
Component: Core Version: SVN HEAD
Keywords: modules Cc:

Description

In the index.php file there is this '$kohana_modules' variable which we can set for the modules directory.

However, this setting is obsolete because the config class does not take the advantage of the values.

In './system/core/Config.php', from line 146:

foreach(self::item('core.modules') as $path)
{
	if (($path = str_replace('\\', '/', realpath($path))) == '')
		continue;

	self::$include_paths[] = $path.'/';
}

Proposed fix:

foreach(self::item('core.modules') as $path)
{
	self::$include_paths[] = MODPATH.$path.'/';
}

Change History

Changed 9 months ago by canglan

Updated proposal:

foreach(self::item('core.modules') as $path)
{
	if (substr($path, 0, 1) == '/')
	{
		self::$include_paths[] = realpath($path).'/';
		continue;
	}
	
	self::$include_paths[] = MODPATH.$path.'/';
}

Then in the './application/config/config.php' file, we should change the comments to reflect this change:

Relative path is relative to the modules directory rather than the docroot.

Absolute path remains the same.

Changed 9 months ago by zombor

  • status changed from new to closed
  • resolution set to worksforme

MODPATH goes in the application/config.php file, not the config library:

$configmodules? = array (

MODPATH.'forge', // Form generation

);

Nothing is broken here.

Changed 9 months ago by canglan

Yes we could manually put MODPATH in there, but most of our modules if not all are in the MODPATH directory, so why not make it into the Config class so that we don't have to manually append 'MODPATH' to every single module?

If we need to store modules elsewhere we could always use the absolute path.

Changed 9 months ago by canglan

  • priority changed from major to minor
  • status changed from closed to reopened
  • resolution deleted
  • type changed from Bug to Feature Request

I'm changing this to feature request.

Changed 9 months ago by Shadowhand

  • status changed from reopened to closed
  • resolution set to wontfix

The point of MODPATH is to provide a base directory for the distributed Kohana modules, while still allowing people to enter paths to other modules.

Not all modules should be contained in MODPATH.

Note: See TracTickets for help on using tickets.