From: Craig Andrews Date: Thu, 22 Apr 2010 22:03:05 +0000 (-0400) Subject: use onAutoload instead of always requiring X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f91e99285196a3ef6d4f570e4839f7a4d87d5890;p=quix0rs-gnu-social.git use onAutoload instead of always requiring --- 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');