нашел на
оффоруме очень полезную, на мой взгляд инфу, читаем:
Цитата:
|
Сообщение от Brad
This is in the manual but I've yet to see it mentioned here.
The plugin system works by storing all plugin code for all scripts in memory, so you can quickly find your plugins using large amounts of memory if they contain a lot of code.
A simple way to avoid this problem is to use the plugin code simply to call an external script, which contains all the complex code. In this way the code is only loaded when it is actually required.
For example, a plugin could contain this:
PHP код:
$tmp_uid =& $vbulletin->userinfo['userid'];
$db->query_write("
INSERT INTO " . TABLE_PREFIX . "profilelog
(userid, dateline)
VALUES
($tmp_uid, " . TIMENOW . ")
");
or alternatively, that code could be placed into a file called (for example) plugins/my_script.php, and the plugin itself would contain this:
PHP код:
include('./plugins/my_script.php');
Naturally, the second option will use up far less memory than the first, and this saving will become more and more beneficial as the amount of code to be run increases.
You should also take a look at this project: http://www.vbulletin.org/forum/showthread.php?t=107315 => Compress Forum Templates
|
если коротко и на русском:
на многих форумах установлена куча продуктов/плагинов, php-код которых сохраняется в базе данных в таблице
datastore и
plugin
скрипты и коды плагинов, так же забивают память, что бы немного разгрузить ее, можно проделать вышеописанные операции
например если код плагина содержит очень большое кол-во строк кода, это будет пользительно
P.S.
сорри за столь фривольный перевод =))
===========
проверял на локалке - работает
для отладки кода, так вообще супер! ненадо теперь пересохранять плагин, после его изменения, достаточно редактировать код в редакторе (Ctrl+S - и готово) а в плагине просто приинклудить файл с кодом
===========
Надеюсь, кому то пригодится эта информация =))