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

[Docs] Migrate phpstorm docs page #208

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HuongNV13
Copy link
Member

@HuongNV13 HuongNV13 commented Jun 10, 2022

Trying to migrate my first new Moodle Dev Doc

@netlify
Copy link

netlify bot commented Jun 10, 2022

Deploy Preview for moodledevdocs ready!

Name Link
🔨 Latest commit 7984d72
🔍 Latest deploy log https://app.netlify.com/sites/moodledevdocs/deploys/62a306774680f800083bbddc
😎 Deploy Preview https://deploy-preview-208--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 10, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟢 93 🟢 95 🟢 100 🟢 90 🟢 100 Report
/docs/apis/commonfiles 🟠 71 🟢 94 🟢 100 🟢 100 🟢 100 Report
/general/development/gettingstarted 🟠 89 🟢 94 🟢 100 🟢 90 🟢 100 Report
/general/releases 🟠 84 🟢 94 🟢 100 🟢 100 🟢 100 Report

Copy link
Member

@andrewnicols andrewnicols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few, mostly minor, changes here I think.

- PhpStorm
- Tools
---
<!-- markdownlint-disable MD029 -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

title: Setting up PhpStorm
tags:
- PhpStorm
- Tools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding 'IDE' and/or 'Editor' to the list of tags

- Use `/** @var admin_root $ADMIN */` to autofill $ADMIN->...
- Remove SQL syntax inspection errors for Moodle tables surrounded by curly brackets (like: `SELECT * FROM {user}`) by adding `\{(\w+)\}` to Tools > Databases > user parameters
(more info: https://blog.jetbrains.com/phpstorm/2014/11/database-language-injection-configuration/ , and a "feature request" to improve it: https://youtrack.jetbrains.com/issue/WI-4123 )
- You can deactivate warnings for specific exceptions (in particular the coding_exception, which is unlikely to be catched in your code) by going to Settings > PHP and add them to 'Unchecked Exceptions' under the 'Analysis' tab
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- You can deactivate warnings for specific exceptions (in particular the coding_exception, which is unlikely to be catched in your code) by going to Settings > PHP and add them to 'Unchecked Exceptions' under the 'Analysis' tab
- You can deactivate warnings for specific exceptions (in particular the `coding_exception`, which is unlikely to be caught in your code) by going to Settings > PHP and add them to 'Unchecked Exceptions' under the 'Analysis' tab

@@ -72,6 +74,7 @@ calculatedmulti
calculatedsimple
capabilityname
captype
catched
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a word :) You're after caught

Suggested change
catched

@@ -211,6 +211,7 @@ const sidebars = {
'development/tools/mdk',
'development/tools/phpcs',
'development/tools/nodejs',
'development/tools/phpstorm',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest maybe creadting a sub-category for IDEs here?

Comment on lines +128 to +138
```php
XDEBUG_CONFIG:
idekey=phpstorm
remote_enable=1
remote_mode=req
remote_port=9000
remote_host=host.docker.internal
remote_connect_back=0
PHP_IDE_CONFIG:
serverName=moodle-local
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```php
XDEBUG_CONFIG:
idekey=phpstorm
remote_enable=1
remote_mode=req
remote_port=9000
remote_host=host.docker.internal
remote_connect_back=0
PHP_IDE_CONFIG:
serverName=moodle-local
```
```yaml
XDEBUG_CONFIG:
idekey=phpstorm
remote_enable=1
remote_mode=req
remote_port=9000
remote_host=host.docker.internal
remote_connect_back=0
PHP_IDE_CONFIG:
serverName=moodle-local

Comment on lines +142 to +166
```php
webserver:
image: "moodlehq/moodle-php-apache:${MOODLE_DOCKER_PHP_VERSION}"
depends_on:
- db
volumes:
- "${MOODLE_DOCKER_WWWROOT}:/var/www/html"
- "${ASSETDIR}/web/apache2_faildumps.conf:/etc/apache2/conf-enabled/apache2_faildumps.conf"
environment:
MOODLE_DOCKER_DBTYPE: pgsql
MOODLE_DOCKER_DBNAME: moodle
MOODLE_DOCKER_DBUSER: moodle
MOODLE_DOCKER_DBPASS: "m@0dl3ing"
MOODLE_DOCKER_BROWSER: firefox
MOODLE_DOCKER_WEB_HOST: "${MOODLE_DOCKER_WEB_HOST}"
XDEBUG_CONFIG:
idekey=phpstorm
remote_enable=1
remote_mode=req
remote_port=9000
remote_host=host.docker.internal
remote_connect_back=0
PHP_IDE_CONFIG:
serverName=moodle-local
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```php
webserver:
image: "moodlehq/moodle-php-apache:${MOODLE_DOCKER_PHP_VERSION}"
depends_on:
- db
volumes:
- "${MOODLE_DOCKER_WWWROOT}:/var/www/html"
- "${ASSETDIR}/web/apache2_faildumps.conf:/etc/apache2/conf-enabled/apache2_faildumps.conf"
environment:
MOODLE_DOCKER_DBTYPE: pgsql
MOODLE_DOCKER_DBNAME: moodle
MOODLE_DOCKER_DBUSER: moodle
MOODLE_DOCKER_DBPASS: "m@0dl3ing"
MOODLE_DOCKER_BROWSER: firefox
MOODLE_DOCKER_WEB_HOST: "${MOODLE_DOCKER_WEB_HOST}"
XDEBUG_CONFIG:
idekey=phpstorm
remote_enable=1
remote_mode=req
remote_port=9000
remote_host=host.docker.internal
remote_connect_back=0
PHP_IDE_CONFIG:
serverName=moodle-local
```
```yaml
webserver:
image: "moodlehq/moodle-php-apache:${MOODLE_DOCKER_PHP_VERSION}"
depends_on:
- db
volumes:
- "${MOODLE_DOCKER_WWWROOT}:/var/www/html"
- "${ASSETDIR}/web/apache2_faildumps.conf:/etc/apache2/conf-enabled/apache2_faildumps.conf"
environment:
MOODLE_DOCKER_DBTYPE: pgsql
MOODLE_DOCKER_DBNAME: moodle
MOODLE_DOCKER_DBUSER: moodle
MOODLE_DOCKER_DBPASS: "m@0dl3ing"
MOODLE_DOCKER_BROWSER: firefox
MOODLE_DOCKER_WEB_HOST: "${MOODLE_DOCKER_WEB_HOST}"
XDEBUG_CONFIG:
idekey=phpstorm
remote_enable=1
remote_mode=req
remote_port=9000
remote_host=host.docker.internal
remote_connect_back=0
PHP_IDE_CONFIG:
serverName=moodle-local

1. Only if you're using Docker on linux: From a PhpStorm terminal, run: `docker exec -it moodledocker_webserver_1 ./add-host.docker.internal-to-etc-hosts`. You have to see how packages are installed.
1. In any type of host (Mac, Windows or linux): Check that `/etc/hosts</syntaxhighlight> has a line with <syntaxhighlight lang="php">host.docker.internal</syntaxhighlight>. You can do that with the command <syntaxhighlight lang="php">docker exec -it moodledocker_webserver_1 cat /etc/hosts` (if you have a custom container name, use the name for the webserver container). The result should be something like this:

```php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what type to put here, but not php. Text maybe?

Suggested change
```php

172.20.0.1 host.docker.internal
```

8. Go to your PhpStorm and go to `Run -> Edit configurations</syntaxhighlight> and select new <syntaxhighlight lang="php">PHP Remove Debug`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more syntaxhighlight occurrences


You can work on JavaScript development by add Grunt configuration:

1. Install Watchman - https://facebook.github.io/watchman/docs/install.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Install Watchman - https://facebook.github.io/watchman/docs/install.html
1. Install [Watchman](https://facebook.github.io/watchman/docs/install.html)

@andrewnicols andrewnicols marked this pull request as draft June 24, 2022 14:01
@andrewnicols
Copy link
Member

I've converted this PR to a draft. Please send back to review when ready.

@moodle moodle deleted a comment Jan 1, 2023
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

Successfully merging this pull request may close these issues.

2 participants