38 lines
791 B
PHP
38 lines
791 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
class Config extends lnApp_Config {
|
|
/**
|
|
* Find a list of all database enabled modules
|
|
*
|
|
* @uses cache
|
|
*/
|
|
public static function appmodules() {
|
|
$cacheable = TRUE;
|
|
|
|
if (array_key_exists('cache',Kohana::modules())) {
|
|
$cache = Cache::instance(static::cachetype());
|
|
|
|
if ($cacheable AND $cache->get('modules'))
|
|
return $cache->get('modules');
|
|
|
|
} else
|
|
$cache = '';
|
|
|
|
$modules = array();
|
|
$module_table = 'module';
|
|
|
|
if (class_exists('Model_'.ucfirst($module_table))) {
|
|
$mo = ORM::factory($module_table)->where('status','=',1)->find_all()->as_array();
|
|
|
|
foreach ($mo as $o)
|
|
$modules[$o->name] = MODPATH.$o->name;
|
|
}
|
|
|
|
if ($cache)
|
|
$cache->set('modules',$modules);
|
|
|
|
return $modules;
|
|
}
|
|
}
|
|
?>
|