// Load Mediawiki framework require_once( '/path/to/mediawiki/includes/WebStart.php' ); // Create a new User object from the username 'JohnDoe' $user = User::newFromName( 'JohnDoe' ); // Print user details echo $user->getName() . 'In this example, we use the newFromName method to create a User object for the user 'JohnDoe'. We then print some details about the user, such as their name and email address. This method is useful in web applications where users need to be authenticated and their information needs to be accessed. It saves developers from writing boilerplate code for creating user objects and retrieving user information.
'; echo $user->getEmail() . '
'; echo $user->getRealName() . '