Search by

yireo / magento2-devhacks

yireo

Some hacks to make M2 development easier

Package info

github.com/yireo/Yireo_DevHacks

Type:magento2-module

pkg:composer/yireo/magento2-devhacks

Fund package maintenance!

yireo

www.paypal.me/yireo

Statistics

Installs: 655

Dependents: 0

Suggesters: 0

Stars: 7

Open Issues: 0

0.2.0 2026-11-25 18:54 UTC

This package is auto-updated.

Last update: 2026-11-28 22:21:49 UTC


README

Magento version PHP version License Latest Version

Magento 2 module with development hacks, that came in handy for myself.

Warning: development only

Never install this module in production, or on any publicly reachable environment. It deliberately disables security checks of the Magento core.

The command bin/magento yireo_devhacks:copy_hacks overwrites the following core files in vendor/magento/framework with the files in Copy/:

  • Filesystem/Directory/PathValidator.php: path validation is disabled, so directory objects no longer block path traversal;
  • View/Element/Template/File/Validator.php: any file on disk is accepted as a template;
  • Filesystem/Driver/File.php: any path starting with /data/git/yireo is returned as absolute path without validation. This file is a frozen copy of the core driver and replaces newer core versions (including security fixes).

These overwrites stay in place after the module is disabled or removed. Restore the original core files with:

composer reinstall magento/framework

Consider the core alternatives first:

  • bin/magento config:set dev/template/allow_symlink 1 to allow templates outside of the Magento root;
  • bin/magento setup:static-content:deploy --no-html-minify to skip HTML minification.

The other hacks of this module (skipping HTML minification and throwing an exception for blocks without a template file) are only active in developer mode.

Installation

Use the following commands to install:

composer require yireo/magento2-devhacks:@dev --dev

Enable this module:

./bin/magento module:enable Yireo_DevHacks
./bin/magento setup:upgrade

Skip template path validation

The core checks whether PHTML templates are in the path of the Magento core. When using the composer feature path to symlink a local repository to Magento, while the path is outside of Magento, this throws an exception. This module simply skips the entire logic. No configuration needed. Bam.

Toggle TESTS_CLEANUP in integration tests configuration

Moved to separate Yireo_IntegrationTestHelper module instead.

Current status

Static Tests Unit Tests Integration Tests Playwright DI Compilation