Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP custom Plugin problem #516

Closed
CanzumDemir opened this issue Jun 12, 2023 · 3 comments
Closed

PHP custom Plugin problem #516

CanzumDemir opened this issue Jun 12, 2023 · 3 comments

Comments

@CanzumDemir
Copy link

Hello pinpoint team.
If I add my TestPlugin in the index.php defined plugins folder like this:
define('PLUGINS_DIR',__DIR__.'/Plugins/');
my plugin does not work.

But if I create another folder called AutoGen in the Plugins folder like in the testapp and insert my test plugin in the AutoGen folder it works.

Is this normal or have I misunderstood something because here https://github.com/pinpoint-apm/pinpoint-c-agent/blob/master/plugins/PHP/Readme.md in step 5 it just says paste plugin in Plugins source tree and not in Plugins/AutoGen?

@CanzumDemir CanzumDemir changed the title PHP Plugin PHP custom Plugin problem Jun 12, 2023
@eeliu
Copy link
Collaborator

eeliu commented Jun 13, 2023

please shared your project files.

BYW,if you use tp5, follow https://github.com/pinpoint-apm/pinpoint-c-agent/tree/master/plugins/PHP/Framework/ThinkPHP5

@CanzumDemir
Copy link
Author

CanzumDemir commented Jun 13, 2023

I don't use any framework in my PHP project. I instrument the functions I want to instrument with "///hook...". But the plugin only works if I put it in the /Plugins/AutoGen folder instead of directly in /Plugins.

Here is my example project:
test.zip
The Plugin is in "application/Plugins/AutoGen" (MyPlugin.php)
and if you move it to
"application/Plugins" and customize the namespace, delete Cache then it is not working

Do I have to use a framework which is supported or have I configured something wrong?

@eeliu
Copy link
Collaborator

eeliu commented Jun 14, 2023

Yes, pinpoint-aop-php does only scan XXXPlugin.php within AutoGen folder.

image

Sorry, I will update the guide.

eeliu added a commit to eeliu/pinpoint-c-agent that referenced this issue Jun 14, 2023
eeliu added a commit that referenced this issue Jun 14, 2023
eeliu added a commit that referenced this issue Mar 28, 2024
eeliu added a commit that referenced this issue Mar 28, 2024
eeliu added a commit that referenced this issue Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants