Skip to content

Instantly share code, notes, and snippets.


André R. andrerom

View GitHub Profile
andrerom / .gitattributes
Last active June 24, 2021 00:00
Git and how to handle line endings usage for mixed Windows and Mac/Linux clients
View .gitattributes
# Taken from:
# Auto detect text files and perform LF normalization so files in repo had LF and client translates to CRLF on Windows
* text=auto
# As a bonus also give hints to git on what diff to use
*.cs text diff=csharp
*.cshtml text diff=html
*.csx text diff=csharp
*.sln text eol=crlf merge=union
andrerom /
Last active July 16, 2020 11:26 — forked from suya55/
mysql row size checker
# usage: mysqldump --no-data |
andrerom / update_paths.sql
Last active January 9, 2020 15:16
eZ Platform / Publish update var dir paths
View update_paths.sql
-- Update image paths
UPDATE ezimagefile SET filepath = REPLACE(filepath, 'var/storage', 'var/my/storage');
-- Before this you may run legacy script to cleanup dfs data to wipe out caches from the table: php bin/php/dfscleanup.php
-- Update DFS tables (only relevant if you use Clustering)
SET name = REPLACE(name, 'var/storage', 'var/ca/storage'),
name_trunk = REPLACE(name_trunk, 'var/storage', 'var/my/storage'),
name_hash = MD5(REPLACE(name, 'var/storage', 'var/my/storage'))
andrerom / rest_server_load_locations.diff
Last active December 13, 2018 16:41
eZ Platform: Starting point for adding multi load for locations for REST
View rest_server_load_locations.diff
diff --git a/doc/specifications/rest/REST-API-V2.rst b/doc/specifications/rest/REST-API-V2.rst
index 961d311f83..a561074788 100644
--- a/doc/specifications/rest/REST-API-V2.rst
+++ b/doc/specifications/rest/REST-API-V2.rst
@@ -573,6 +573,7 @@ XML Example
<rootMediaFolder media-type="application/vnd.ez.api.Location+xml" href="/api/ezp/v2/content/locations/1/43"/>
<locationByRemoteId media-type="" href="/api/ezp/v2/content/locations{?remoteId}"/>
<locationByPath media-type="" href="/api/ezp/v2/content/locations{?locationPath}"/>
+ <locationByIds media-type="application/vnd.ez.api.LocationList+xml" href="/api/ezp/v2/content/locations{?ids}"/>
<trash media-type="application/vnd.ez.api.Trash+xml" href="/api/ezp/v2/content/trash"/>
andrerom /
Last active July 3, 2022 14:33
Shell command to be able to switch between MacOS liip PHP versions + set some default PHP config automatically
# This simple script lists the installed OSX PHP packages
# and lets you choose which one to activate (by changing the symlink).
# Fairly rudimentary, but it does the job (for me).
# Install to (*nix): /usr/local/bin/
# Run using: sudo liip
# Tip: you can add an alias to your ~/.profile
andrerom / EZP-26748_for_5.4.diff
Created July 17, 2018 10:31
Fix EZP-26748: Wrong image URI when content name has extended UTF characters
View EZP-26748_for_5.4.diff
diff --git a/ezpublish/console b/ezpublish/console
index 6d522a9..df63c07 100644
--- a/ezpublish/console
+++ b/ezpublish/console
@@ -7,6 +7,9 @@
set_time_limit( 0 );
+// Ensure UTF-8 is used in string operations
+setlocale(LC_CTYPE, 'C.UTF-8');
andrerom / composer.json.diff
Last active July 3, 2018 06:37
eZ Platform kernel Symfony 4.0 "compatibility": In case someone wants to help start to fix Sf4.x support in thirdparty dependencies
View composer.json.diff
diff --git a/composer.json b/composer.json
index 4c0dac0129..609e3c807d 100644
--- a/composer.json
+++ b/composer.json
@@ -17,27 +17,23 @@
"ext-SPL": "*",
"ext-xsl": "*",
"ext-curl": "*",
- "symfony/symfony": "^3.4",
- "symfony-cmf/routing": "^1.1|^2.0",
andrerom /
Last active May 24, 2019 18:04


_Many users of eZ software expect that eZ is a reliable company with stable products they can build upon, they are large enterprise customers that build complex applications on top of eZ software. With more frequent major releases several of these customers have expressed concerns about having to change their implementation often, e.g. v5 to v1, and v1 to v2. This document is about eZ more clearly committing to what we have said in the past, and so far followed from v5 to v2; We have a BC policy that allows people to rely on eZ software for the long run.


About SemVer

eZ Platform, including all packages from eZ Systems AS are following "Semantic Versioning", aka SemVer.

However SemVer is only talking about API changes:

  1. It does not cover changes to implementation; improvements or even new features in the implementation.
andrerom / EZP-28008_platform_1.x.diff
Last active October 5, 2017 10:22
DEBUG SPI Persistence Cache issues on eZ Publish 5.x / eZ Platform 1.x SPI + patches
View EZP-28008_platform_1.x.diff
diff --git a/eZ/Publish/Core/Persistence/Cache/ContentHandler.php b/eZ/Publish/Core/Persistence/Cache/ContentHandler.php
index f63230c6f3..5cdbe039ca 100644
--- a/eZ/Publish/Core/Persistence/Cache/ContentHandler.php
+++ b/eZ/Publish/Core/Persistence/Cache/ContentHandler.php
@@ -146,11 +146,17 @@ public function updateMetadata($contentId, MetadataUpdateStruct $struct)
$this->logger->logCall(__METHOD__, array('content' => $contentId, 'struct' => $struct));
- $this->cache
- ->getItem('content', 'info', $contentId)
andrerom / LazyGeneratorCollection.php
Last active June 11, 2022 18:47
Lazy Collection using Generator in PHP (Example, script in bottom of file to test it)
View LazyGeneratorCollection.php
* Class GeneratorCollection, allows for lazy loaded arrays using Generators withouth it's limitations.
* This collection class takes Generator as argument, and allows user to threat it like any kind of array. It will take
* care about storing the values returned from generator so user can iterate over it several times.
* NOTE: In current form only works with generators that uses integers as keys (lists).