getDirSize($path); } else if (is_file($path)) { $size += filesize($path); } } } closedir($dh); return $size; } /** * Simple SQL injection protection * * @param string $string * @return string */ public static function convertString($string) { return stripslashes(trim($string)); } /** * Get the value of key in an array if index exist * * @param string $key * @param array $array * @return object */ public static function getValue($key, $array) { if (array_key_exists($key, $array)) { return $array[$key]; } return false; } }