jetbrains / phpstorm-workshop Goto Github PK
View Code? Open in Web Editor NEWCode for the PhpStorm workshop
Home Page: https://www.jetbrains.com/phpstorm
License: Apache License 2.0
Code for the PhpStorm workshop
Home Page: https://www.jetbrains.com/phpstorm
License: Apache License 2.0
I can't find the file AdvancedTemplate.txt.
My phpstorm version: PS-139.1069(8.0.3)
in File:
I use "_name" it works well, So please point how to navigate to the $_name. Thank you
// 2. Place the cursor right after the first *. Press and hold Alt+Shift and use the mouse to select
// the locations where a cursor is desired, right after every *.
This needs to be changed to Alt+Click. I am relatively new to PhpStorm and I was trying my best to get this to work until I googled the answer. It had me so frustrated, lol.
Great program and workshop materials!
lesson 5.1
I can't find a shortcut that sets this as a key, so basically, for me, there is no way to unhighlight.
Currently there is no Vagrant box for Parallels, please see
I'm using Docker composer with a PHP. When trying to set the interpreter I choose Docker compose and connecting with existing container and then it fails with the error "Failed to parse script validation output".
If I execute php -v inside the container everything seems fine,
What is the expected result? An installed php version should be shown
What happens instead? Failed to parse validation script output message and PHP version: not installed label
It's working fine with docker-compose run lifecycle
PS:
OS : RHEL 8.8
PhpStorm 2023.1.2
Docker version 24.0.2, build cb74dfc
Settings > Build, Execution, Deployment > Docker > Tools and checking the box "Use Compose V2" didn't work for me.
Getting below error in ide.log
2023-06-15 11:30:07,860 [1825374] FINE - #c.j.p.c.p.PhpInfoUtil - Parsing validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php
2023-06-15 11:30:07,861 [1825375] INFO - STDERR - [Fatal Error] :1:1: Content is not allowed in prolog.
2023-06-15 11:30:07,861 [1825375] WARN - #c.j.p.c.p.PhpInfoUtil - Failed to parse validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php
2023-06-15 11:30:07,862 [1825376] FINE - #c.j.p.c.p.PhpInfoUtil -
com.intellij.execution.ExecutionException: Failed to parse validation script output
Hello,
I think it would be nice to have a behat testing documentation/solution.
Thank you for your hard work!
In 1.3_Navigate_to_class.md it says
Check the Include non-project classes check box and open the ArrayObject (PHP SPL library) class. By default PhpStorm only searches classes inside your project, not your dependencies in the vendor folder.
Command+O opens a search window on the "Classes" tab. There is no "include non-project classes" check box that I could find.
After some travels through the Google and randomly trying things in the app, i found that if you choose the "All" tab, you get a checkbox for "Include non-project items", and the setting there seems to stick when you go back to the "Classes" tab.
I guess the app is moving faster than the workshop pages, but I'm not sure of a good way to explain all of that.
This is in PhpStorm 2021.1.3 Build PS-211.7442.50 from 2 June 2021, on MacOS
The main idea of the workshop is to provide the seamless experience with the new features, meaning (no configuration, no terminal usage and so on). We provide the Vagrant box that has everything needed (PHP, Behat, etc.). You should avoid using anything besides that.
The fix should avoid behat --init
, use Vagrant interpreter instead, and progress via MD file (instead of PHP comments)
Since configuration will be different for Docker there should be a fix for Docker
branch as well.
Hello,
In 08_Testing/02_Runing_tests is written:
// From the Settings | Languages & Frameworks | PHP | Test Frameworks | PHPUnit,
// set workshop\08_Testing\Code\Bootstrap.php as the default bootstrap file.
I have tried different configuration and for me only works
// set /opt/project/workshop/08_Testing/Code/Bootstrap.php as the default bootstrap file or
// set Code/Bootstrap.php as the default bootstrap file
otherwise Boostrap.php file could not be found...
Running on 10.12.3 with Docker Machine and it doesn't seem to be able to get it all the way up...
docker-compose up
Starting phpstormworkshop_sftp_1
Starting phpstormworkshop_debug_1
Creating phpstormworkshop_mysql_1
Attaching to phpstormworkshop_sftp_1, phpstormworkshop_debug_1, phpstormworkshop_mysql_1
debug_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.24.0.3. Set the 'ServerName' directive globally to suppress this message
debug_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.24.0.3. Set the 'ServerName' directive globally to suppress this message
debug_1 | [Fri Mar 31 10:51:39.148411 2017] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.1.2 configured -- resuming normal operations
mysql_1 | Initializing database
phpstormworkshop_mysql_1 exited with code 1
Example for "Surround With" is invalid in:
02 - Editing/04 - Surround With/4.1. Surround with.php
Surround With works only for valid code.
Since REST_Client is deprecated it make sense to update workshop 01_REST_Client task to new HttpClient
Lesson 1.5:
Use filters
Filter to only search in JavaScript files and find the celebrateBirthday() function in the Customer.js file.
The filter is actually called ECMAScript 6
That was not intuitive, so it should be stated that this filter should be used.
It's good to know this 'subtle' difference exists...
I have docker-compose.yml file in the root of my project and I can run it directly from terminal with docker-compose up
But when I try to add a docker debug configuration from docker-compose file, I cannot set proper absolute path.
When I add path do docker-compose.yml, everything is fine.
But when I press OK, the IDE replace it with a relative path based on my project dir, like this:
And obviously this configuration cannot run with the following error:
Deploying 'Compose: v2'...
Failed to deploy 'Compose: v2': Can't read compose file at /path/to/my/project/./v2/../../v2/docker-compose.yml
How can I set the absolute path, or make this relative path works in IDE?
I was following all of the tutorials in sequence from the beginning, and ran into my first issue with this part.
- Click "Create" application level copy of this deployment server and then click "OK"
Step 1 at the top of this tutorial had no issues. Step 2 could not be completed, I could not find "Create" anywhere, and after re-trying and snooping around, I still could not figure out this step.
- Click [...] and and make sure that path for PHPCS is
phpcs
. Validate installation.
When clicking "Validate" I received the error Cannot run program "phpcs": error=2, No such file or directory
My phpstorm version: PS-139.1069 (8.0.3).
Instructions for Composer Init at workshop/12_Tools/02_Composer.md seems to be outdated: one can't Initialize Composer via context menu.
We should correct instructions accordingly
I use phpstorm 2022.3
In chapter 06_Todo folder, in file 01_Todo.php, in line 5, says that Alt+6 (Windows/Linux) is the shortcut for the Todo Tool Window
However, Alt + 6 opens the Problems Tool Window.
In the first tutorial...
phpstorm-workshop / 01 - Navigation / 01 - Navigate to something you know / 1.1. Project Tool Window.txt
It says the keyboard shortcut for opening the Project Window is Alt+1 (Windows/Linux/Mac OS X)
On Mac OSX, it is suppose to be Command+1
I don't understand what is meant with 'Suppress for statement'.
I can choose 'Typo rename to...', but there is no 'Suppress for statement'
// 7. A warning highlight is shown on the misspelled variable "$mispelled".
// Suppress the inspection for this statement only using Show Intention Actions | Typo rename to...
// | Suppress for statement
It's a typo, or it is not clear what is supposed to happen, or it is not clear what I am supposed to do.
Open the Settings Pane and then Languages and Frameworks | PHP
There is no PHP in 'Languages and Frameworks'.
Unclear if I should Install these as plugins,
Is something wrong with my installation?
Adding /** @var $people Person[] */
does not seem to make a difference when I type $person->
.
What I see in both cases (with and without the 'comment'):
I have to type >
as well, while in previous cases this was automatically added.
Then I see a popup dialog with getAge
, getName
, setAge
, setName
.
So, in both cases I see completion (at least in the way I understand it).
F1 also works in both cases.
Keymapping for a number of features is incorrect in the slides when using OSX. I'm using the OSX 10.5+ keymap, on PHPStorm 7.1.3.
Perhaps it would be better for the Materials to use a separate version of the slides for both Mac and Linux/Windows ?
Next Tab
Slide: Alt+Command Left / Right
Actually: Cmd+Shift + Square brackets ([ or ]) AND Ctrl + Left / Right
Project Tool Window
Slide: Alt + 1
Actually: Cmd + 1
Navigate to Declaration
No mention is made of the Mac version
Slide: Ctrl + Click
Actually: Cmd + Click
After these initial pages, the problems seem to become less frequent. Will create additional issues if more are found.
Create a custom Inspection profile in which only a few inspections are enabled.
HINT: Use the [...] next to the Inspection profile dropdown to enable or disable inspections in the selected profile.
I've searched in Settings, looked at the Code menu, looked at the interface...
Where is the 'Inspection profile dropdown'?
I follow the steps of the file:
workshop/10_Database/01_Connecting_to_a_database.md
But I cannot see the jetbrains database after that. Is that part working?
In docker-compose.yml the alternative XDEBUG_CONFIG is missleading.
Multiple configs are separated by space.
So with the proposed
XDEBUG_CONFIG: remote_host=host.docker.internal, remote_port=9001
XDebug tries to make a connection to http://host.docker.internal,:9001
and fails.
Working config is:
XDEBUG_CONFIG: remote_host=host.docker.internal remote_port=9001
By the way: Validate Debugger Configuration on Web Server shows all green check marks even with wrong config.
Last exercise:
01_Simple_Include.php
should be
01_Basic_Include.php
I guess.
At workshop/12_Tools/02_Composer.md. Caused by https://youtrack.jetbrains.com/issue/WI-23544
If one doesn't have local php installation - composer operations would silently fail
Lesson 1.6
Use recent files
Navigate to the $_name protected variable in Customer.php (type _name).
If you type this, nothing will be found, which is a bug, or good to know...
I think the idea is that you don't have to type anything, and you will see Customer.php among the recent files.
I'm on macOS Sonoma, using the latest Docker Desktop for Mac, and the latest version of PhpStorm.
I followed the guide to install the Workshop from within PhpStorm:
As instructed, I edited the docker-compose.yml
to uncomment:
XDEBUG_CONFIG: remote_host=host.docker.internal
and
- /tmp:/home/jetbrains/upload
I ran the project as instructed, but this fails on an ARM processor Mac as the images are all Intel-based.
I then tried on an Intel Mac (again, latest Docker & PhpStorm) and I am at least able to build the project and it appears to run.
The docker-compose.yml appears to suggest I should be able to reach the project on port 8081
but this also fails:
The logs say:
[Mon Oct 09 23:47:24.636827 2023] [autoindex:error] [pid 18] [client 192.168.65.1:30717] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
2023-10-09T23:47:24.637237955Z 192.168.65.1 - - [09/Oct/2023:23:47:24 +0000] "GET / HTTP/1.1" 403 493 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/118.0"
Later in the Debug your application section of the guide:
This is incorrect. There is no such interpreter automatically configured (that would require PhpStorm to create an .idea
folder with the interpreter already configured when generating the Workshop, right?):
I then attempt to create an interpreter, although the guide is no help at this point since it assumes it was automatically created:
Creating an interpreter which points at the php in the docker container is not enough. It appears a Run configuration needs to be created as well, and requires pointing the Run configuration at the exact same docker-compose.yml used when creating the interpreter:
After attempting to run the docker compose project, I was prompted with this:
There are no options for telling PhpStorm to get the phpinfo()
from the interpreter I've already configured. Given that I can't actually run this project, I can't copy and paste it either.
I stumbled upon this tutorial project after wasting time trying to get PhpStorm & xdebug working in a docker compose
environment. The PhpStorm documentation is very fragmented and doesn't walk someone through a full working example for a docker compose
-based setup. It's a shame that this official tutorial doesn't work either.
What is the right way to spin up a docker compose environment, configure PhpStorm to run the docker compose
containers, and connect to xdebug for debugging?
Nothing is highlighted or underlined, or what have you.
No other instruction than that it is dead code. Something should be visible, isn't it?
// 5. Dead code (unused variable).
public function deadCodeFunction1()
{
$variable = true;
}
phpstorm-workshop/docker-compose.yml
Line 25 in 9a177fa
This line confuses new users. Volume for Linux should be also uncommented.
https://stackoverflow.com/questions/62104686/getting-started-with-phpstorm/62112810#62112810
in the PDF of this repo as "Insert Live template" shortcut it say Alt + J instead of Ctrl + J
Hi,I have docker installed correctly,but when I add run configuration in phpstorm and run,the following message raising
Deploy log
Deploying 'Compose: docker-compose.yml'...
Failed to deploy 'Compose: docker-compose.yml': Cannot run program "docker-compose" (in directory "D:\project\docker-example"): CreateProcess error=2, 系统找不到指定的文件。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.