This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/config.php
2011-07-18 16:19:26 +10:00

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;
}
}
?>