# fballiano/openmage-cssjs-minify Dependencies: PHP Requirements and Composer Packages

> Discover the PHP requirements and essential Composer packages for fballiano/openmage-cssjs-minify. Learn about magento-hackathon/magento-composer-installer and matthiasmullie/minify.

- Repository: [Fabrizio Balliano/openmage-cssjs-minify](https://github.com/fballiano/openmage-cssjs-minify)
- Tags: api-reference
- Published: 2026-03-01

---

**The fballiano/openmage-cssjs-minify package requires PHP 7.4 or newer, the magento-hackathon/magento-composer-installer for Magento module placement, and matthiasmullie/minify ^1.3 as the core minification engine.**

The fballiano/openmage-cssjs-minify module is a Magento 1.x/OpenMage extension that automatically minifies CSS and JavaScript assets. Understanding its dependency tree is essential for successful installation and troubleshooting compatibility issues with your existing Magento installation.

## Core Dependencies Defined in composer.json

The package declares three mandatory requirements in [`composer.json`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/composer.json) (lines 13-17):

- **PHP >=7.4.0** – The minimum runtime requirement ensuring compatibility with modern OpenMage LTS and legacy Magento 1.9.x installations upgraded from older PHP versions.
- **magento-hackathon/magento-composer-installer** – Enables Magento-style module installation via Composer, handling automatic placement of files under `app/code/community/Fballiano/CssjsMinify/` and module declarations in `app/etc/modules/`.
- **matthiasmullie/minify ^1.3** – The core minification library that provides `MatthiasMullie\Minify\CSS` and `MatthiasMullie\Minify\JS` classes. The observer class simply wires this library into Magento’s page rendering flow.

## How Dependencies Integrate with Magento

The dependency chain creates a complete minification pipeline:

1. The **magento-composer-installer** places [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php) and [`app/code/community/Fballiano/CssjsMinify/etc/config.xml`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/etc/config.xml) in the correct locations upon `composer install`.
2. [`config.xml`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/config.xml) registers the observer for the `controller_action_layout_render_before` event.
3. When triggered, [`Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/Observer.php) uses the **matthiasmullie/minify** library to compress CSS and JS files, storing results in `media/cssjs/minified/`.

## Installation and Verification

Install the package and verify dependencies:

```bash

# Install the module and its dependencies

composer require fballiano/openmage-cssjs-minify

# Verify the magento-composer-installer placed files correctly

ls -la app/code/community/Fballiano/CssjsMinify/

```

Check that `matthiasmullie/minify` is present:

```bash
ls vendor/matthiasmullie/minify/

```

## Implementation Details in Source Files

The [`Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/Observer.php) file demonstrates how the **matthiasmullie/minify** dependency is invoked:

```php
// app/code/community/Fballiano/CssjsMinify/Model/Observer.php
public function minifyAssets(Varien_Event_Observer $observer)
{
    // Grab the whole HTML output
    $html = $observer->getEvent()->getTransport()->getOutput();

    // Find CSS/JS tags and replace them with minified versions
    $html = preg_replace_callback($pattern, function($matches) use ($baseDir, $minifiedDir, $minifiedUrl) {
        // Matthias Mullie's Minify library does the heavy lifting
        $minifier = $matches[1] === 'css'
            ? new \MatthiasMullie\Minify\CSS()
            : new \MatthiasMullie\Minify\JS();

        foreach ($files as $file) {
            $minifier->add($baseDir . $file);
        }

        $minifiedPath = $minifiedDir . $hash . '.' . $matches[1];
        $minifier->minify($minifiedPath);

        // Return a new HTML tag pointing to the minified file
        return sprintf('<%s src="%s"/>', $matches[1] === 'css' ? 'link rel="stylesheet" href' : 'script src', $minifiedUrl . '/' . $hash . '.' . $matches[1]);
    }, $html);

    $observer->getEvent()->getTransport()->setOutput($html);
}

```

> Source: [Observer.php – callback usage of the Minify library](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php)

## Summary

- The **fballiano/openmage-cssjs-minify** package requires **PHP 7.4+**, **magento-hackathon/magento-composer-installer**, and **matthiasmullie/minify ^1.3**.
- The [`composer.json`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/composer.json) file (lines 13-17) declares these requirements for automatic resolution.
- The **magento-composer-installer** handles Magento-specific file placement in `app/code/community/` and `app/etc/modules/`.
- The **matthiasmullie/minify** library provides the actual CSS and JavaScript compression algorithms consumed by [`Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/Observer.php).

## Frequently Asked Questions

### What PHP version is required for fballiano/openmage-cssjs-minify?

The package requires **PHP 7.4.0 or newer**. This constraint ensures compatibility with modern OpenMage LTS releases while maintaining support for legacy Magento 1.9.x installations that have been upgraded from older PHP versions.

### Does this package work with standard Magento 1.x installations?

Yes, but you must use **Composer** with the **magento-hackathon/magento-composer-installer**. This dependency handles the non-standard file placement required by Magento 1.x, automatically copying files to `app/code/community/Fballiano/CssjsMinify/` and creating the module declaration in [`app/etc/modules/Fballiano_CssjsMinify.xml`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/etc/modules/Fballiano_CssjsMinify.xml).

### How does the matthiasmullie/minify library integrate with Magento?

The library is instantiated in [`app/code/community/Fballiano/CssjsMinify/Model/Observer.php`](https://github.com/fballiano/openmage-cssjs-minify/blob/main/app/code/community/Fballiano/CssjsMinify/Model/Observer.php). When the `controller_action_layout_render_before` event fires, the observer creates `MatthiasMullie\Minify\CSS` and `MatthiasMullie\Minify\JS` objects, passes source file paths to them, and writes minified output to `media/cssjs/minified/`.

### Can I use this package without Composer?

No. The **magento-hackathon/magento-composer-installer** is a mandatory dependency that manages the module's placement within the Magento directory structure. Manual installation would require replicating this installer's behavior, including proper placement of files in `app/code/community/` and `app/etc/modules/`, which is not documented or supported by the package maintainers.