The objective is to conceive a fluent, easy to use API to build location and content search queries. The keyword is fluent, as defined by Martin Fowler: the API methods should match the Domain Language as closely as possible. Chaining of methods is esthetic sugar, but required sugar if we want IDEs to provide contextual completion that always makes sense. Within a given context, the IDE should suggests valid elements, and valid elements should always be suggested.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My; | |
class Controller | |
{ | |
/** | |
* @var \My\Service | |
*/ | |
private $myService; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// "Simple" query (e.g. no logical operations) | |
// is_class( article, blog_post ) AND parent_location_id( 4 ) AND attr_enabled = true AND attr_publishing_date = <DATE> | |
$queryBuilder | |
->contentTypeIdentifier()->in( 'article', 'blog_post' ) | |
->parentLocationId()->eq( 2 ) | |
->checkboxField( 'enabled' )->isFalse() | |
->dateField( 'publishing_date' )->before( 'last monday' ) | |
->sortBy() | |
->datePublished()->descending() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name php55-vm.ezpublish5 php55-vm.ezpublish5.admin; | |
root /home/bertrand/ezpublish5/app/web; | |
access_log /home/bertrand/ezpublish5/app/logs/httpd-access.log; | |
error_log /home/bertrand/ezpublish5/app/logs/httpd-error.log debug; | |
disable_symlinks off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: template helpers | |
Scenario: As a template developer, I want to get a Route Reference to the current route | |
Given I am in any Twig template | |
And I am in the master request | |
When I use "{{ set route_reference = route_ref() }}" | |
Then "route_reference" contains a Route Reference to the current route | |
Scenario: As a template developer, I want to get a Route Reference to a location | |
Given I am in any Twig template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use admin/publish as the login/password for net requests to localhost | |
machine localhost login admin password publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Content media-type="application/vnd.ez.api.Content+xml" href="/api/ezp/v2/content/objects/276" remoteId="2f7b3d4c6137721b88bd5c931efad513" id="276"> | |
<ContentType media-type="application/vnd.ez.api.ContentType+xml" href="/api/ezp/v2/content/types/48"/> | |
<Name>EZP-23000</Name> | |
<Versions media-type="application/vnd.ez.api.VersionList+xml" href="/api/ezp/v2/content/objects/276/versions"/> | |
<CurrentVersion media-type="application/vnd.ez.api.Version+xml" href="/api/ezp/v2/content/objects/276/currentversion"> | |
<Version media-type="application/vnd.ez.api.Version+xml" href="/api/ezp/v2/content/objects/276/versions/2"> | |
<VersionInfo> | |
<id>863</id> | |
<versionNo>2</versionNo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[fpm] | |
user = www-data | |
group = www-data | |
listen = 9000 | |
pm = dynamic | |
pm.max_children = 5 | |
pm.start_servers = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ php app/console bdtest:match-uri /Getting-Started/Selected-Features/Create | |
# Router | |
route: ez_urlalias | |
controller: ez_content:viewContent | |
arguments: | |
- contentId: 69 | |
- locationId: 71 | |
- viewType: full | |
- layout: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the content | |
curl -v -X POST http://admin:[email protected]/api/ezp/v2/content/objects \ | |
-H 'Content-Type: application/vnd.ez.api.ContentCreate+xml' | |
--data-binary "@payload.xml" | |
# Publish the content | |
## replace 122 with the content id returned by the POST request | |
curl -v -X PUBLISH http://admin:[email protected]/api/ezp/v2/content/objects/122/versions/1 |