$val) {
if( preg_match($rx_http, $key) ) {
$arh_key = preg_replace($rx_http, '', $key);
$rx_matches = array();
// do some nasty string manipulations to restore the original letter case
// this should work in most cases
$rx_matches = explode('_', $arh_key);
if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) {
foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val);
$arh_key = implode('-', $rx_matches);
}
$arh[$arh_key] = $val;
}
}
return( $arh );
}
///
}
/**
* Generates warning message of deprecated methods executing PHP function trigger_error
* @author Anderson Tadayuki Saikawa
* @param string $new_class The name of the class that has the method that replaces the deprecated one
* @param string $new_method The name of the method that replaces the deprecated one
* @return boolean
* @license http://www.gnu.org/copyleft/gpl.html GPL
* @package Workflow
* @access public
*/
function wf_warn_deprecated_method($new_class = null, $new_method = null)
{
$caller = next(debug_backtrace());
$old_class = !empty($caller['class']) ? " of " . $caller['class'] . " object" : "";
$deprecated_msg = sprintf("Deprecated method %s%s was called in %s on line %s. It MUST be replaced by its equivalent",
$caller['function'], $old_class, $caller['file'], $caller['line']);
if(!empty($new_class) && !empty($new_method)){
$new_class = !empty($new_class) ? " of " . $new_class . " object" : "";
$deprecated_msg .= sprintf(' %s%s', $new_method, $new_class);
}
$error_msg = $deprecated_msg . ".\n
Error handler";
return trigger_error("[WORKFLOW WARNING]: " . $error_msg, E_USER_WARNING);
}
?>