File tree Expand file tree Collapse file tree 3 files changed +48
-54
lines changed
Expand file tree Collapse file tree 3 files changed +48
-54
lines changed Original file line number Diff line number Diff line change 3535 "nguyenanhung\\ CodeIgniter\\ BaseREST\\ " : " thirdParty/REST/"
3636 },
3737 "files" : [
38- " helpers/codeigniter_modular.php" ,
3938 " helpers/common.php"
4039 ]
4140 },
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77 * Date: 09/03/2023
88 * Time: 23:00
99 */
10+ if (!function_exists ('codeigniter_hmvc_module_exists ' )) {
11+ /**
12+ * Check if a CodeIgniter module with the given name exists
13+ *
14+ * @param $module_name
15+ *
16+ * @return bool
17+ */
18+ function codeigniter_hmvc_module_exists ($ module_name )
19+ {
20+ return in_array ($ module_name , codeigniter_hmvc_modules_list (false ));
21+ }
22+ }
23+ if (!function_exists ('codeigniter_hmvc_modules_list ' )) {
24+ /**
25+ * Return the CodeIgniter modules list
26+ *
27+ * @param bool $with_location
28+ *
29+ * @return array
30+ */
31+ function codeigniter_hmvc_modules_list ($ with_location = true )
32+ {
33+ if (!function_exists ('directory_map ' ))
34+ {
35+ get_instance ()->load ->helper ('directory ' );
36+ }
37+
38+ $ modules = array ();
39+
40+ foreach (Modules::$ locations as $ location => $ offset )
41+ {
42+ $ files = directory_map ($ location , 1 );
43+ if (is_array ($ files ))
44+ {
45+ foreach ($ files as $ name )
46+ {
47+ if (is_dir ($ location . $ name ))
48+ {
49+ $ modules [] = $ with_location ? array ($ location , $ name ) : $ name ;
50+ }
51+ }
52+ }
53+ }
54+
55+ return $ modules ;
56+ }
57+ }
1058if (!function_exists ('bear_str_to_lower ' )) {
1159 function bear_str_to_lower ($ str )
1260 {
You can’t perform that action at this time.
0 commit comments