$94 GRAYBYTE WORDPRESS FILE MANAGER $71

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/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 [ WRITEABLE ]


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

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF