PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

Pyrus's configuration API | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

Pyrus's configuration API

Introduction

This documentation describes how to use Pyrus's public class API to access configuration values. Before reading further, you should be familiar with the documentation on Pyrus's configuration.

Pyrus's configuration is controlled by the pear2\Pyrus\Config class, which is implemented as a multiton mapping Pyrus installation location to a configuration object. In addition, the current configuration (most recently instantiated) is also accessible to create configuration-agnostic functionality.

Configuration variables are accessed by referring to them as class properties. Here is an example requesting the doc_dir configuration variable, and setting the test_dir configuration variable:

<?php
$docdir 
pear2\Pyrus\Config::current()->doc_dir;
pear2\Pyrus\Config::current()->test_dir '/path/to/tests';
?>

The user configuration in use is also accessible from each configuration in the same manner as the installation-specific configuration. Here is an example requesting preferred_state and setting verbose:

<?php
$pref 
pear2\Pyrus\Config::current()->preferred_state;
pear2\Pyrus\Config::current()->verbose 3;
?>

Special variables available

In addition to the configuration variables, Pyrus also defines a few other values that are available, and cannot be used as the names of custom configuration variables:

  • path - the complete PATH_SEPARATOR separated list of cascading directories this configuration represents.

  • location - the writable pyrus installation this configuration represents

  • registry - the registry corresponding to the configuration

  • pluginregistry - the registry corresponding to the location that plugins are installed

  • channelregistry - the channel registry corresponding to the configuration

  • systemvars - an array of names of system configuration variables, built-in and custom

  • uservars - an array of names of user configuration variables, built-in and custom

  • channelvars - an array of channel-specific configuration variables, built-in and custom

  • mainsystemvars - an array of names of built-in system variables

  • mainuservars - an array of names of built-in user variables

  • mainchannelvars - an array of names of built-in channel-specific variables

  • userfile - path to the user configuration file in use by this configuration.

  • customsystemvars - an array of names of custom system variables

  • customuservars - an array of names of custom user variables

  • customchannelvars - an array of names of custom channel-specific variables

忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「Pyrus's configuration API」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | Pyrus's configuration API」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: