Open GoogleCodeExporter opened 9 years ago
I believe I found the problem. I replaced phphooks.class.php line 100, which
was:
if (($this->active_plugins == NULL || in_array ( $file, $this->active_plugins
)) && strpos ( $from_folder . $file, '.plugin.php' )) {
with:
if (($this->active_plugins != NULL && in_array ( $file, $this->active_plugins
)) && strpos ( $file, '.plugin.php' )) {
And now the example works correctly.
Original comment by r...@vnetworx.net
on 10 Feb 2012 at 11:56
Example was loading all de-active plugins... so to fix that we must change
following line:
if (($this->active_plugins == NULL || in_array ( $file, $this->active_plugins
)) && strpos ( $from_folder . $file, '.plugin.php' )) {
with:
if (($this->active_plugins != NULL && in_array ( $file, $this->active_plugins
)) && strpos ( $from_folder . $file, '.plugin.php' )) {
Original comment by nee...@gr8logics.com
on 4 Jul 2013 at 6:44
The example still doesn't work though.
Clock plugin LOADED!
Plugin 2 LOADED!
Plugin 1 LOADED!
some hardcoded stuff, 'test' hook following
no any plugin hooks into TEST!!!
some hardcoded stuff, 'test1' hook following
no any plugin hooks into TEST1!!!
some hardcoded stuff, 'test2' hook following
no any plugin hooks into TEST2!!!
some hardcoded stuff, 'with_args' hook following
no any plugin hooks on with_args!!!
some hardcoded stuff, 'filter' hook following
no any plugin hooks on filter!!!
Print all plugins hearder
Array
(
[0] => Array
(
[filename] => withargs.plugin.php
[Name] => Plugin Withargs
[Title] => Plugin Withargs
[PluginURI] => http://www.instant-update.com/
[Description] => This is plugin withargs
[Author] => Nemanja Avramovic
[AuthorURI] => http://www.instant-update.com/
[Version] => 1.0
)
[1] => Array
(
[filename] => plugin2.plugin.php
[Name] => Plugin2
[Title] => Plugin2
[PluginURI] => http://code.google.com/p/phphooks/source/browse/trunk/plugins/plugin2/plugin2.plugin.php
[Description] => This is plugin2
[Author] => Eric Wang
[AuthorURI] => http://www.ericbess.com/
[Version] => 1.0
)
[2] => Array
(
[filename] => plugin1.plugin.php
[Name] => Plugin1
[Title] => Plugin1
[PluginURI] => http://code.google.com/p/phphooks/source/browse/trunk/plugins/plugin1.plugin.php
[Description] => This is plugin1
[Author] => Eric Wang
[AuthorURI] => http://www.ericbess.com/
[Version] => 1.0
)
)
Original comment by r...@vnetworx.net
on 6 Jul 2013 at 9:50
Original issue reported on code.google.com by
r...@vnetworx.net
on 12 Jan 2012 at 8:57