REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 914 B
Close
/opt/cloudlinux/alt-php53/root/usr/share/doc/pear/Base/docs/tutorial_lazy_initialization.php
Text
Base64
<?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 ); ?>
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 9
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
repos
DIR
-
drwxr-xr-x
2024-03-03 22:55:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CREDITS
229 B
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.53 KB
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial.txt
8.59 KB
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial_autoload.php
495 B
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial_example_01.php
215 B
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial_example_02.php
189 B
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial_example_03.php
107 B
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial_example_04.php
1.39 KB
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tutorial_lazy_initialization.php
914 B
lrw-r--r--
2019-12-18 11:15:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).