A
A
Alexey Burlaka2017-03-04 13:18:52
Eclipse
Alexey Burlaka, 2017-03-04 13:18:52

Eclipse PDT / PHPStorm - how to set up full tooltips?

Help me to understand.
One of the clients updated and instead of stable updates, he also downloaded beta. On the site, all standard components have been replaced with pure D7 (new kernel) code.
This was not immediately noticed, orders on the site are active, so the option to roll back to backup did not fit.
I write on Notepad++ , from memory (hints only distract) it suits me. But then a situation arose when you urgently need to deal with the new kernel, and the documentation for it is ready for fifteen percent (IMHO), although it has been five years since it was born. Therefore, a powerful tool was needed with a “tree-like scanner” by class and hints.
Fully downloaded D7-kernel, installed Eclipse PDTand fed him. He tells everything well, but the following situation arose. If we consider such a code, in the list of proposed
methods starting with “ get ” it gives the following list: give extended list: Similar to PHPStorm . By the way, the storm proved to be worse in this situation: it doesn’t give any options for the $bi variable at all (and when you type a namespace, for example “ \Bitrix\Iblock\ ” , there are no hints, while eclipse gives out subclasses): storm picks up:
5f06d96260a94da38720c9a24a2bc785.png

4cc0969806a5458c945b5f0ac3263b7f.png

6ec305595a9243e1ae29341343ab821f.png
caa365a7a05c40e1a8392ada6044f321.png
Actually the question and a few related questions:
Tell me, please, how can I understand in the process of typing code: hints contain a complete set or something else can be connected and for this you need a phpdoc insert (and understand which one) similar to the one in the example ?
• Is the situation with the storm regular, or have I not configured something and it “can do better”?
• Who is in Notepad++ : is there some kind of plug-in that allows you to feed the kernel for indexing in the same way?
PS: in the process of analyzing the situation, Visual Studio Code was also tried, but there is even more sadness.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Burlaka, 2017-03-09
@AlexeyGfi

I asked myself, I answer myself =)
I tormented technical support, but the conversation is like tennis - throwing the ball from field to field.
I set up debugging through xdebug and saw everything in the watcher.
Here's what it looks like in the debugger:
================ Remote debugging (remote debug, xdebug) ================
What you need to set up debugging remotely (because, damn it, I had to dig deeper).
Given :
Computer #1 :
Windows + PhpStorm.
Computer #2 :
Debian + Apache remotely.
Task: organize synchronous debugging between computers.
Important : storm will step through your file, and " listen " to the xdebug report it broadcasts by walking through the files on the remote server.
Therefore, the file opened in the storm must be an exact copy of what is running on the server.
In it, I disabled the xdebug.remote_enable variable , because requests from all sites on the server start pouring into the storm =) I
initialized this variable via .htaccess in the directory where I debug:
(!)within the entire site :
To make it work like this: debugging is disabled for ordinary users, and for you it starts - in htaccess we write:

<If "%{REMOTE_ADDR} == '137.126.15.14'">
  php_flag xdebug.remote_enable on
</If>

... where 137.126.15.14 is your IP address (analogous to $_SERVER[ 'REMOTE_ADDR' ] php variable ) You can fine
- tune htaccess so that the admin panel doesn't break into debugging (or vice versa). An example of a config ( REQUEST_URI didn't want to be used, xs why - they are defined in phpinfo() ):
<If "%{REMOTE_ADDR} == '137.126.15.14' && ! %{THE_REQUEST} =~ m#/bitrix/#">
  php_flag xdebug.remote_enable on
  php_flag xdebug.remote_autostart on
</If>

If different programmers work on the server / site , debug streams can be separated by broadcasting to different ports depending on the user (client IP address):
<If "%{REMOTE_ADDR} == '137.126.15.14' && ! %{THE_REQUEST} =~ m#/bitrix/#">
  php_flag xdebug.remote_enable on
  php_flag xdebug.remote_autostart on
  php_value xdebug.remote_port 9013
</If>

2 . Forwarding an SSH tunnel .
Task : make sure that information is received on port 9007 of computer No. 1 , which is broadcast on port 9002 of computer No. 2 .
Based on the wording, thanks to this method, you can forward the tunnel if the ports are different.
For example, you got a server to which you have SSH access, but there is no way to change the xdebug port. Or locally the port is busy and you need some non-standard one.
That is, it is possible to forward, for example, a tunnel that will transmit information to port 9007 of computer No. 1 from port 9002 of computer No. 2. The server pushes information to 9002, and you are listening on port 9007 on the local computer.
Did it via putty :
...how to check?
================ PHPStorm ================
3 . On the computer, set to listen on port 9007 (in my case):
Menu File / Settings / Languages ​​& Frameworks / PHP / Debug + button "Start Listening for PHP Debug Connections"
+
Here is a screenshot that is sorely missing in all the tutorials that have been unearthed:
805110c8b3bb43a19192778aac36aac8.pngResult: when the storm listens to a port and we open a page in a normal browser that is in the section that kicks xdebug.remote_enable , the storm intercepts the signal and sends it through its debugger.
You just need to remember to either set a breakpoint or the Break at first line option in the PHP script, otherwise the script will just fly by and you won't even notice =)
Regarding file matching / mismatching locally and remotely: if the storm notices that it cannot match files, it will issue warning and prompts you to configure the mapping:
================ ECLIPSE PDT ================
The steps on the server and tunnel remain the same.
Go to Windows / Preferences / PHP / Servers .
We create a new server there:
We go into it again and configure the tabs that have appeared:
We set the created server by default:
We set it up so that the debugger breaks from the very first line (then you can turn it off and use breakpoints):
When we make sure that everything works, — it is recommended to do the same, but individually for a specific project: through the project's Property , or through Debug Configuration :
Everything.
Now, when a signal is received on port 9007, Eclipse starts up: We receive the
signal and start debugging.

V
Vadim, 2017-03-04
@kylt_lichnosti

Well, with a storm, it’s quite a regular situation. How does he know what class the object is there and whether the object is at all. Must be included in the annotation.
The variable should also be highlighted in the storm if there is a call to methods and he does not know its class.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question