Developer
User Docs ↗ Star uson GitHub
You are viewing documentation for RT 4.2.5, which is end-of-life and no longer supported. The current release is 6.0.4 (view the current version of this page).
RT supports upgrading from all older versions. See the README for instructions or contact us for assistance.

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);

  #let's talk to RT'
  use RT;

  #Load RT's config file
  RT::LoadConfig();

  # Connect to the database. set up loggign
  RT::Init();

  # Clean out all the nasties from the environment
  CleanEnv();

  #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.

Still need help?Get answers from the team behind Request Tracker.

← Back to index