Skip to content

Instantly share code, notes, and snippets.

View arfaram's full-sized avatar

Ramzi Arfaoui arfaram

View GitHub Profile
@arfaram
arfaram / all-icons.md
Last active May 24, 2023 12:44
Ibexa Icons

Ibexa Icons

ibexa-icons

@arfaram
arfaram / BlockResponseSubscriber.php
Last active November 10, 2022 13:16
Ibexa4 - Force Display pagebuilder blocks Listener and Twig errors
<?php
declare(strict_types=1);
namespace AppBundle\EventSubscriber\Blocks;
use Ibexa\FieldTypePage\Event\BlockResponseEvent;
use Ibexa\FieldTypePage\Event\BlockResponseEvents;
use Ibexa\FieldTypePage\Exception\BlockRenderException;
use Ibexa\FieldTypePage\FieldType\Page\Service\BlockService;
@arfaram
arfaram / Varnish6 _cache_static_files.md
Last active April 3, 2022 11:58
Varnish 6 cache static files

vcl:

sub vcl_backend_response {

    //..

# For static content strip all backend cookies and push to static storage
        if (bereq.url ~ "\.(css|js|png|gif|jp(e?)g)|swf|ico") {
 unset beresp.http.cookie;
@arfaram
arfaram / FieldEmpty.php
Created March 17, 2022 18:47
Add IsFieldEmpty Visitor support for eZPlatform /Ibexa 2.5.
<?php
declare(strict_types=1);
namespace App\Query\Visitors;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException;
use eZ\Publish\Core\Search\Common\FieldNameResolver;
use eZ\Publish\Core\Search\Common\FieldValueMapper;
@arfaram
arfaram / ibexa_migration_timefraction_fix.patch
Created October 30, 2021 11:04
solve long running Ibexa migration scripts and time execution fraction precision
diff --git a/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php b/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php
index 68c010c..725bd4e 100644
--- a/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php
+++ b/src/lib/Gateway/MigrationMetadata/DoctrineGateway.php
@@ -74,7 +74,7 @@ final class DoctrineGateway
: null;
$executionTime = isset($row[SchemaProvider::MIGRATION_METADATA_EXECUTION_TIME_COLUMN])
- ? (float) ($row[SchemaProvider::MIGRATION_METADATA_EXECUTION_TIME_COLUMN] / 1000)
+ ? (float) ($row[SchemaProvider::MIGRATION_METADATA_EXECUTION_TIME_COLUMN])
@arfaram
arfaram / migration_bundle_fix_and_support_update_actions.patch
Created October 19, 2021 15:25
Patch to support Ibexa v3.3.3 migration bundle to add actions on content update
diff --git a/src/bundle/Resources/config/services/step_executors.yaml b/src/bundle/Resources/config/services/step_executors.yaml
index 206aa87..571f083 100644
--- a/src/bundle/Resources/config/services/step_executors.yaml
+++ b/src/bundle/Resources/config/services/step_executors.yaml
@@ -42,6 +42,8 @@ services:
$defaultUserLogin: '%ibexa.migrations.default.user_login%'
Ibexa\Platform\Migration\StepExecutor\ContentUpdateStepExecutor:
+ arguments:
+ $actionExecutor: '@Ibexa\Platform\Migration\StepExecutor\ActionExecutor\Content\Create\Executor'
@arfaram
arfaram / AssignContentLocations.php
Last active October 17, 2021 11:43
Creating custom action for Ibexa data migration v3.3.3 with migration bundle v1.0.2 to add locations for content
<?php
declare(strict_types=1);
namespace App\Actions\Location;
use Ibexa\Platform\Migration\ValueObject\Step\Action;
final class AssignContentLocations implements Action
{
@arfaram
arfaram / Ibexa_3.3.7_composer.json
Last active September 3, 2021 21:50
Ibexa 3.3.7 composer.json
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=7.3",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.3",
@arfaram
arfaram / CreateUserCommand.php
Created May 14, 2020 21:58
CreateUserCommand for ezplatform 2.5 , help script if you delete unintentionally all users!!
<?php
//execute the script with: php bin/console ezplatform:createuser
// SEE and adapt everything marked as !!!!!!IMPORTANT!!!!!!!!
// set all required field in "ezcontentclass_attribute" to 0 , only for user attributes
namespace AppBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;