本文整理汇总了PHP中Control::unSerializeAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::unSerializeAll方法的具体用法?PHP Control::unSerializeAll怎么用?PHP Control::unSerializeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::unSerializeAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseArguments
public static function parseArguments($serialized, $class, $method)
{
$unserialized = unserialize($serialized);
$method = new ReflectionMethod($class, $method);
$params = $method->getParameters();
$args = array();
foreach ($params as $param) {
$name = $param->getName();
$args[$name] = $unserialized[$name];
}
$args = Control::unSerializeAll($args);
if ($class == 'Record') {
$args['record_id'] = $_REQUEST['id'];
}
return $args;
}
示例2: serializeMultiples
public static function serializeMultiples($fields_array, $table = false)
{
global $CFG;
if ($table) {
$table_fields = self::getTableFields($table);
}
if (is_array($fields_array)) {
foreach ($fields_array as $key => $value) {
if ($key == 'argument_insert_array') {
continue;
}
$new_array = array();
if (stristr($value, 'array:')) {
$value = str_ireplace('array:', '', $value);
if (stristr($value, '|')) {
if (stristr($value, '|||')) {
$array = explode('|||', $value);
if (is_array($array)) {
foreach ($array as $v) {
$array1 = explode('|', $v);
if (!empty($array1[0])) {
$i = $array1[0];
$new_array[$i] = $array1[1];
}
}
}
} else {
$array1 = explode('|', $value);
if (!empty($array1[0])) {
$i = $array1[0];
$new_array[$i] = $array1[1];
}
}
} else {
$c_array = self::serializeCommas($value);
$new_array = array_merge($new_array, $c_array);
}
$fields_array[$key] = serialize($new_array);
} elseif ($table_fields[$key]['Type'] == 'datetime') {
$fields_array[$key] = date('Y-m-d H:i:s', strtotime($value));
}
}
}
if (!$CFG->bypass_unserialize) {
if (is_array($fields_array)) {
$fields_array = Control::unSerializeAll($fields_array);
foreach ($fields_array as $name => $value) {
if (stristr($name, 'argument')) {
$arg_name = str_replace('argument_', '', $name);
$arguments[$arg_name] = $value;
unset($fields_array[$name]);
}
}
if ($arguments) {
$fields_array['arguments'] = serialize($arguments);
}
}
}
return $fields_array;
}
示例3: serializeMultiples
function serializeMultiples($fields_array)
{
global $CFG;
if (is_array($fields_array)) {
$new_array = array();
foreach ($fields_array as $key => $value) {
if (stristr($value, 'array:')) {
$value = str_ireplace('array:', '', $value);
if (stristr($value, '|')) {
if (stristr($value, '|||')) {
$array = explode('|||', $value);
if (is_array($array)) {
foreach ($array as $v) {
$array1 = explode('|', $v);
if (!empty($array1[0])) {
$i = $array1[0];
$new_array[$i] = $array1[1];
}
}
}
} else {
$array1 = explode('|', $value);
if (!empty($array1[0])) {
$i = $array1[0];
$new_array[$i] = $array1[1];
}
}
} else {
$c_array = FormDB::serializeCommas($value);
$new_array = array_merge($new_array, $c_array);
}
$fields_array[$key] = serialize($new_array);
} elseif (stristr($key, 'date')) {
$fields_array[$key] = date('Y-m-d H:i:s', strtotime($value));
}
}
}
if (!$CFG->bypass_unserialize) {
if (is_array($fields_array)) {
$fields_array = Control::unSerializeAll($fields_array);
foreach ($fields_array as $name => $value) {
if (stristr($name, 'argument')) {
$arg_name = str_replace('argument_', '', $name);
$arguments[$arg_name] = $value;
unset($fields_array[$name]);
}
}
if ($arguments) {
$fields_array['arguments'] = serialize($arguments);
}
}
}
return $fields_array;
}