Valet switch PHP version with these commands
Install PHP 5.6 and switch Valet to PHP 5.6
valet stop
brew unlink php71
brew install php56
brew install php56-mcrypt
<?php | |
/** | |
* Laravel Valet Magento 2 Driver | |
* Originally written bysschlein | |
* | |
* Sligthly altered by: | |
* Kay in 't Veen - Microdesign B.V. | |
* http://www.microdesign.nl | |
* |
function m2-update-database() { | |
# USAGE | |
# m2-update-database 'Magento Cloud Project Title' 'http://project.dev/' | |
# $1 = Project Title | |
# $2 = Local URL | |
# Get the project ID by the project title | |
PROJECT_ID=$(magento-cloud project:list --title=$1 --pipe) | |
GIT_BRANCH_NAME=$(git branch | grep \* | cut -d ' ' -f2) |
<?php | |
/* | |
* Magento 1 Valet Driver | |
* @author spinsch | |
* @path ~/.valet/Drivers/Magento1ValetDriver.php | |
*/ | |
class Magento1ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. |
#!/usr/bin/env bash | |
#styles | |
VP_NONE='\033[00m' | |
VP_RED='\033[01;31m' | |
VP_GREEN='\033[01;32m' | |
VP_YELLOW='\033[01;33m' | |
VP_PURPLE='\033[01;35m' | |
VP_CYAN='\033[01;36m' | |
VP_WHITE='\033[01;37m' |
# ================================================ | |
# PHP 7.2 | |
# | |
# See https://www.colinodell.com/blog/201711/installing-php-72 | |
# ================================================ | |
apt-get install -y apt-transport-https lsb-release ca-certificates | |
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg | |
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list | |
apt-get update | |
apt-get install -y php7.2-cli php7.2-gd php7.2-mbstring php7.2-curl php7.2-xml php7.2-zip |
<?php | |
$conn = mysqli_connect("HOST", "USER", "PASS", "DATABASE"); | |
if (!$conn) { | |
echo "Error: Unable to connect to MySQL." . PHP_EOL; | |
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; | |
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; | |
exit; | |
} |
#!/bin/bash | |
## get n98-magerun2 | |
curl -o /usr/local/bin/magerun2 https://files.magerun.net/n98-magerun2.phar | |
## reset magento admin password | |
MAGE_NEW_ADMIN_PASS="$(head -c 500 /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&?=+_[]{}()<>-' | fold -w 15 | head -n 1)${RANDOM}" | |
read -e -p "---> Enter admin old login: " -i "admin" MAGE_OLD_ADMIN_NAME |
#!/usr/bin/env bash | |
LANGUAGES="en_US pt_BR" | |
# production or developer | |
ENVIRONMENT="production" | |
COMPOSER=$(which composer) | |
PHP=$(which php) | |
ROOT=$(pwd) |