RT 3.8.16 Documentation
RT::Interface::CLI
NAME
RT::Interface::CLI - helper functions for creating a commandline RT interface
SYNOPSIS
use lib "/path/to/rt/libraries/"; use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent loc); #Clean out all the nasties from the environment CleanEnv(); #let's talk to RT' use RT; #Load RT's config file RT::LoadConfig(); # Connect to the database. set up loggign RT::Init(); #Get the current user all loaded my $CurrentUser = GetCurrentUser(); print loc('Hello!'); # Synonym of $CuurentUser->loc('Hello!');
DESCRIPTION
METHODS
CleanEnv
Removes some of the nastiest nasties from the user\'s environment.
GetCurrentUser
Figures out the uid of the current user and returns an RT::CurrentUser object loaded with that user. if the current user isn't found, returns a copy of RT::Nobody.
loc
Synonym of $CurrentUser->loc().
GetMessageContent
Takes two arguments a source file and a boolean "edit". If the source file is undef or "", assumes an empty file. Returns an edited file as an array of lines.
← Back to index