Skip to content

Instantly share code, notes, and snippets.

@pspanja
Created September 5, 2012 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pspanja/3634221 to your computer and use it in GitHub Desktop.
Save pspanja/3634221 to your computer and use it in GitHub Desktop.
Public API boostrap
<?php
/**
* @var \eZ\Publish\API\Container $serviceContainer
*/
$serviceContainer = require "bootstrap.php";
/**
* @var $repository \eZ\Publish\API\Repository\Repository
*/
$repository = $serviceContainer->getRepository();
$administratorUser = $repository->getUserService()->loadUser( 14 );
$repository->setCurrentUser( $administratorUser );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment