Skip to content

Instantly share code, notes, and snippets.

View pedroresende's full-sized avatar

Pedro Resende pedroresende

View GitHub Profile
server {
listen 80;
server_name ezp5 admin.ezp5;
index index.php;
root /var/www/html/ezpublish5/web;
autoindex on;
access_log /var/log/nginx/ezp5.log;
error_log /var/log/nginx/ezp5_error.log notice;
@pedroresende
pedroresende / gist:8419795
Created January 14, 2014 15:09
REST Client
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="http://getbootstrap.com/docs-assets/ico/favicon.png">
echo "Exception trying to add and invalid Latitude and Longitude\n";
$content = $this->api->newContent( 'a_gmap_location_class' );
$content->setField( 'name', 'GMap Location Test Object' );
$values = array( 'address' => 'Oslo Norway', 'latitude' => '0.0' , 'longitude' => '0.0' );
$content->setField( 'gmap_location', $value );
$this->api->saveContent( $content );
@pedroresende
pedroresende / error
Created November 20, 2012 15:39
Stack Trace Error
$contentService = $this->repo->getContentService();
$location = $this->api->getLocationByPath( '/Date-and-Time-Test-Object' );
$content = $this->api->getContentToUpdate( $location->contentInfo );
try {
$newData = new DateTime( '31-09-2012 12:00 am' ); // 31-09-2012 12:00 am
$content->setField( 'date_time', $newData );
$this->api->saveContentUpdate( $content->contentInfo );
} catch (exception $e) {