aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/docs/hook_system.html
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-09-23 13:14:28 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-09-23 13:14:28 +0000
commit91f5af494b350d6b43b03316d381cc25e34933c7 (patch)
tree3ee6c1bdd58fc92585b2a3fcdd1adf874f18a9c2 /phpBB/docs/hook_system.html
parent6e2d395da9fd3f2d641e368eea40322df7159955 (diff)
downloadforums-91f5af494b350d6b43b03316d381cc25e34933c7.tar
forums-91f5af494b350d6b43b03316d381cc25e34933c7.tar.gz
forums-91f5af494b350d6b43b03316d381cc25e34933c7.tar.bz2
forums-91f5af494b350d6b43b03316d381cc25e34933c7.tar.xz
forums-91f5af494b350d6b43b03316d381cc25e34933c7.zip
PHP4 compatibility
git-svn-id: file:///svn/phpbb/trunk@8104 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/docs/hook_system.html')
-rw-r--r--phpBB/docs/hook_system.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html
index d877757050..2bcffe3458 100644
--- a/phpBB/docs/hook_system.html
+++ b/phpBB/docs/hook_system.html
@@ -434,11 +434,11 @@ class my_hookable_object
{
global $phpbb_hook;
- if ($phpbb_hook-&gt;call_hook(array(get_class(), __FUNCTION__), $my_first_parameter, $my_second_parameter))
+ if ($phpbb_hook-&gt;call_hook(array(get_class($this), __FUNCTION__), $my_first_parameter, $my_second_parameter))
{
- if ($phpbb_hook-&gt;hook_return(array(get_class(), __FUNCTION__)))
+ if ($phpbb_hook-&gt;hook_return(array(get_class($this), __FUNCTION__)))
{
- return $phpbb_hook-&gt;hook_return_result(array(get_class(), __FUNCTION__));
+ return $phpbb_hook-&gt;hook_return_result(array(get_class($this), __FUNCTION__));
}
}
@@ -447,7 +447,7 @@ class my_hookable_object
}
</pre></div>
-<p>The only difference about calling it is the way you define the first parameter. For a function it is only <code>__FUNCTION__</code>, for a method it is <code>array(get_class(), __FUNCTION__)</code>.</p>
+<p>The only difference about calling it is the way you define the first parameter. For a function it is only <code>__FUNCTION__</code>, for a method it is <code>array(get_class($this), __FUNCTION__)</code>. Since PHP 5.0.0 the get_class() function no longer requires the object to be given, you simply write: <code>array(get_class(), __FUNCTION__)</code>.</p>
<p>Now, in phpBB there are some pre-defined hooks available, but how do you make your own hookable function available (and therefore allowing others to hook into it)? For this, there is the add_hook() method:</p>
@@ -579,11 +579,11 @@ class my_hookable_object2 extends my_hookable_object
{
global $phpbb_hook;
- if ($phpbb_hook-&gt;call_hook(array(get_class(), __FUNCTION__), $my_first_parameter, $my_second_parameter))
+ if ($phpbb_hook-&gt;call_hook(array(get_class($this), __FUNCTION__), $my_first_parameter, $my_second_parameter))
{
- if ($phpbb_hook-&gt;hook_return(array(get_class(), __FUNCTION__)))
+ if ($phpbb_hook-&gt;hook_return(array(get_class($this), __FUNCTION__)))
{
- return $phpbb_hook-&gt;hook_return_result(array(get_class(), __FUNCTION__));
+ return $phpbb_hook-&gt;hook_return_result(array(get_class($this), __FUNCTION__));
}
}
}
@@ -636,11 +636,11 @@ class my_hookable_object2 extends my_hookable_object
{
global $phpbb_hook;
- if ($phpbb_hook-&gt;call_hook(array(get_class(), __FUNCTION__), $my_first_parameter, $my_second_parameter))
+ if ($phpbb_hook-&gt;call_hook(array(get_class($this), __FUNCTION__), $my_first_parameter, $my_second_parameter))
{
- if ($phpbb_hook-&gt;hook_return(array(get_class(), __FUNCTION__)))
+ if ($phpbb_hook-&gt;hook_return(array(get_class($this), __FUNCTION__)))
{
- return $phpbb_hook-&gt;hook_return_result(array(get_class(), __FUNCTION__));
+ return $phpbb_hook-&gt;hook_return_result(array(get_class($this), __FUNCTION__));
}
}
}