$12 GRAYBYTE WORDPRESS FILE MANAGER $17

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/php55/usr/share/doc/pear/Base/docs/

HOME
Current File : /opt/alt/php55/usr/share/doc/pear/Base/docs//tutorial_lazy_initialization.php
<?php
require_once 'tutorial_autoload.php';

// Create a custom class implementing the singleton pattern
class customSingleton
{
    protected static $instance;

    public static function getInstance()
    {
        if ( self::$instance === null )
        {
            self::$instance = new customSingleton();
            ezcBaseInit::fetchConfig( 'customKey', self::$instance );
        }

        return self::$instance;
    }
}

// Implement your configuration class
class customSingletonConfiguration implements ezcBaseConfigurationInitializer
{
    public static function configureObject( $object )
    {
        echo "Configure customSingleton.\n";
        $object->value = 42;
    }
}

// Register for lazy initilization
ezcBaseInit::setCallback( 'customKey', 'customSingletonConfiguration' );

// Configure on first initilization
$object = customSingleton::getInstance();
var_dump( $object->value );

?>


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.54 PM
root / root
0755
repos
--
3 Mar 2024 10.54 PM
root / root
0755
CREDITS
0.224 KB
18 Dec 2019 11.18 AM
root / root
0644
LICENSE
1.533 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial.txt
8.593 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial_autoload.php
0.483 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial_example_01.php
0.21 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial_example_02.php
0.185 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial_example_03.php
0.104 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial_example_04.php
1.391 KB
18 Dec 2019 11.18 AM
root / root
0644
tutorial_lazy_initialization.php
0.893 KB
18 Dec 2019 11.18 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF