Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PEAR.php

function PEAR::__construct

Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.

@access public

Parameters

string $error_class (optional) which class to use for: error objects, defaults to PEAR_Error.

Return value

void

3 calls to PEAR::__construct()
Archive_Tar::__construct in vendor/pear/archive_tar/Archive/Tar.php
Archive_Tar Class constructor. This flavour of the constructor only declare a new Archive_Tar object, identifying it by the name of the tar file. If the compress argument is set the tar will be read or created as a gzip or bz2 compressed TAR file.
Archive_Tar::__construct in vendor/pear/archive_tar/Archive/Tar.php
Archive_Tar Class constructor. This flavour of the constructor only declare a new Archive_Tar object, identifying it by the name of the tar file. If the compress argument is set the tar will be read or created as a gzip or bz2 compressed TAR file.
PEAR::PEAR in vendor/pear/pear-core-minimal/src/PEAR.php
Only here for backwards compatibility. E.g. Archive_Tar calls $this->PEAR() in its constructor.
1 method overrides PEAR::__construct()
Archive_Tar::__construct in vendor/pear/archive_tar/Archive/Tar.php
Archive_Tar Class constructor. This flavour of the constructor only declare a new Archive_Tar object, identifying it by the name of the tar file. If the compress argument is set the tar will be read or created as a gzip or bz2 compressed TAR file.

File

vendor/pear/pear-core-minimal/src/PEAR.php, line 160

Class

PEAR
Base class for other PEAR classes. Provides rudimentary emulation of destructors.

Code

function __construct($error_class = null) {
    $classname = strtolower(get_class($this));
    if ($this->_debug) {
        print "PEAR constructor called, class={$classname}\n";
    }
    if ($error_class !== null) {
        $this->_error_class = $error_class;
    }
    while ($classname && strcasecmp($classname, "pear")) {
        $destructor = "_{$classname}";
        if (method_exists($this, $destructor)) {
            global $_PEAR_destructor_object_list;
            $_PEAR_destructor_object_list[] = $this;
            if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
                register_shutdown_function("_PEAR_call_destructors");
                $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
            }
            break;
        }
        else {
            $classname = get_parent_class($classname);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal