eZ Community » Forums » Discussions » Tip: Kernel classes override
expandshrink

Saturday 05 November 2011 12:49:57 am - 2 replies

» Read full blog post

Introduction

In this blog post I will show how to override kernel classes. It is a very known concept, but wasn't in my tip list yet, so, if you don't like the way some kernel classes works you can just create a kernel override, and doing that you'll avoid kernel hacks, which is not recommended.

Friday 30 January 2015 11:34:59 am

Unfortunately this hasn't worked for me:

 

1. Created kernel and override directory inside my extension directory like:
/extension/extensionname/kernel/override

2. Created config.php inside override directory with a def:
define( 'EZP_AUTOLOAD_ALLOW_KERNEL_OVERRIDE', true );

3. Copied /user/register.php inside override directory:

/extension/exensionname/kernel/override/config.php
/extension/exensionname/kernel/override/user/register.php

4. Run php bin/php/ezpgenerateautoloads.php -o

5. Got a response:

Scanning for PHP-files.
Scan complete. Found 351 PHP files.
Searching for classes (tokenizing).
Found 179 classes, added 0 of them to the autoload array.

Modified on Friday 30 January 2015 11:36:06 am by Kuba Martins

Friday 30 January 2015 1:47:42 pm

You can't override kernel modules just kernel classes. You can copy register.php to your custom extension and define it as your custom module. 

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from