Merged d00ps and my branch, renamed SysCP -> Froxlor in installer
This commit is contained in:
46
lib/functions/froxlor/function.loadConfigArrayDir.php
Normal file
46
lib/functions/froxlor/function.loadConfigArrayDir.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the SysCP project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.syscp.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
* @version $Id: function.loadConfigArrayDir.php 2735 2009-11-06 09:52:59Z flo $
|
||||
*/
|
||||
|
||||
function loadConfigArrayDir($data_dirname)
|
||||
{
|
||||
// Workaround until we use gettext
|
||||
global $lng;
|
||||
|
||||
$data = array();
|
||||
|
||||
if(is_dir($data_dirname))
|
||||
{
|
||||
$data_files = array();
|
||||
$data_dirhandle = opendir($data_dirname);
|
||||
while(false !== ($data_filename = readdir($data_dirhandle)))
|
||||
{
|
||||
if($data_filename != '.' && $data_filename != '..' && $data_filename != '' && substr($data_filename, -4 ) == '.php')
|
||||
{
|
||||
$data_files[] = $data_dirname . $data_filename;
|
||||
}
|
||||
}
|
||||
|
||||
sort($data_files);
|
||||
|
||||
foreach($data_files as $data_filename)
|
||||
{
|
||||
$data = array_merge_recursive($data, include($data_filename));
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
Reference in New Issue
Block a user