mdtrooper c4a0573398 2011-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_fsgraph.php, include/functions_graph.php,
	include/graphs/functions_utils.php, include/fgraph.php: cleaned source code
	style.

	* include/functions_graph.php: added first version of function
	"graphic_combined_module2".
	
	* include/graphs/functions_pchart.php: fixed when pass a empty array as
	colour for graphs.
	
	* include/graphs/pChart/pDraw.class.php: fixed to set a color border when
	the graphs haven't a external defined colour.
	
	* include/graphs/fgraph.php: changed for pass the data to static image graph
	generator.
	
	* operation/agentes/graphs.php: changed to use the new graph engine.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4172 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-05 16:11:53 +00:00

61 lines
1.4 KiB
PHP

<?php
// Copyright (c) 2011-2011 Ártica Soluciones Tecnológicas
// http://www.artica.es <info@artica.es>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
function serialize_in_temp($array = array(), $serial_id = null) {
$json = json_encode($array);
if ($serial_id === null) {
$serial_id = uniqid();
}
$file_path = sys_get_temp_dir()."/pandora_serialize_".$serial_id;
if (file_put_contents($file_path, $json) === false) {
return false;
}
return $serial_id;
}
function unserialize_in_temp($serial_id = null, $delete = true) {
if ($serial_id === null) {
return false;
}
$file_path = sys_get_temp_dir()."/pandora_serialize_".$serial_id;
$content = file_get_contents($file_path);
if ($content === false) {
return false;
}
$array = json_decode($content, true);
if ($delete) {
unlink($file_path);
}
return $array;
}
function delete_unserialize_in_temp($serial_id = null) {
if ($serial_id === null) {
return false;
}
$file_path = sys_get_temp_dir()."/pandora_serialize_".$serial_id;
return unlink($file_path);
}
?>