Skip to content

Commit 8195a44

Browse files
committed
cleanup code before code review
Remove experimental code from the code base - include_once InstalledVersions.php achieves the same result as the closure checking presence of class and methods which involves autoloader to eventually include InstalledVersions.php to find the InstalledVersion class.
1 parent c1deff2 commit 8195a44

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

agent/lib_composer.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,8 @@ static int nr_execute_handle_autoload_composer_init(const char* vendor_path) {
4242
return NR_SUCCESS;
4343
}
4444

45-
#if 0
46-
(void)vendor_path;
47-
code
48-
= nr_formatf(""
49-
"(function() {"
50-
" try {"
51-
" if (class_exists('Composer\\InstalledVersions')) {"
52-
" if (method_exists('Composer\\InstalledVersions', "
53-
" 'getInstalledPackages') && method_exists('Composer\\InstalledVersions', "
54-
" 'getVersion')) {"
55-
" return true;"
56-
" } else {"
57-
" return false;"
58-
" }"
59-
" } else {"
60-
" return false;"
61-
" }"
62-
" } catch (Exception $e) {"
63-
" return NULL;"
64-
" }"
65-
"})();");
66-
#else
6745
code = nr_formatf("include_once '%s/composer/InstalledVersions.php';",
6846
vendor_path);
69-
#endif
7047

7148
result = zend_eval_string(code, &retval, "newrelic\\init_composer_api");
7249
if (result != SUCCESS) {

0 commit comments

Comments
 (0)