Skip to content

froscon 10 (2015) - der Termin steht

Der Termin für die 10 froscon steht, es ist der "22. + 23. August 2015".
Und jetzt der Knüller, die Froscon ist für lau, kostenfrei, costa quanta nada. Man möchte es gar nicht zu deutlich schreiben, wenn man sich den Wachstum der letzten Jahre bedenkt, aber wow - ihr seid verrückt, liebe frosconer :-). Nun könnt ihr euch nur noch einmal steigern, indem ihr die Anreise für Lau anbietet ;-).
Das Programm gibt es hier.
Ich kenne schon jetzt fünf Personen, die sich auf den August freuen.

version 1.1.0 of php component requirement released

I happy to announce the release of 1.1.0 of bazzlines requirement component for php. Important changes are:

  • added example WithDisabledCondition
  • added example WithDisabledItem
  • added getConditions() method to RequirementInterface - this easies up disabling single conditions or single items (by using condition->getItems())
  • added migration howto
  • added version eye and scrutinizer coverage
  • covered AbstractItem and AbstractCondition with unit test
  • created AbstractItem that implements ItemInterface
  • created IsDisabledInterface
  • created ItemInterface
  • created TestCase that is extended by all phpunit tests
  • implemented IsDisabledInterface to AbstractCondition
  • implemented IsDisabledInterface to Requirement
  • refactored ConditionInterface, addItem now only accepts ItemInterface instead of IsMetInterface
  • refactored Condition::getItems() - now returns plain php array
  • renamed ConditionAbstract to AbstractCondition
  • renamed and updated previous WithShutdown example to WithDisabledRequirement
  • updated dependencies

php - zfcampus/zf-rest how to | tutorial

Assuming you are using the Zend Framework 2 and want to implement a REST endpoint in a quick and fully functional way.
ZF-Rest is, more or less, the official rest module for zf2. But, the documentation is not available - nor planned right now. Thats why I this blog entry will boost your knowledge and speed up the time until you have finished your first zf2 rest endpoint.

Installation and Setup


#add the following line to you composer.json
"zfcampus/zf-rest": "1.0.3"

You need to add the following entries in your to "config/autload/application.config".


 array(
        //your modules
        'ZF\ApiProblem',
        'ZF\ContentNegotiation',
        'ZF\Hal',
        'ZF\MvcAuth',
        'ZF\OAuth2',
        'ZF\Rest'
    );

Minimal Configuration (module.config.php)

array key "zf-rest"


//MyRestController is a virtual Controller 
'My\\Module\\Namespace\\MyRestController' => array(
    //mandatory - available are GET, POST, PUT, PATCH, DELETE
    'collection_http_methods'       => array(
        'GET'
    ),
    //mandatory - available are GET, POST, PUT, PATCH, DELETE
    'entity_http_methods'           => array(
        'GET'
    ),
    //virtual name - its the name the collection entries are getting in the HAL-repesentation
    'collection_name'               => 'items',
    'route_name'                    => 'my_rest_route_name',
    'route_identifier_name'         => 'id',
    //this is the only file you really need to code/implement
    'listener'                      => 'My\\Module\\Namespace\\MyListener'
),

array key "router/routes"


'my_rest_route_name' => array(
    'type' => 'Zend\Mvc\Router\Http\Segment',
    'options' => array(
        'route' => '/my/rest/endpoint/[/:id]',
        'defaults' => array(
            //MyRestController is a virtual Controller
            //The name is needed to map the module configuration to the endpoint
            'controller' => 'My\\Module\\Namespace\\MyRestController'
        )
    ),

Optional Configuration Values

Based on the source code from RestControllerFactory.php, following configuration keys are optional (mention as mandatory in the current README.md).

  • resource_identifiers
  • identifier
  • controller_class
  • entity_class
  • collection_class