PEAR
[ class tree: PEAR ] [ index: PEAR ] [ all elements ]

Class: PEAR_Frontend

Source Location: /PEAR-1.10.12/PEAR/Frontend.php

Class Overview

PEAR
   |
   --PEAR_Frontend

Singleton-based frontend for PEAR user input/output


Author(s):

Version:

  • Release: 1.10.12

Copyright:

  • 1997-2009 The Authors

Methods


Child classes:

PEAR_Frontend_CLI
Command-line Frontend for the PEAR Installer

Inherited Variables

Inherited Methods

Class: PEAR

PEAR::__construct()
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
PEAR::PEAR()
Only here for backwards compatibility.
PEAR::delExpect()
This method deletes all occurrences of the specified element from the expected error codes stack.
PEAR::expectError()
This method is used to tell which errors you expect to get.
PEAR::getSourceDateEpoch()
Get SOURCE_DATE_EPOCH environment variable See https://reproducible-builds.org/specs/source-date-epoch/
PEAR::getStaticProperty()
If you have a class that's mostly/entirely static, and you need static
PEAR::isError()
Tell whether a value is a PEAR error.
PEAR::loadExtension()
OS independent PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
PEAR::popExpect()
This method pops one element off the expected error codes stack.
PEAR::registerShutdownFunc()
Use this function to register a shutdown method for static classes.
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::_PEAR()
Destructor (the emulated type of...). Does nothing right now, but is included for forward compatibility, so subclass destructors should always call it.
PEAR::_popErrorHandling()
Pop the last error handler used
PEAR::_pushErrorHandling()
Push a new error handler on top of the error handler options stack. With this you can easily override the actual error handler for some code and restore it later with popErrorHandling.
PEAR::_raiseError()
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. If the $mode and $options parameters are not specified, the object's defaults are used.
PEAR::_setErrorHandling()
Sets how errors generated by this object should be handled.
PEAR::_throwError()
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
PEAR::__call()
PEAR::__callStatic()

Class Details

[line 45]
Singleton-based frontend for PEAR user input/output


[ Top ]


Method Detail

addTempFile   [line 163]

void addTempFile( $file)

This can be overridden to allow session-based temporary file management

By default, all files are deleted at the end of a session. The web installer needs to be able to sustain a list over many sessions in order to support user interaction with install scripts


Parameters:

   $file   — 

[ Top ]

isIncludeable   [line 134]

boolean isIncludeable( string $path)

  • Access: public

Parameters:

string   $path   —  relative or absolute include path

[ Top ]

log   [line 176]

boolean log( string $msg, [boolean $append_crlf = true])

Log an action
  • Return: true
  • Abstract:

Overridden in child classes as:

PEAR_Frontend_CLI::log()

Parameters:

string   $msg   —  the message to log
boolean   $append_crlf   — 

[ Top ]

outputData   [line 199]

void outputData( mixed $data, [string $command = '_default'])

Display human-friendly output formatted depending on the $command parameter.

This should be able to handle basic output data with no command

  • Abstract:

Overridden in child classes as:

PEAR_Frontend_CLI::outputData()

Parameters:

mixed   $data   —  data structure containing the information to display
string   $command   —  command from which this method was called

[ Top ]

runPostinstallScripts   [line 186]

void runPostinstallScripts( &$scripts, array $scripts)

Run a post-installation script
  • Abstract:

Overridden in child classes as:

PEAR_Frontend_CLI::runPostinstallScripts()

Parameters:

array   $scripts   —  array of post-install scripts
   &$scripts   — 

[ Top ]

setConfig   [line 152]

void setConfig( PEAR_Config &$config)


Parameters:

PEAR_Config   &$config   — 

[ Top ]

setFrontendClass   [line 73]

PEAR_Frontend &setFrontendClass( string $uiclass)

Set the frontend class that will be used by calls to singleton()

Frontends are expected to conform to the PEAR naming standard of _ => DIRECTORY_SEPARATOR (PEAR_Frontend_CLI is in PEAR/Frontend/CLI.php)

  • Access: public

Parameters:

string   $uiclass   —  full class name

[ Top ]

setFrontendObject   [line 112]

PEAR_Frontend &setFrontendObject( PEAR_Frontend $uiobject)

Set the frontend class that will be used by calls to singleton()

Frontends are expected to be a descendant of PEAR_Frontend

  • Access: public

Parameters:

PEAR_Frontend   $uiobject   — 

[ Top ]

singleton   [line 51]

PEAR_Frontend_CLI|PEAR_Frontend_Web|PEAR_Frontend_Gtk &singleton( [ $type = null])

Retrieve the frontend object
  • Access: public

Parameters:

   $type   — 

[ Top ]

userDialog   [line 220]

array userDialog( string $command, array $prompts, [array $types = array()], [array $defaults = array()])

Display a modal form dialog and return the given input

A frontend that requires multiple requests to retrieve and process data must take these needs into account, and implement the request handling code.

  • Return: input sent by the user
  • Abstract:

Overridden in child classes as:

PEAR_Frontend_CLI::userDialog()

Parameters:

string   $command   —  command from which this method was called
array   $prompts   —  associative array. keys are the input field names and values are the description
array   $types   —  array of input field types (text, password, etc.) keys have to be the same like in $prompts
array   $defaults   —  array of default values. again keys have to be the same like in $prompts. Do not depend on a default value being set.

[ Top ]


Documentation generated on Sun, 19 Apr 2020 14:22:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.