Skip to content

Instantly share code, notes, and snippets.

View bdunogier's full-sized avatar

Bertrand Dunogier bdunogier

View GitHub Profile
@bdunogier
bdunogier / ezcachedmodule.php
Created September 5, 2012 12:42
Cached module extension*
<?php
class eZCachedModule
{
public static function generate( $file, $args )
{
extract( $args );
$tpl = templateInit();
$tpl->setVariable( 'value', $Params['Value'] );
@bdunogier
bdunogier / file.ini.append.php
Created September 6, 2012 11:16
SummerCamp cluster file.ini
<?php /* #?ini charset="utf-8"?
[ClusteringSettings]
FileHandler=eZDFSFileHandler
[eZDFSClusteringSettings]
MountPointPath=/opt/nfs/ezpublish
DBBackend=eZDFSFileHandlerMySQLiBackend
DBHost=localhost
DBPort=3306
@bdunogier
bdunogier / createcontent.sh
Created October 19, 2012 13:42
A simple bash script that creates content over the eZ Publish 5 REST API v2 (http://github.com/ezsystems/ezpublish-community)
# Create & publish an ezdemo article using the eZ Publish 5 REST API v2
# Notes:
# - this script requires http ie, which can be found at https://github.com/jkbr/httpie
# - it temporarily depends on a few temporary fixes, available in my fork: https://github.com/bdunogier/ezp-next/tree/tmp-rest-fixes
# - it is NOT well written, and I suck at shell scripting. Feel free to submit improvements to the GIST ;)
#
# Author: Bertrand Dunogier <http://share.ez.no/community/profile>, twitter @bdunogier, http://gplus.to/BertrandDunogier
# Usage: run it
REST_URI="http://vm.ezpublish5/api/ezp/v2"
@bdunogier
bdunogier / 77861.user.js
Created November 8, 2012 11:00
Partially fixed version of the Github Commit Expander userscript by gufighter: http://userscripts.org/scripts/show/77861.
// ==UserScript==
// @name GitHub Commit Expander
// @namespace vidzbigger.com
// @description Show the remaining lines of a file while viewing a commit. Also provides scroll marks to easily jump through changes.
// @include http*://github.com/*/*/pull/*/commits
// @include http*://github.com/*/*/commit*
// @match http*://github.com/*/*/commit*
// @match http*://github.com/*/*/pull/*/commits
// ==/UserScript==
@bdunogier
bdunogier / README.md
Created July 19, 2013 12:23
Sample eZ Publish REST extension
@bdunogier
bdunogier / eZ Publish 5 Legacy bundle.md
Created January 22, 2014 09:43
Legacy extension bundle
@bdunogier
bdunogier / AppKernel.php
Last active January 4, 2016 11:59
eZ Publish extensible kernel example files (see https://github.com/ezsystems/ezpublish-community/pull/97)
<?php
// FILE: app/vm.ezpublish5/AppKernel.php
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends EzPublishExtensibleKernel
{
public function registerBundles()
{
$bundles = array(
new BD\Bundle\TestBundle\BDTestBundle(),
@bdunogier
bdunogier / EZP-22217-rest_country_list.md
Last active January 4, 2016 19:09
EZP-22217: REST Country list specifications

REST Countries list specifications

JIRA story: http://jira.ez.no/browse/EZP-22217

Implement a REST service that gives access to an ISO-3166 formatted list of world countries.

Use-cases

  • presenting a country options list from any application that uses the REST API

Get the list of countries

@bdunogier
bdunogier / legacy_bundles_followup.md
Created February 15, 2014 15:28
Legacy bundles (EZP-22210) follow-up stories

Follow-up stories for legacy bundles

Original story: EZP-22210

Semi-automatic null FieldType mapping

Benefit: makes it easier to soft migrate legacy datatype extensions to the new stack Usefulness: 7/10 (BD)

A common use-case in projects would be to map an existing, custom legacy datatype to the [Null FieldType][NullFieldType].

@bdunogier
bdunogier / test2.php
Created March 9, 2014 14:51
Usage example of the native eZ Publish 5 REST API PHP Client.It comes as a reimplementation of the Repository APIs, allowing the same code to be used for a local and a remote eZ Publish instance. Work in progress branch: https://github.com/bdunogier/ezpublish-kernel/compare/rest_client_relaunched. Specifications at https://github.com/bdunogier/e…
<?php
$loader = require 'vendor/autoload.php';
$repositoryFactory = new \eZ\Publish\Core\REST\Client\RepositoryFactory();
$repository = $repositoryFactory->create( 'http://php55-vm.ezpublish5/', 'admin', 'publish' );
print_r(
$repository->getContentService()->loadContentInfo( '/api/ezp/v2/content/objects/59' )
);