Skip to content

Commit 7a5f848

Browse files
authored
refactor(agent): improve magic file recognition performance (#975)
Speed up magic file recognition performance by removing files from `libraries` and `logging_frameworks` that belong to old and un-instrumented packages.
1 parent f9530ed commit 7a5f848

File tree

5 files changed

+0
-116
lines changed

5 files changed

+0
-116
lines changed

agent/php_execute.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -523,59 +523,7 @@ static nr_library_table_t libraries[] = {
523523
*/
524524
{"Laminas_Http", NR_PSTR("laminas-http/src/client.php"), nr_laminas_http_enable},
525525

526-
/*
527-
* Other frameworks, detected only, but not specifically
528-
* instrumented. We detect these as libraries so that we don't prevent
529-
* detection of a supported framework or library later (since a transaction
530-
* can only have one framework).
531-
*/
532-
{"Aura1", NR_PSTR("aura/framework/system.php"), NULL},
533-
{"Aura2", NR_PSTR("aura/di/src/containerinterface.php"), NULL},
534-
{"Aura3", NR_PSTR("aura/di/src/containerconfiginterface.php"), NULL},
535526
{"CakePHP3", NR_PSTR("cakephp/src/core/functions.php"), NULL},
536-
{"Fuel", NR_PSTR("fuel/core/classes/fuel.php"), NULL},
537-
{"Lithium", NR_PSTR("lithium/core/libraries.php"), NULL},
538-
{"Phpbb", NR_PSTR("phpbb/request/request.php"), NULL},
539-
{"Phpixie2", NR_PSTR("phpixie/core/classes/phpixie/pixie.php"), NULL},
540-
{"Phpixie3", NR_PSTR("phpixie/framework.php"), NULL},
541-
{"React", NR_PSTR("react/event-loop/src/loopinterface.php"), NULL},
542-
{"SilverStripe", NR_PSTR("injector/silverstripeinjectioncreator.php"), NULL},
543-
{"SilverStripe4", NR_PSTR("silverstripeserviceconfigurationlocator.php"), NULL},
544-
{"Typo3", NR_PSTR("classes/typo3/flow/core/bootstrap.php"), NULL},
545-
{"Typo3", NR_PSTR("typo3/sysext/core/classes/core/bootstrap.php"), NULL},
546-
547-
/*
548-
* Other CMS (content management systems), detected only, but
549-
* not specifically instrumented.
550-
*/
551-
{"Moodle", NR_PSTR("moodlelib.php"), NULL},
552-
/*
553-
* It is likely that this will never be found, since the CodeIgniter.php
554-
* will get loaded first, and as such mark this transaction as belonging to
555-
* CodeIgniter, and not Expession Engine.
556-
*/
557-
{"ExpressionEngine", NR_PSTR("system/expressionengine/config/config.php"), NULL},
558-
/*
559-
* ExpressionEngine 5, however, has a very obvious file we can look for.
560-
*/
561-
{"ExpressionEngine5", NR_PSTR("expressionengine/boot/boot.php"), NULL},
562-
/*
563-
* DokuWiki uses doku.php as an entry point, but has other files that are
564-
* loaded directly that this won't pick up. That's probably OK for
565-
* supportability metrics, but we'll add the most common name for the
566-
* configuration file as well just in case.
567-
*/
568-
{"DokuWiki", NR_PSTR("doku.php"), NULL},
569-
{"DokuWiki", NR_PSTR("conf/dokuwiki.php"), NULL},
570-
571-
/*
572-
* SugarCRM no longer has a community edition, so this likely only works
573-
* with older versions.
574-
*/
575-
{"SugarCRM", NR_PSTR("sugarobjects/sugarconfig.php"), NULL},
576-
577-
{"Xoops", NR_PSTR("class/xoopsload.php"), NULL},
578-
{"E107", NR_PSTR("e107_handlers/e107_class.php"), NULL},
579527
};
580528
// clang-format: on
581529

@@ -590,9 +538,6 @@ static nr_library_table_t logging_frameworks[] = {
590538
/* laminas-log - Logging for PHP */
591539
{"laminas-log", NR_PSTR("laminas-log/src/logger.php"), NULL},
592540
/* cakephp-log - Logging for PHP */
593-
{"cakephp-log", NR_PSTR("cakephp/log/log.php"), NULL},
594-
/* Analog - Logging for PHP */
595-
{"Analog", NR_PSTR("analog/analog.php"), NULL},
596541
};
597542
// clang-format: on
598543

tests/integration/logging/analog/test_supportability_metric.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/integration/logging/analog/vendor/analog/analog/lib/Analog/Analog.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/integration/logging/cakephp-log/test_supportability_metric.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/integration/logging/cakephp-log/vendor/cakephp/log/Log.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)