DeprecatedFunctionsNotice

From MapbenderWiki

Jump to: navigation, search

To identify deprecated functions, which should NOT be used anymore by admins, users or developers, just add a notice to the deprecated function whenever you work on it:

$e = new mb_notice("DEPRECATED_FUNCTION is deprecated, use NEW_FUNCTION instead!"); 

e.g. in class_administration.php:

/**
 * @deprecated
 */
function getGuisByPermission($mb_user_id,$ignorepublic){
	$e = new mb_notice("administration->getGuisByPermission is deprecated, use user->getApplicationsByPermission instead!"); 
	$user = new User($mb_user_id);
	return $user->getApplicationsByPermission($ignorepublic);
}


With this change every call to a deprecated function is logged in the logfile (which everbody checks on a regular basis ;-)

Views
Personal tools