/** * method: getDatabaseMessage * * todo: write documentation */ public static function getDatabaseMessage($identifier, $default = false) { return Amslib_Array::filterKey(self::getDatabaseErrors($identifier, $default), array("db_error", "db_location")); }
/** * method: backtrace * * a method to obtain a debug backtrace of the current PHP function stack with options to * slice a part of the array * * this function uses variable arguments, it will only slice the string if it first two * parameters are integer numbers after that, all the arguments will be tested whether * they are a string and if so, they will be used to filter each array stack element to * return only the keys which match the strings, dropping all the unwanted keys from * each array stack element * * parameters: * $start - The starting offset to slice from the array stack * $finish - the ending offset to slice from the array stack * vargs - any number of string variables which will be used to filter each array index to reutrn only the keys requested * * notes: * - The function is really really memory hungry, use Amslib_Debug::getStackTrace if you can * - This is a really ancient function, it's hard to know what it's trying to do */ public static function backtrace() { // Find out who is using this method so I can upgrade it's code and delete this Amslib_Debug::log("stack_trace"); $args = func_get_args(); $bt = debug_backtrace(); $slice = array($bt); if (count($args) && is_numeric($args[0])) { $slice[] = array_shift($args); } if (count($args) && is_numeric($args[0])) { $slice[] = array_shift($args); } if (count($slice) > 1) { $bt = call_user_func_array("array_slice", $slice); } return Amslib_Array::filterKey($bt, Amslib_Array::filterType($args, "is_string")); }
/** * method: getDatabaseMessage * * todo: write documentation */ public function getDatabaseMessage($plugin, $default = false) { return Amslib_Array::filterKey($this->getDatabaseErrors($plugin, $default), array("db_error", "db_location")); }