Skip to content

Commit

Permalink
!!! TASK: Upgrade for Neos 3.0 (#4)
Browse files Browse the repository at this point in the history
- Adjusts code to package renaming from "TYPO3.Flow" to "Neos.Flow"
- Adjusts code to package renaming from "TYPO3.Neos" to "Neos.Neos"
- Adjusts code to package renaming from "TYPO3.TypoScript" to "Neos.Fusion"
- Moves fusion files from old path ``Resources/Private/TypoScript/`` to the new path
- Migrate usages of the Settings path Neos.Neos.typoScript to Neos.Neos.fusion
- Adjusts code to Eel Renaming
  • Loading branch information
ComiR authored and kdambekalns committed Jan 30, 2017
1 parent d0beb26 commit 7bbd1ac
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 18 deletions.
11 changes: 6 additions & 5 deletions Classes/CompressionHelper.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
namespace Flownative\Neos\Compressor;

use TYPO3\Eel\ProtectedContextAwareInterface;
use TYPO3\Flow\Annotations as Flow;
use Neos\Eel\ProtectedContextAwareInterface;
use Neos\Flow\Annotations as Flow;
use WyriHaximus\HtmlCompress\Factory;
use WyriHaximus\HtmlCompress\Parser;

class CompressionHelper implements ProtectedContextAwareInterface
{

/**
* @var \WyriHaximus\HtmlCompress\Parser
* @var Parser
*/
protected $parser;

Expand All @@ -25,6 +25,7 @@ public function __construct()
* Run the value through the compressor.
*
* @param string $content
*
* @return string
*/
public function compress($content)
Expand All @@ -36,11 +37,11 @@ public function compress($content)
* All methods are considered safe, i.e. can be executed from within Eel
*
* @param string $methodName
*
* @return boolean
*/
public function allowsCallOfMethod($methodName)
{
return true;
}

}
13 changes: 6 additions & 7 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
TYPO3:
Neos:
Fusion:
defaultContext:
Flownative.Compressor: Flownative\Neos\Compressor\CompressionHelper
Neos:
typoScript:
fusion:
autoInclude:
'Flownative.Neos.Compressor': TRUE

TypoScript:
defaultContext:
'Flownative.Compressor': 'Flownative\Neos\Compressor\CompressionHelper'
Flownative.Neos.Compressor: true
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Flownative Neos Compressor

This package by default compresses the `head` and `body` of the `TYPO3.Neos:Page` prototype
This package by default compresses the `head` and `body` of the `Neos.Neos:Page` prototype
using the default compressor of `wyrihaximus/html-compress`.

## Installation
Expand All @@ -9,7 +9,7 @@ using the default compressor of `wyrihaximus/html-compress`.

## Usage

As soon as the package is installed, the `TYPO3.Neos:Page` prototype is amended with `@process`
As soon as the package is installed, the `Neos.Neos:Page` prototype is amended with `@process`
instructions on the `head` and `body` elements. This will compress and "regular" output without
any further steps to take.

Expand All @@ -18,7 +18,7 @@ any further steps to take.
To remove the default compression, simply override:

```
prototype(TYPO3.Neos:Page) {
prototype(Neos.Neos:Page) {
[email protected] >
[email protected] >
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
prototype(TYPO3.Neos:Page) {
prototype(Page) {
[email protected] {
expression = ${Flownative.Compressor.compress(value)}
@position = 'end 999999999'
@if.isLive = ${node.context.live}
}

[email protected] {
expression = ${Flownative.Compressor.compress(value)}
@position = 'end 999999999'
Expand Down
72 changes: 70 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,83 @@
{
"name": "flownative/neos-compressor",
"type": "typo3-flow-package",
"type": "neos-plugin",
"description": "Output compression for Neos",
"license": "MIT",
"require": {
"typo3/neos": "~2.0",
"neos/neos": "^3.0",
"wyrihaximus/html-compress": "~1.2"
},
"autoload": {
"psr-4": {
"Flownative\\Neos\\Compressor\\": "Classes"
}
},
"extra": {
"applied-flow-migrations": [
"TYPO3.FLOW3-201201261636",
"TYPO3.Fluid-201205031303",
"TYPO3.FLOW3-201205292145",
"TYPO3.FLOW3-201206271128",
"TYPO3.FLOW3-201209201112",
"TYPO3.Flow-201209251426",
"TYPO3.Flow-201211151101",
"TYPO3.Flow-201212051340",
"TYPO3.TypoScript-130516234520",
"TYPO3.TypoScript-130516235550",
"TYPO3.TYPO3CR-130523180140",
"TYPO3.Neos.NodeTypes-201309111655",
"TYPO3.Flow-201310031523",
"TYPO3.Flow-201405111147",
"TYPO3.Neos-201407061038",
"TYPO3.Neos-201409071922",
"TYPO3.TYPO3CR-140911160326",
"TYPO3.Neos-201410010000",
"TYPO3.TYPO3CR-141101082142",
"TYPO3.Neos-20141113115300",
"TYPO3.Fluid-20141113120800",
"TYPO3.Flow-20141113121400",
"TYPO3.Fluid-20141121091700",
"TYPO3.Neos-20141218134700",
"TYPO3.Fluid-20150214130800",
"TYPO3.Neos-20150303231600",
"TYPO3.TYPO3CR-20150510103823",
"TYPO3.Flow-20151113161300",
"TYPO3.Form-20160601101500",
"TYPO3.Flow-20161115140400",
"TYPO3.Flow-20161115140430",
"Neos.Flow-20161124204700",
"Neos.Flow-20161124204701",
"Neos.Twitter.Bootstrap-20161124204912",
"Neos.Form-20161124205254",
"Neos.Flow-20161124224015",
"Neos.Party-20161124225257",
"Neos.Eel-20161124230101",
"Neos.Setup-20161124230842",
"Neos.Imagine-20161124231742",
"Neos.Media-20161124233100",
"Neos.NodeTypes-20161125002300",
"Neos.Neos-20161125002322",
"Neos.ContentRepository-20161125012000",
"Neos.Fusion-20161125013710",
"Neos.Setup-20161125014759",
"Neos.Fusion-20161125104701",
"Neos.NodeTypes-20161125104800",
"Neos.Neos-20161125104802",
"Neos.Neos-20161125122412",
"Neos.Flow-20161125124112",
"Neos.SwiftMailer-20161130105617",
"TYPO3.FluidAdaptor-20161130112935",
"Neos.Fusion-20161201202543",
"Neos.Neos-20161201222211",
"Neos.Fusion-20161202215034",
"Neos.Fusion-20161219092345",
"Neos.ContentRepository-20161219093512",
"Neos.Media-20161219094126",
"Neos.Neos-20161219094403",
"Neos.Neos-20161219122512",
"Neos.Fusion-20161219130100",
"Neos.Neos-20161220163741",
"Neos.Fusion-20170120013047"
]
}
}

0 comments on commit 7bbd1ac

Please sign in to comment.