PDA

View Full Version : Plugins and Performance


Shamil.
12-21-2010, 12:22 AM
Hello,

I'm creating a server management system that'll work with my servers. The script used to initially monitor the servers use a variety of cURL connection.

Now, I've set this up so that it has its own page within vBulletin. I've setup a plugin for the file (which has all of the main stuff in it) to be included as so:

Hook Location: global_start

Plugin PHP Code:


ob_start();
require_once('/home/site/public_html/manage/includes/load.php');
$loadavgphp = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('manage_index',array('loa davgphp' => $loadavgphp));


Now, the problem with this plugin being active, is that it is called every time a page is loaded, regardless of whether this specific thing is being called. So, are there any ways I could cut this?

The plugin is included using a simple {vb:rar loadavgphp}. Evidently, global_start isn't appropriate. Any ideas? Maybe parse_templates (no, that just includes it on every page load, and only it is outputted, not helpful)?