Skip to content

Instantly share code, notes, and snippets.

View emodric's full-sized avatar
🇭🇷
Adventure, excitement... A Jedi craves not these things!

Edi Modrić emodric

🇭🇷
Adventure, excitement... A Jedi craves not these things!
View GitHub Profile
@emodric
emodric / DefaultApplyingNodeVisitor.php
Last active April 20, 2017 12:25
JMS Translation Bundle Twig 2
<?php
...
$transchoiceNode = new Node\Transchoice($transchoiceArguments, $transNode->getTemplateLine());
$node->setNode('node', $transchoiceNode);
...
<?php
namespace Netgen\Bundle\ToolsBundle\Helper;
use eZ\Publish\API\Repository\Values\Content\Query;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use eZ\Publish\API\Repository\Values\Content\Location;
class SortClauseHelper
{
<?php
/**
* @author Branko Ajzele <ajzele@gmail.com, http://foggyline.net>
*/
$XMLRequestType = 'RacunZahtjev'; /* RacunZahtjev OR PoslovniProstorZahtjev */
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
reset='\[\e[00m\]'
bold='\[\e[01m\]'
red='\[\e[31m\]'
green='\[\e[32m\]'
orange='\[\e[33m\]'
blue='\[\e[34m\]'
purple='\[\e[35m\]'
@emodric
emodric / gist:5508478
Created May 3, 2013 10:51
Updating eztags field and publishing content over eZ Publish 5 REST API
eddie@abyss: ~/restScripts/xml/content [master] $ ./05-updateVersion.sh
POST /api/ezp/v2/content/objects/62/versions/2 HTTP/1.1
Accept: application/vnd.ez.api.Version+xml
Accept-Encoding: gzip, deflate, compress
Content-Length: 1192
Content-Type: application/vnd.ez.api.VersionUpdate+xml
Host: ezpublish5.local
User-Agent: HTTPie/0.4.1
X-HTTP-Method-Override: PATCH
@emodric
emodric / gist:51504521bba888c9e012
Created December 16, 2015 13:37
eZ Publish legacy clone, composer install & autoload generate
eddie@abyss [~] $ git clone git@github.com:ezsystems/ezpublish-legacy.git
Cloning into 'ezpublish-legacy'...
remote: Counting objects: 368949, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 368949 (delta 0), reused 0 (delta 0), pack-reused 368944
Receiving objects: 100% (368949/368949), 207.06 MiB | 3.20 MiB/s, done.
Resolving deltas: 100% (269122/269122), done.
Checking connectivity... done.
eddie@abyss [~] $ cd ezpublish-legacy
eddie@abyss [~/ezpublish-legacy] ( ± master ) $ composer install
@emodric
emodric / RelationList.php
Created August 7, 2015 08:39
eZ Publish RelationList field type with location ID support
<?php
namespace Netgen\Bundle\HelperBundle\Core\Persistence\Legacy\Content\FieldValue\Converter;
use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RelationList as BaseRelationListConverter;
use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue;
use eZ\Publish\SPI\Persistence\Content\FieldValue;
@emodric
emodric / gist:4268759
Created December 12, 2012 15:36
eZ Publish 5 REST API - loading content
eddie@abyss: ~ $ ./restScripts/xml/content/07-loadContent.sh
GET /api/ezp/v2/content/objects/58 HTTP/1.1
Accept: application/vnd.ez.api.Content+xml
Accept-Encoding: gzip, deflate, compress
Host: ezpublish5.local
User-Agent: HTTPie/0.3.0
HTTP/1.0 200 OK
@emodric
emodric / gist:4065849
Created November 13, 2012 13:49
integration tests failures
1) eZ\Publish\API\Repository\Tests\FieldType\XmlTextIntegrationTest::testCreateContentType
DOMDocument::loadXML(): Specification mandate value for attribute xm in Entity, line: 2
/home/eddie/ezp-next/eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/XmlText.php:92
/home/eddie/ezp-next/eZ/Publish/Core/Persistence/Legacy/Content/Type/Mapper.php:353
/home/eddie/ezp-next/eZ/Publish/Core/Persistence/Legacy/Content/Type/Mapper.php:204
/home/eddie/ezp-next/eZ/Publish/Core/Persistence/Legacy/Content/Type/Mapper.php:116
/home/eddie/ezp-next/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php:228
/home/eddie/ezp-next/eZ/Publish/Core/Persistence/Legacy/Content/Type/Handler.php:182
/home/eddie/ezp-next/eZ/Publish/Core/Repository/ContentTypeService.php:881
@emodric
emodric / gist:3951551
Created October 25, 2012 09:09
eZ Publish 5 & PHP 5.4.6 login issue
LogicException: Cannot change the name of an active session
in /var/www/ezpublish5/app/cache/dev/classes.php line 500
at AbstractProxy->setName('eZSESSID74e6a8b111ea7da1a7d0a596f4c35208') in /var/www/ezpublish5/app/cache/dev/classes.php line 220
at NativeSessionStorage->setName('eZSESSID74e6a8b111ea7da1a7d0a596f4c35208') in /var/www/ezpublish5/app/cache/dev/classes.php line 792
at Session->setName('eZSESSID74e6a8b111ea7da1a7d0a596f4c35208') in /home/eddie/ezp-next/eZ/Bundle/EzPublishCoreBundle/EventListener/SessionSetDynamicNameListener.php line 69
at SessionSetDynamicNameListener->onSiteAccessMatch(object(PostSiteAccessMatchEvent))
at call_user_func(array(object(SessionSetDynamicNameListener), 'onSiteAccessMatch'), object(PostSiteAccessMatchEvent)) in /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ContainerAwareTraceableEventDispatcher.php line 139
at ContainerAwareTraceableEventDispatcher->doDispatch(array(array(object(SiteAccessListener), 'onSiteAccessMatch'), array(objec