Skip to content

Instantly share code, notes, and snippets.

@andrerom
Forked from pspanja/papi_bootstrap.php
Created September 5, 2012 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrerom/3634241 to your computer and use it in GitHub Desktop.
Save andrerom/3634241 to your computer and use it in GitHub Desktop.
Public API boostrap
<?php
/**
* Get ServiceContainer (exposes the API)
* @var \eZ\Publish\API\Container $serviceContainer
*/
$serviceContainer = require "bootstrap.php";
$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