From f91e99285196a3ef6d4f570e4839f7a4d87d5890 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 22 Apr 2010 18:03:05 -0400 Subject: [PATCH] use onAutoload instead of always requiring --- plugins/Autocomplete/AutocompletePlugin.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index d586631a4a..b2b18bf275 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php'); - class AutocompletePlugin extends Plugin { function __construct() @@ -40,6 +38,16 @@ class AutocompletePlugin extends Plugin parent::__construct(); } + function onAutoload($cls) + { + switch ($cls) + { + case 'AutocompleteAction': + require_once(INSTALLDIR.'/plugins/Autocomplete/autocomplete.php'); + return false; + } + } + function onEndShowScripts($action){ if (common_logged_in()) { $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js'); -- 2.39.5