In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is to share with you about the method of setting up the atom environment for WordPress development, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Below by the WordPress tutorial column to introduce you to set up the atom environment for WordPress development methods, I hope to help friends in need!
WordPress is really a very strange project, many of its coding standards are so different from PSR2, for example, general php projects require spaces instead of TAB keys, but only WordPress requires the use of TAB keys for indentation, and so on. So much so that it is necessary to set up an atom environment specifically for its development.
1. Find and install the project-manager plug-in in atom so that we can create our own special environment for the WordPress project alone.
two。 According to the instructions, when you select Save Project from the menu, it will create a ~ / .atom / projects.cson file with basic information such as the path of your project.
3. In the root directory of your project, create a file named project.cson, which reads as follows:
Settings: "*": "linter-phpcs.codeStandardOrConfigFile": "WordPress".html.php.text": "editor.tabType": "hard"
Line 3 means that only the WordPress check is performed for this project.
Lines 4 and 5 mean that only hard TAB is performed on php files.
In this way, all your other PHP projects are checked against the PSR2 standard, and soft TAB, that is, TAB, is converted to spaces, while only the PHP project in this project is hard TAB, and other files such as JS and so on are soft TAB.
innovation
Project Management in Atom is not easy to use, so I finally adopted the method of editorconfig plus phpcs to set it:
Editorconfig
First, create a .editorconfig file in the root directory of the project:
Root = true [* .php] indent_style = tab [* .scss] indent_style = spaceindent_size = 2
It is stipulated here that the indentation of php files must use the TAB key.
Note: Atom must change the indentation mode to Auto, otherwise the settings in editorconfig will not work.
Phpcs.xml
Then, create a phpcs.xml file under the project root:
Here, we tell phpcs that the project will use WordPress validation.
The above is the method of setting up the atom environment for WordPress development, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.