私はプラグイン システムに取り組んでおり、現時点ではcall_user_func_array
. そして、それは遅く、メモリを使用します。
私の機能は機能しており、次のようになります。
public static function __callStatic($method, $args)
{
$plugins = self::_checkEventCache($method);
if( count($plugins) ) :
foreach( $plugins as $p ):
$tmp = call_user_func_array(array(self::$_installedPlugins[$p], $method), array(&$args));
endforeach;
endif;
self::$_current_event = $method;
}
私の質問は、これを直接呼び出すか、速度を上げるにはどうすればよいですか? 後でいくつの引数が付けられるかわかりません。
取り除くための解決策はありcall_user_func_array
ますか?
$tmp =
これにも取り組んでいません。以前 - static を使用しなかった場合、値が返されました。私が使用した古いコードは次のようなものでした:
$tmp = $this->_installedPlugins[$p]->{$method}($args);
if( $tmp !== NULL ){
$this->_event_result[$method] = $tmp;
}
静的クラスを使用すると、同じ結果を得る必要があります。
何か案は?