Environment
in package
Components_Pear_Environment:: handles a specific PEAR environment.
Copyright 2010-2020 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
- $_base_directory : string|null
- The base directory for the PEAR install location.
- $_channel_directory : string
- The directory that contains channel definitions.
- $_config_file : string|null
- The path to the configuration file.
- $_factory : Factory|null
- The factory for PEAR class instances.
- $_output : Output
- $_source_directory : string
- The directory that contains package sources.
- __construct() : mixed
- Constructor.
- addChannel() : void
- Add a channel within the install location.
- addComponent() : void
- Add a component to the environment.
- channelExists() : bool
- Test if a channel exists within the install location.
- createPearConfig() : void
- getPearConfig() : PEAR_Config
- linkPackageFromSource() : void
- Add a package based on a source directory.
- provideChannel() : void
- Ensure the specified channel exists within the install location.
- setChannelDirectory() : void
- Set the path to the channel directory.
- setFactory() : void
- Define the factory that creates our PEAR dependencies.
- setLocation() : void
- Set the path to the install location.
- setResourceDirectories() : void
- Set the paths to the resource directories.
- setSourceDirectory() : void
- Set the path to the source directory.
- getInstallationHandler() : PEAR_Command_Install
- Provide the PEAR specific installer.
Properties
$_base_directory
The base directory for the PEAR install location.
private
string|null
$_base_directory
= null
$_channel_directory
The directory that contains channel definitions.
private
string
$_channel_directory
$_config_file
The path to the configuration file.
private
string|null
$_config_file
= null
$_factory
The factory for PEAR class instances.
private
Factory|null
$_factory
= null
$_output read-only
private
Output
$_output
$_source_directory
The directory that contains package sources.
private
string
$_source_directory
Methods
__construct()
Constructor.
public
__construct(Output $_output) : mixed
Parameters
- $_output : Output
-
The output handler.
Return values
mixed —addChannel()
Add a channel within the install location.
public
addChannel(string $channel[, array<string|int, mixed> $options = [] ][, string $reason = '' ]) : void
Parameters
- $channel : string
-
The channel name.
- $options : array<string|int, mixed> = []
-
Install options.
- $reason : string = ''
-
Optional reason for adding the channel.
Tags
Return values
void —addComponent()
Add a component to the environment.
public
addComponent(string $component, array<string|int, mixed> $install, array<string|int, mixed> $options, string $info[, string $reason = '' ][, array<string|int, mixed> $warnings = [] ]) : void
Parameters
- $component : string
-
The name of the component that should be installed.
- $install : array<string|int, mixed>
-
The packages that should be installed.
- $options : array<string|int, mixed>
-
PEAR specific installation options.
- $info : string
-
Installation details.
- $reason : string = ''
-
Optional reason for adding the package.
- $warnings : array<string|int, mixed> = []
-
Optional warnings that should be displayed to the user.
Tags
Return values
void —channelExists()
Test if a channel exists within the install location.
public
channelExists(string $channel) : bool
Parameters
- $channel : string
-
The channel name.
Tags
Return values
bool —True if the channel exists.
createPearConfig()
public
createPearConfig() : void
Tags
Return values
void —getPearConfig()
public
getPearConfig() : PEAR_Config
Tags
Return values
PEAR_Config —linkPackageFromSource()
Add a package based on a source directory.
public
linkPackageFromSource(string $package[, string $reason = '' ]) : void
Parameters
- $package : string
-
The path to the package.xml in the source directory.
- $reason : string = ''
-
Optional reason for adding the package.
Tags
Return values
void —provideChannel()
Ensure the specified channel exists within the install location.
public
provideChannel(string $channel[, array<string|int, mixed> $options = [] ][, string $reason = '' ]) : void
Parameters
- $channel : string
-
The channel name.
- $options : array<string|int, mixed> = []
-
Install options.
- $reason : string = ''
-
Optional reason for adding the channel.
Tags
Return values
void —setChannelDirectory()
Set the path to the channel directory.
public
setChannelDirectory(array<string|int, mixed> &$options) : void
Parameters
- $options : array<string|int, mixed>
-
The application options
Tags
Return values
void —setFactory()
Define the factory that creates our PEAR dependencies.
public
setFactory(Factory $factory) : void
Parameters
- $factory : Factory
Return values
void —setLocation()
Set the path to the install location.
public
setLocation(string $base_directory, string $config_file) : void
Parameters
- $base_directory : string
-
The base directory for the PEAR install location.
- $config_file : string
-
The name of the configuration file.
Tags
Return values
void —setResourceDirectories()
Set the paths to the resource directories.
public
setResourceDirectories(array<string|int, mixed> &$options) : void
Parameters
- $options : array<string|int, mixed>
-
The application options
Tags
Return values
void —setSourceDirectory()
Set the path to the source directory.
public
setSourceDirectory(array<string|int, mixed> &$options) : void
Parameters
- $options : array<string|int, mixed>
-
The application options
Tags
Return values
void —getInstallationHandler()
Provide the PEAR specific installer.
private
getInstallationHandler() : PEAR_Command_Install