Get a more debugable error message when DOM validation fails in Magento.
Original Error Message
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': This element is not expected.
Line: 1471
| <?php | |
| declare(strict_types=1); | |
| // Prevent varnish or browsers from caching this dynamic report. | |
| header('Content-Type: text/html; charset=UTF-8'); | |
| header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); | |
| header('Cache-Control: post-check=0, pre-check=0', false); | |
| header('Pragma: no-cache'); | |
| header('Expires: Thu, 01 Jan 1970 00:00:00 GMT'); | |
| header('Surrogate-Control: no-store'); |
| #!/usr/bin/env php | |
| <?php | |
| declare(strict_types=1); | |
| /** | |
| * Merge patch declarations into composer.json extra.patches. | |
| * | |
| * Usage: | |
| * php add_composer_patches.php payload.json [composer.json] | |
| * cat payload.json | php add_composer_patches.php [composer.json] |
| #!/bin/bash | |
| sed -E -i 's/data-([a-z\0-9-]*)="([0-9\.:\/a-zA-Z]*)"//g' /path/to/file |
| #!/usr/bin/env php | |
| <?php | |
| if ($argc < 2) { | |
| echo "Usage: php query_param_report.php <log-file-path>\n"; | |
| exit(1); | |
| } | |
| $filePath = $argv[1]; |
| <?php | |
| namespace PHP_CodeSniffer\Standards\Mdoq\Sniffs\Functions; | |
| use PHP_CodeSniffer\Sniffs\Sniff; | |
| use PHP_CodeSniffer\Files\File; | |
| class DisallowPrintRSniff implements Sniff | |
| { | |
| public const METHOD_NAME = 'print_r'; |
Get a more debugable error message when DOM validation fails in Magento.
Original Error Message
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'arguments': This element is not expected.
Line: 1471
| select job_code, | |
| avg(timestampdiff(second, executed_at, finished_at)) as average_run_time, | |
| min(timestampdiff(second, executed_at, finished_at)) as min_run_time, | |
| max(timestampdiff(second, executed_at, finished_at)) as max_run_time | |
| from cron_schedule where executed_at is not null and finished_at is not null group by job_code order by max(timestampdiff(second, executed_at, finished_at)) desc; |
| <?php | |
| use Magento\Setup\Module\I18n\Parser\Parser; | |
| if(!is_file('bin/magento')){ | |
| echo 'Unable to find "bin/magento", this needs to be ran from the root of the project.'.PHP_EOL; | |
| return 1; | |
| } | |
| define('REPORT_WIDTH', 200); |
Sometimes when running composer install for Magento 2 depending on your current directory structure the Magento composer plugin does not extract/copy the files out of vendor.
Which leaves you with a broken installation.
curl -s https://gist.githubusercontent.com/adamzero1/0eb6d3e14078676a3ba589d77ba67b3d/raw/6ed67290b6eca7211942d1363ab6115eefd590a6/fix | bash