2010-07-08 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_filemanager.php: cleaned source code. And added function
	"read_recursive_dir" to give a content of dir in a array.
	
	* include/functions_config.php: added $config['collection_max_size'].



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2982 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-07-08 16:45:34 +00:00
parent a675b79538
commit 4659849d55
3 changed files with 51 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2010-07-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_filemanager.php: cleaned source code. And added function
"read_recursive_dir" to give a content of dir in a array.
* include/functions_config.php: added $config['collection_max_size'].
2010-07-08 Dario Rodriguez <dario.rodriguez@artica.es>
* operation/agentes/networkmap.php: fixed order in combo box of zoom

View File

@ -310,6 +310,10 @@ function process_config () {
if (!isset ($config["gis_purge"])){
update_config_value ('gis_purge', 7);
}
if (!isset ($config["collection_max_size"])){
update_config_value ('collection_max_size', 1000000);
}
/*
*Parse the ACL IP list for access API that it's save in chunks as

View File

@ -346,8 +346,8 @@ function delete_directory($dir)
{
if ($handle = opendir($dir))
{
while (false !== ($file = readdir($handle))) {
if (($file != ".") && ($file != "..")) {
while (false !== ($file = readdir($handle))) {
if (($file != ".") && ($file != "..")) {
if (is_dir($dir . $file))
{
@ -367,6 +367,44 @@ function delete_directory($dir)
}
}
/**
* Read a directory recursibly and return a array with the files with
* the absolute path and relative
*
* @param string $dir absoute dir to scan
* @param string $relative_path Relative path to scan, by default ''
*
* @return array The files in the dirs, empty array for empty dir of files.
*/
function read_recursive_dir($dir, $relative_path = '') {
$return = array();
if ($handle = opendir($dir))
{
while (false !== ($entry = readdir($handle))) {
if (($entry != ".") && ($entry != "..")) {
// debugPrint($entry);
// debugPrint($return);
if (is_dir($dir . $entry))
{
// debugPrint('dir');
$return = array_merge($return, read_recursive_dir($dir . $entry . '/', $relative_path . $entry . '/' ));
}
else
{
// debugPrint('file');
$return[] = array('relative' => $relative_path . $entry, 'absolute' => $dir . $entry);
}
}
}
closedir($handle);
}
return $return;
}
/**
* The main function to show the directories and files.
*