Last active
June 25, 2024 08:55
-
-
Save joseconti/d0f9213ebe55d1238a1db8198bdf7250 to your computer and use it in GitHub Desktop.
Install WooCommerce Sniffer & Visual Studio Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the following list of actions, there are paths from my Mac. You should replace the path with the one that corresponds to yours. | |
In principle, you should only change the username in the path to yours. | |
(Install Xcode > https://guide.macports.org/#installing.xcode) | |
xcode-select --install | |
sudo xcodebuild -license | |
Descargar PKG para OS https://www.macports.org/install.php | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
sudo port -v selfupdate | |
man port | |
sudo port install php74 | |
sudo port install php74-cgi php74-gd php74-curl php74-intl php74-iconv php74-gettext php74-mbstring php74-imap php74-mcrypt php74-xmlrpc php74-mysql php74-openssl php74-sockets php74-zip php74-tidy php74-opcache php74-xsl php74-sqlite php74-imagick | |
sudo port select php php74 | |
which php | |
php --version | |
cd /opt/local/etc/php74 | |
sudo mv php.ini-development php.ini | |
sudo vi php.ini > aumentamos memoria, descarga, post, etc. | |
Descargar Composer.phar https://getcomposer.org/download/ | |
sudo mv composer.phar /usr/local/bin/ | |
sudo chmod 755 /usr/local/bin/composer.phar | |
nano ~/.profile | |
añadimos > alias composer="php /usr/local/bin/composer.phar" | |
source ~/.profile | |
composer -v | |
echo $SHELL | |
Aquí nos puede devolver diferentes respuestas, que básicamente son por regla general Bash o Zsh | |
Dependiendo de la respuesta, deberemos ejecuta uno de los siguientes echo para que se cargue siempre composer al reiniciar el Mac: | |
echo "source ~/.profile" >> ~/.bashrc # Si usas Bash | |
echo "source ~/.profile" >> ~/.zshrc # Si usas Zsh | |
Continuamos: | |
composer g require woocommerce/woocommerce-sniffs | |
Instalamos Visual Studio Code | |
Instalamos PHP_CodeSniffer > https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer | |
Configuramos PHP_CodeSniffer: | |
* phpcs > /Users/joseconticalveras/.composer/vendor/bin/phpcs | |
* PHP Code Sniffer > WooCommerce-Core | |
settings.json: | |
{ | |
"workbench.colorTheme": "Default Dark+", | |
"security.workspace.trust.untrustedFiles": "open", | |
"phpCodeSniffer.standard": "Custom", | |
"phpCodeSniffer.standardCustom": "WooCommerce-Core", | |
"php.validate.executablePath": "/opt/local/bin/php", | |
"phpcbf.executablePath": "/Users/joseconticalveras/.composer/vendor/bin/phpcbf", | |
"phpCodeSniffer.executable": "/Users/joseconticalveras/.composer/vendor/bin/phpcs", | |
"[php]": { | |
"editor.defaultFormatter": "obliviousharmony.vscode-php-codesniffer" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment