First we need to install Brew, the dependency for the Mac:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
MacOS Monterney comes without PHP. Valet+ uses a special version of PHP that you can install like this:
<?php | |
namespace Mynamespace\RegenerateUrls\Console\Command; | |
use Magento\Framework\Exception\AlreadyExistsException; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
#!/bin/bash | |
set -o errexit | |
# Author: David Underhill | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
if [ $# -eq 0 ]; then | |
exit 0 |
-- Update all dev settings to false | |
UPDATE `core_config_data` | |
SET `value` = 0 | |
WHERE (`path` REGEXP '^dev.*') | |
AND `value` = 1; | |
-- Update Sphinx when using Mirasvit Sphinx Search | |
UPDATE `core_config_data` | |
SET `value` = 'mysql2' | |
WHERE `value` = 'sphinx'; |
#### by MageHost.pro #### | |
# execute in Magento 2 root: | |
find vendor app -regextype 'egrep' -type f -regex '.*/layout/.*\.xml' -not -regex '.*(vendor/magento/|/checkout_|/catalogsearch_result_|/dotmailer|/msp).*' | xargs grep --color -n -e 'cacheable="false"' |
<?php declare(strict_types=1); | |
namespace Vendic\SampleModule\Setup\Patch\Data; | |
use Magento\Framework\Setup\Patch\DataPatchInterface; | |
use Magento\Cms\Api\Data\BlockInterfaceFactory; | |
use Magento\Cms\Api\BlockRepositoryInterface; | |
class CreateDesktopMenuCmsBlocks implements DataPatchInterface | |
{ |
name: Fetch DB, anonymize and upload to S3 | |
env: | |
MASQUERADE_DOWNLOAD_URL: 'https://github.com/elgentos/masquerade/releases/latest/download/masquerade.phar' | |
DO_SPACES_HOST: 'ams3.digitaloceanspaces.com' | |
ANONYMIZED_DB_NAME: 'db_anonymized.sql.gz' | |
MYQSL_HOST: '127.0.0.1' | |
MYSQL_PWD: 'root' | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} # source server host | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} # source server use | |
REMOTE_PORT: ${{ secrets.REMOTE_PORT }} # source server port |
# Requires gsed (Mac OSX) or sed (Linux) | |
targets=$(grep -HRl "function setUp()" app) | |
for i in ${targets}; do | |
echo $i | |
/usr/local/bin/gsed -i 's/[a-zA-Z]\+ function setUp().*/protected function setUp(): void/' "$i" | |
done |
# Update all dependencies via brew | |
brew update | |
brew upgrade | |
# validate php | |
php -v | |
# When problems re-occur fix them first. I had to run 'brew reinstall icu4c' because my icu4c dependency was missing. | |
# Remove mysql 5.7 | |
brew services stop [email protected] |
#!/usr/bin/env bash | |
# Generates the Magento multistore config based on the base url list that's provided by n98-magerun2 | |
# You can place the output in pub/index.php | |
IFS=' | |
' | |
magerun2=$(which n98-magerun2) | |
[ -z "$magerun2" ] && echo "Cannot find magerun2, exiting." && exit 1 | |
echo "switch (\$_SERVER['HTTP_HOST']) {" |