Skip to content

Instantly share code, notes, and snippets.

View brookinsconsulting's full-sized avatar
😀
Creating NeXT Generation eZ Platform Software

Brookins Consulting brookinsconsulting

😀
Creating NeXT Generation eZ Platform Software
View GitHub Profile
@brookinsconsulting
brookinsconsulting / ezmatrix.xml
Created September 23, 2017 18:46
Example eZMatrix XML Storage Document
<?xml version="1.0" encoding="utf-8"?>
<ezmatrix>
<name />
<columns number="3">
<column num="0" id="identifier1">
Name1
</column>
<column num="1" id="identifier2">
Name2
</column>
@brookinsconsulting
brookinsconsulting / BcLowerCaseUnderscoreUrlAliasSlugConverter.php
Last active March 10, 2017 02:31 — forked from skrosoft/SlugConverterLC.php
ezpublishplatform and ezplatform SlugConverter class to transform all urlalias(es) into lowecase (ezp v3 style)
<?php
/**
* File containing the BcLowerCaseUnderscoreUrlAliasSlugConverter class part of the BcLowerCaseUrlAliasBundle package.
*
* @copyright Copyright (C) Brookins Consulting. All rights reserved.
* @license For full copyright and license information view LICENSE and COPYRIGHT.md file distributed with this source code.
* @version //autogentag//
* @package BcLowerCaseUrlAliasBundle
*/
@brookinsconsulting
brookinsconsulting / extension-ezpnormalizelatlng-bin-php-ezpnormalizelatlng.php
Created June 13, 2015 18:22
ezpnormalizelatlng.php - Simple script example of using eZ Publish Legacy Extension PHP Shell Script to Modify content object content programatically
#!/usr/bin/env php
<?php
/**
* File containing the ezpnormalizelatlng.php bin script
*
* @copyright Copyright (C) 1999 - 2015 Brookins Consulting. All rights reserved.
* @copyright Copyright (C) 2013 - 2015 Think Creative. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 (or later)
* @version 0.0.3
* @package site
<?php
namespace Ayaline\Bundle\EzToolsBundle\Image;
use eZ\Publish\Core\FieldType\Image\AliasCleanerInterface;
use eZ\Publish\Core\IO\UrlRedecoratorInterface;
use Liip\ImagineBundle\Imagine\Filter\FilterConfiguration;
class AliasCleaner implements AliasCleanerInterface
{
@brookinsconsulting
brookinsconsulting / services.xml
Last active August 29, 2015 14:22
Blog post: 'Change user authentication to login with email' Service Definitions (Modified to use validated xml; which was missing from blog post examples). Also added a auto converted services.yml example (Converted using website: http://converter.rosstuck.com). From: http://blog.silversolutions.de/2014/07/ezpublish/extend-ez-5-3-login-email/ Do…
<?xml version="1.0" encoding="utf-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="security.authentication.provider.dao.class">SilversolutionsBundleEshopBundleServiceSecurityAuthenticationProvider</parameter>
</parameters>
<services>
<service id="security.authentication.provider.dao" class="%security.authentication.provider.dao.class%" abstract="true" public="false">
<argument /> <!-- User Provider -->
<?php
/**
* @author Henning Kvinnesland <henning@keyteq.no>
* @since 02.06.15
*/
namespace Kavli\GenericBundle\Override;
class ContentPackageHandler extends \eZContentObjectPackageHandler
{
@brookinsconsulting
brookinsconsulting / bc.ezpublish2014.11.1_ezpublish_legacy_kernel_classes_datatypes_ezxmltext_ezxmloutputhandler.php.diff
Last active August 29, 2015 14:22
BC Developed a kernel class override patch to provide additional ezxmltext template override.ini template override Match conditions. These are nearly all possible (minus state and some other more obscure conditions) conditions. This patch has been lightly tested as functional and it seems to work well. This may cause as of yet unknown problems (…
--- /Users/graham/web/ez/dual-static-based-off-2014.11.1/ezpublish_legacy/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php 2015-05-31 07:02:38.000000000 -0500
+++ /Users/graham/web/ez/dual-static-based-off-2014.11.1/ezpublish_legacy/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php.solution.003.works 2015-05-31 06:59:53.000000000 -0500
@@ -162,7 +162,22 @@
$this->Res = eZTemplateDesignResource::instance();
if ( $this->ContentObjectAttribute )
{
- $this->Res->setKeys( array( array( 'attribute_identifier', $this->ContentObjectAttribute->attribute( 'contentclass_attribute_identifier' ) ) ) );
+ $this->Res->setKeys( array(
+ array( 'attribute_identifier', $this->ContentObjectAttribute->attribute( 'contentclass_attribute_identifier' ) ),
+ array( 'object', $this->ContentObjectAttribute->attribute( 'contentobject_id' ) ),
@brookinsconsulting
brookinsconsulting / gist:bf49d467256fdb5f073e
Last active August 29, 2015 14:19 — forked from arnebratt/gist:571269541df60de1b683
In #ezpublish irc (freenode.net) Bratt shared his solution to use a copy of an ezpublish website from production on a local dev without the var directory images (this is a kernel hack atm but could be transformed into a kernel override)
--- kernel/classes/datatypes/ezimage/ezimagealiashandler.php 2014-07-17 11:18:00.000000000 +0200
+++ kernel/classes/datatypes/ezimage/ezimagealiashandler.php 2014-07-17 11:51:57.000000000 +0200
@@ -551,6 +551,10 @@
}
$this->setOriginalAttributeData( $originalData );
+ $ini = eZINI::instance( 'image.ini' );
+ $imagesRemoteUrl = $ini->variable( 'ImageConverterSettings', 'ImagesRemoteURL' );
+ $imagesRemoteUrl = rtrim( $imagesRemoteUrl, '/' ) . '/';
+
@brookinsconsulting
brookinsconsulting / request_for_support_to_maxime_email_001.txt
Created October 16, 2014 04:36
Request for support: Please help me get a copy of Wascou - URL Shortener
Hello Maxime,
I am sorry to bother you. I have been trying to connect with you via
Twitter and LinkedIn for the past month.
I use eZ Publish ... a lot. I'm trying to find a copy of "Wascou Software
Edition - URL Shortener (wse_us)" Re: http://projects.ez.no/wse_us
I used to have a copy of the package but I have lost it and can't find it
any longer.
@brookinsconsulting
brookinsconsulting / symfony-legacy-kernel-callback-user-login-example-snippet.php
Last active September 24, 2015 10:08
This snippet of php eZ Publish 5 (Symfony Stack) code uses the legacy kernel api to login to the user you wish to use to perform actions within eZ Publish Legacy as! Default admin user used in this example. Reference: http://share.ez.no/forums/ez-publish-5-platform/interracting-with-legacy-from-symfony-command#comment84674
<?php
protected function execute(InputInterface $input, OutputInterface $output) {
$repository = $this->getContainer()->get('ezpublish.api.repository');
$legacyKernel = $this->getContainer()->get('ezpublish_legacy.kernel');
$userID = 14; // UserID of the Default Admin User
$user = $repository->getUserService()->loadUser( $userID );
$repository->setCurrentUser( $user );
$result = $legacyKernel()->runCallback(
function () use( $userID )