Skip to content

Instantly share code, notes, and snippets.

Avatar

Michaël Gallego bakura10

  • Sapporo, Japan
View GitHub Profile
View foo.php
// Before:
return [
'slm_queue' => [
'worker' => [
'max_runs' => 500
],
'queue_manager' => [
'factories' => [
View DoctrineQueueFactory.php
class DoctrineQueueFactory implements FactoryInterface
{
/**
* {@inheritDoc}
*/
public function createService(ServiceLocatorInterface $serviceLocator, $name = '', $requestedName = '')
{
$parentLocator = $serviceLocator->getServiceLocator();
/** @var $doctrineOptions \SlmQueueDoctrine\Options\DoctrineOptions */
View foo.php
<?php
return [
'slm_queue' => [
'options' => [
'worker' => [
//worker options
],
// Configure each queues
View sm.php
<?php
/**
* If for instance a plugin manager has the following config:
*
* [
* 'invokables' => [
* 'formDateSelect' => 'Zend\Form\Element\DateSelect'
* ]
* ]
*
View gist:7638079
public function getIterator()
{
if (version_compare(PHP_VERSION, '5.5.0') < 0) {
return $this;
}
foreach ($this->routes as $name => $route) {
$route = $this->get($name);
yield $route;
}
View php.php
<?php
$events = array();
$events['event'][] = array(1 => 'e');
$events['event'][] = array(1 => 'b');
$toSort = $events['event'];
asort($toSort);
?>
View foo.php
<?php
return array(
'zfc_rbac' => array(
'permissions' => array(
// Définition des providers. Exemple (syntaxe à réfléchir voir si on peut pas trouver mieux)
'ZfcRbac\Permission\InMemoryPermissionProvider' => array(
'member' => array('edit', 'read'),
'admin' => array('delete')
View gist:7256615
'zf-content-negotiation' => array(
'selectors' => array(
'ZF\Hal\View\HalJsonModel' => array(
'application/json',
'application/*+json',
),
),
),
View test.php
<?php
$allowedMethods = array('options', 'put');
$response->getHeaders()->addHeaderLine('Allow', implode(', ', $allowedMethods));
echo $response->getHeaders()->get('Allow')->getFieldValue(); // also outputs "post"
View ValidationResult.php
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Validator\Result;
You can’t perform that action at this time.