Skip to content

Instantly share code, notes, and snippets.

View andrerom's full-sized avatar

André R. andrerom

View GitHub Profile
@andrerom
andrerom / php_lazy_objects.php
Last active August 7, 2020 17:19
PHP RFC: Lazy objects
<?php
/**
* Possible idea for PHP RFC (PHP language feature).
*
* Problem:
* In generic PHP applications, like Drupal, Sylius, Magento, eZ, .... It is common that end user
* finds themselves in situation where the system is either loading too much data for them, or not providing
* enough in order to solve the use case they are working on. This can be on a case by case basis even for single
* end user. In other words it very hard for the system to get that balance right for all users/cases.
@andrerom
andrerom / a - oci8.md
Last active April 30, 2017 17:38
Oracle support in eZ Platform

Todo in regards to getting Oracle support in eZ Platform

We need a few things in order to support Oracle:

  • Development:
  • kernel: There are a few places we parse database "dsn", these needs to understand oci8 dsn as well
    • Or better yet find a way to get rid of it and let doctrine parse this so we can support full doctrine dsn as used by Symfony flex
  • Oracle schema, need someone with Oracle expertise involved to see what we can optimize in the schema
  • Estimate 1-2 weeks (but you need step below to be able to verify)
  • CI: Continues Integration, aka testing of every change, this is the more tricky part. in short oracle does not allow CI services to provide Oracle as an option so we have two options:
  • A: Setup testing of this on Jenkins and buy a license
@andrerom
andrerom / content_gateway.php
Last active January 27, 2016 09:43
coy relations using INSERT INTO SELECT
<?php
/**
* Batch method for copying all relation meta data for copied Content object.
*
* Is meant to be used during content copy, so assumes the following:
* - version number is the same
* - content type, and hence content type attribute is the same
* - relation type is the same
* - target relation is the same
*
@andrerom
andrerom / sf_hard_links.diff
Last active August 29, 2015 14:23
Symfony [Filesystem]: Hard link support, could be useful for things like FOSHttpCache Sf Proxy multi tagging
@andrerom
andrerom / node_cleanup_event.diff
Created March 7, 2015 12:52
Node cleanup accumulator also for events
diff --git a/kernel/classes/ezcontentcachemanager.php b/kernel/classes/ezcontentcachemanager.php
index 6dc5792..4adceeb 100644
--- a/kernel/classes/ezcontentcachemanager.php
+++ b/kernel/classes/ezcontentcachemanager.php
@@ -769,13 +769,17 @@ class eZContentCacheManager
if ( eZContentCache::inCleanupThresholdRange( $cleanupValue ) )
{
+ eZDebug::accumulatorStart( 'node_cleanup_event', '', 'Node cleanup event content/cache (' . count( $nodeList ) . ')' );
$nodeList = ezpEvent::getInstance()->filter( 'content/cache', $nodeList );
@andrerom
andrerom / EZP-23390_B.diff
Created September 28, 2014 21:17
EZP-23390 - Legacy IO loads whole file to get mime type with FS cluster handler
diff --git a/kernel/classes/clusterfilehandlers/ezfsfilehandler.php b/kernel/classes/clusterfilehandlers/ezfsfilehandler.php
index 1689b96..25a153c 100644
--- a/kernel/classes/clusterfilehandlers/ezfsfilehandler.php
+++ b/kernel/classes/clusterfilehandlers/ezfsfilehandler.php
@@ -117,7 +117,16 @@ class eZFSFileHandler implements eZClusterFileHandlerInterface
eZDebugSetting::writeDebug( 'kernel-clustering', ' clearstatcache called on ' . $this->filePath, __METHOD__ );
}
- $this->metaData = file_exists( $this->filePath ) ? stat( $this->filePath ) : false;
+ if ( file_exists( $this->filePath ) )
@andrerom
andrerom / gist:4a26757d84794d0f7e27
Created September 5, 2014 09:19
Language filtering in API Content Search
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php
index 1946db3..3231cee 100644
--- a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php
+++ b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php
@@ -103,11 +103,13 @@ class Handler implements SearchHandlerInterface
throw new NotImplementedException( "Facets are not supported by the legacy search engine." );
}
+ $translations = !empty( $fieldFilters['languages'] ) ? $fieldFilters['languages'] : null;
+
@andrerom
andrerom / gist:490e35e3a76e2afe6c0f
Created July 8, 2014 13:24
This is how composer tells you you have wrong PHP verison
[vagrant@ezp5 ezpublish5]$ composer.phar install --prefer-dist
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package php could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package php could not be found in any version, there may be a typo in the package name.
Problem 3
@andrerom
andrerom / contributing.md
Last active August 29, 2015 13:55
contributing.md proposal for eZ repos

How to contribute

Contributions are essential for keeping eZ products great. We simply can't access the huge number of platforms and myriad configurations that exists, even if we plan to add more platforms on our CI systems over time it won't cover everything. eZ thus strongly belive in the power of the community to help improve the product in anyway possible for the benefit of the ecosystem.

We want to keep it as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we

@andrerom
andrerom / gist:8605484
Created January 24, 2014 20:20
Abstract Logger class intended at time of writing (early 2013) for logging in new stack
<?php
/**
* File containing the Abstract ProfileLogger class
*
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\SPI\Profiler;