.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "UR::Context::Process 3pm" .TH UR::Context::Process 3pm "2019-01-02" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" UR::Context::Process \- Implements a generic interface to the current application. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& $name = UR::Context::Process\->base_name; \& \& $name = UR::Context::Process\->prog_name; \& UR::Context::Process\->prog_name($name); \& \& $name = UR::Context::Process\->pkg_name; \& UR::Context::Process\->pkg_name($name); \& \& $name = UR::Context::Process\->title; \& UR::Context::Process\->title($name); \& \& $version = UR::Context::Process\->version; \& UR::Context::Process\->version($version); \& \& $author = UR::Context::Process\->author; \& UR::Context::Process\->author($author); \& \& $author_email = UR::Context::Process\->author_email; \& UR::Context::Process\->author_email($author_email); \& \& $support_email = UR::Context::Process\->support_email; \& UR::Context::Process\->support_email($support_email); \& \& $login = UR::Context::Process\->real_user_name; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides methods to set and retrieve various names associated with the program and the program version number. .SH "METHODS" .IX Header "METHODS" These methods provide the accessor and set methods for various names associated with an application. .IP "get_current" 4 .IX Item "get_current" .Vb 1 \& $ctx = UR::Context::Process\->get_current(); .Ve .Sp This is the context which represents the current process. .Sp Also available as UR::Context\->\fBget_process()\fR; .IP "\fBhas_changes()\fR" 4 .IX Item "has_changes()" .Vb 1 \& $bool = UR::Context::Process\->has_changes(); .Ve .Sp Returns true if the current process has changes which might be committed back to the underlying context. .IP "_create_for_current_process" 4 .IX Item "_create_for_current_process" .Vb 1 \& $ctx = UR::Context::Process\->_create_for_current_process(@PARAMS) .Ve .Sp This is only used internally by \s-1UR.\s0 It materializes a new object to represent a real process somewhere. .Sp \&\s-1TODO:\s0 Remove the exception from \fBcreate()\fR, and allow other processes to be created explicitly w/ the appropriate characteristics. .IP "base_name" 4 .IX Item "base_name" .Vb 1 \& $name = UR::Context::Process\->base_name; .Ve .Sp This is \f(CW\*(C`basename($0, \*(Aq.pl\*(Aq))\*(C'\fR. .IP "prog_name" 4 .IX Item "prog_name" .Vb 2 \& $name = UR::Context::Process\->prog_name; \& UR::Context::Process\->prog_name($name); .Ve .Sp This method is used to access and set the name of the program name. .Sp This name is used in the output of the \f(CW\*(C`version\*(C'\fR and \f(CW\*(C`usage\*(C'\fR subroutines (see \*(L"version\*(R" and \*(L"usage\*(R"). If given an argument, this method sets the program name and returns the new name or \f(CW\*(C`undef\*(C'\fR if unsuccessful. .Sp It defaults to \f(CW\*(C`basename\*(C'\fR if unspecified. .IP "pkg_name" 4 .IX Item "pkg_name" .Vb 2 \& $name = UR::Context::Process\->pkg_name; \& UR::Context::Process\->pkg_name($name); .Ve .Sp This method is used to access and set the GNU-standard package name for the package to which this program belongs. This is does \fB\s-1NOT\s0\fR refer-to a Perl package. It allows a set of specific programs to be grouped together under a common name, which is used in standard message output, and is used in the output of the \f(CW\*(C`version\*(C'\fR subroutine (see \*(L"version\*(R" output. .Sp If given an argument, this method sets the package name and returns the the new name or \f(CW\*(C`undef\*(C'\fR if unsuccessful. Without an argument, the current package name is returned. .Sp It defaults to \f(CW\*(C`prog_name\*(C'\fR when unspecified, which in turn defaults to \f(CW\*(C`base_name\*(C'\fR, which in turn defaults to \&\f(CW\*(C`basename($0)\*(C'\fR. .IP "title" 4 .IX Item "title" .Vb 2 \& $name = UR::Context::Process\->title; \& UR::Context::Process\->title($name); .Ve .Sp This gets and sets the \*(L"friendly name\*(R" for an application. It is often mixed-case, with spaces, and is used in autogenerated documentation, and sometimes as a header in generic \s-1GUI\s0 components. Without an argument, it returns the current title. If an argument is specified, this method sets the application title and returns the new title or \f(CW\*(C`undef\*(C'\fR if unsuccessful. .Sp It defaults to \f(CW\*(C`pkg_name\*(C'\fR when otherwise unspecified, which in turn defaults to \f(CW\*(C`prog_name\*(C'\fR when unspecified, which in turn defaults to \f(CW\*(C`base_name\*(C'\fR when unspecified, which defaults to \f(CW\*(C`basename($0)\*(C'\fR when unspecified. .IP "version" 4 .IX Item "version" .Vb 2 \& $version = UR::Context::Process\->version; \& UR::Context::Process\->version($version); .Ve .Sp This method is used to access and set the package version. This version is used in the output of the \f(CW\*(C`print_version\*(C'\fR method (see \&\*(L"print_version\*(R" in App::Getopt). If given an argument, this method sets the package version and returns the version or \f(CW\*(C`undef\*(C'\fR if unsuccessful. Without an argument, the current package version is returned. .Sp This message defaults to \f(CW$main::VERSION\fR if not set. Note that \&\f(CW$main::VERSION\fR may be \f(CW\*(C`undef\*(C'\fR. .IP "author" 4 .IX Item "author" .Vb 2 \& $author = UR::Context::Process\->author; \& UR::Context::Process\->author($author); .Ve .Sp This method is used to access and set the package author. If given an argument, this method sets the package author and returns the author or \f(CW\*(C`undef\*(C'\fR if unsuccessful. Without an argument, the current author is returned. .IP "author_email" 4 .IX Item "author_email" .Vb 2 \& $author_email = UR::Context::Process\->author_email; \& UR::Context::Process\->author_email($author_email); .Ve .Sp This method is used to access and set the package author's email address. This information is used in the output of the \f(CW\*(C`usage\*(C'\fR method (see \*(L"usage\*(R" in App::Getopt). If given an argument, this method sets the package author's email address and returns email address or \f(CW\*(C`undef\*(C'\fR if unsuccessful. Without an argument, the current email address is returned. .IP "support_email" 4 .IX Item "support_email" .Vb 2 \& $support_email = UR::Context::Process\->support_email; \& UR::Context::Process\->support_email($support_email); .Ve .Sp This method is used to access and set the email address to which the user should go for support. This information is used in the output of the \f(CW\*(C`usage\*(C'\fR method (see \*(L"usage\*(R" in App::Getopt). If given an argument, this method sets the support email address and returns that email address or \f(CW\*(C`undef\*(C'\fR if unsuccessful. Without an argument, the current email address is returned. .IP "real_user_name" 4 .IX Item "real_user_name" .Vb 1 \& $login = UR::Context::Process\->real_user_name; .Ve .Sp This method is used to get the login name of the effective user id of the running script. .ie n .IP "fork $pid = UR::Context::Process\->fork;" 4 .el .IP "fork \f(CW$pid\fR = UR::Context::Process\->fork;" 4 .IX Item "fork $pid = UR::Context::Process->fork;" Safe \fBfork()\fR wrapper. .Sp Handles properly disconnecting database handles if necessary so that data sources in children are still valid. Also ensures that the active UR::Context::process has the child's \s-1PID\s0 recorded within. .IP "effective_user_name" 4 .IX Item "effective_user_name" .Vb 1 \& $login = UR::Context::Process\->effective_user_name; .Ve .Sp This method is used to get the login name of the effective user id of the running script. .IP "original_program_path" 4 .IX Item "original_program_path" .Vb 1 \& $path = UR::Context::Process\->original_program_path; .Ve .Sp This method is used to (try to) get the original program path of the running script. This will not change even if the current working directory is changed. (In truth it will find the path at the time UR::Context::Process was used. So, a chdir before that happens will cause incorrect results; in that case, undef will be returned. .SH "SEE ALSO" .IX Header "SEE ALSO" UR::Context