In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to set up the atom environment for WordPress development, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
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.
Thank you for reading this article carefully. I hope it is helpful for everyone to share how to set up the atom environment in WordPress development. At the same time, I also hope you can support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!
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.