本文整理匯總了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;
}