-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistry.php
More file actions
81 lines (41 loc) · 938 Bytes
/
registry.php
File metadata and controls
81 lines (41 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
set_include_path(realpath(dirname(__FILE__) . '/inc'));
/**
* Simple Registry example
*
*
*/
/*
require_once 'Zend/Registry.php';
$myVar = 'this is a value';
Zend_Registry::set('myVar', $myVar);
class RegistryExample
{
public function __construct()
{
error_reporting (E_ALL ^ E_NOTICE);
echo '$myVar is set to "' . $myVar . '"<br />';
echo 'myVar in the registry is set to "' . Zend_Registry::get('myVar') . '"<br />';
}
}
$example = new RegistryExample();
*/
/**
* Registry example using objects and checking if the key is
* already registered
*
*
*/
/*
require_once 'Zend/Registry.php';
$myObj = new StdClass();
$myObj->name = 'Jason';
Zend_Registry::set('myObj', $myObj);
$newObj = new StdClass();
$newObj->name = 'Tester';
if (!Zend_Registry::isRegistered('myObj')) {
Zend_Registry::set('myObj', $newObj);
}
echo "<pre>";
var_dump(Zend_Registry::get('myObj'));
*/