Skip to content

Instantly share code, notes, and snippets.

View Opencontent's full-sized avatar

OpenContent Developer Opencontent

View GitHub Profile
@Opencontent
Opencontent / gist:0f5bd68268c49a371d1b
Last active November 22, 2019 10:29
EzPublish Legacy debug site.ini settings
#################
##### DEBUG #####
#################
[MailSettings]
Transport=file
[ContentSettings]
ViewCaching=disabled
@Opencontent
Opencontent / ParensParser.php
Last active June 16, 2020 06:06 — forked from xeoncross/ParensParser.php
PHP: Nested Parenthesis Parser
<?php
// @rodneyrehm
// http://stackoverflow.com/a/7917979/99923
class ParensParser
{
protected $length = null;
// something to keep track of parens nesting
protected $stack = null;
// current level
@Opencontent
Opencontent / AddLocation.php
Last active June 8, 2016 16:01
eZ Publish Legacy Add Location
<?php
function addLocation(
eZContentObject $object,
$parentNodeId,
$addAsMain = false
) {
$node = $object->mainNode();
$parentNode = eZContentObjectTreeNode::fetch($parentNodeId);
@Opencontent
Opencontent / gist:4f9e2e891b676ebf9b864ada966117d0
Created January 25, 2017 14:37
update_from_45_to_20150103.sql
-- 4.5.0 -> 4.6.0
UPDATE ezsite_data SET value='4.6.0' WHERE name='ezpublish-version';
UPDATE ezsite_data SET value='1' WHERE name='ezpublish-release';
CREATE SEQUENCE ezorder_nr_incr_s
START 1
INCREMENT 1
MAXVALUE 9223372036854775807
MINVALUE 1
<?php
require 'autoload.php';
$script = eZScript::instance( array( 'description' => ( 'Check image ini' ),
'use-session' => false,
'use-modules' => true,
'use-extensions' => true ) );
$script->startup();
<?php
require 'autoload.php';
$script = eZScript::instance( array( 'description' => ( "OpenPA Cambio password\n\n" ),
'use-session' => false,
'use-modules' => true,
'use-extensions' => true ) );
$script->startup();
<?php
require 'autoload.php';
$script = eZScript::instance( array( 'description' => ( 'Download images from endpoint' ),
'use-session' => false,
'use-modules' => true,
'use-extensions' => true ) );
$script->startup();
<?php
use Opencontent\Opendata\Api\Values\ExtraData;
use Opencontent\Opendata\Api\Values\ExtraDataProviderInterface;
class ezfIndexAccountInfo implements ezfIndexPlugin, ExtraDataProviderInterface
{
/**
* @param eZContentObject $contentObject
* @param eZSolrDoc[] $docList
<?php
require 'autoload.php';
$script = eZScript::instance( array( 'description' => ( 'Download images from endpoint' ),
'use-session' => false,
'use-modules' => true,
'use-extensions' => true ) );
$script->startup();
var cleanFilterValue = function(values){
if(!$.isArray(values)){
values = [values];
}
var data = $.map(values, function(str){
str = $.trim(str);
str = str.replace(/'/g, "\\'");
//str = str.replace("(","\\("); //solo ocopendata >= 2.13 interpreta l'escape delle parentesi
//str = str.replace(")","\\)"); //solo ocopendata >= 2.13 interpreta l'escape delle parentesi
return str;