Skip to content

Instantly share code, notes, and snippets.

Mattin / ProjectionCommand.php
Created Jun 7, 2021
Prooph Projection with GapDetection
View ProjectionCommand.php
* @copyright Copyright (c) 2019 TRIFFT ME s.r.o. (
* @author Matus Nickel <>
Ocramius / Day.php
Created Apr 3, 2020
Example abstraction that only allows a resolution of "day" for time inside a specific business domain
View Day.php
namespace Core\Domain\Time;
use DateTimeImmutable;
use DateTimeZone;
use Generator;
use Iterator;
adelineu / to_json_object.php
Created Apr 15, 2019
Convert a PHP array to a mysql JSON_OBJECT
View to_json_object.php
function to_JSON_OBJECT($a)
$json = json_encode($a, JSON_PRETTY_PRINT);
// split into lines
$lines = explode("\n", $json);
foreach ($lines as $key => $line) {
// remove space


Projectors fail with contraint errors when rebuilding read models.

Setup description

Implementations of Prooph\EventStore\Projection\AbstractReadModel are used to build read-models. We are using Doctrine Entities for these models. ReadModelProjector::OPTION_PERSIST_BLOCK_SIZE is set to 1000 The persist method of Prooph\EventStore\Projection\AbstractReadModel has been adapted to wrap the stack of changes inside a transaction. (see ReadModelTrait.php)

View CombinedReadModel.php
namespace Funct\Ion\Microsite\Base\ReadModel\MicrositeCollections;
use Prooph\EventStore\Projection\AbstractReadModel;
use RuntimeException;
final class CombinedReadModel extends AbstractReadModel
View BigIdSingelStreamStrategy.php
final class BigIdSingleStreamStrategy implements PersistenceStrategy, HasQueryHint
* @param string $tableName
* @return string[]
public function createSchema(string $tableName): array
kai101 /
Last active Apr 11, 2021
How to Install Wkhtmltopdf 12.4 with patched Qt?

How to Install Wkhtmltopdf 12.4 with patched Qt?

For earlier version whos suffering from versionlock syndrome. Please follow the instructions to rollback to older SSL interface. Do not alarm by the fallback ssl interface, they received security patches for vulnerability discovered.

Current version of apt-get wkhtmltopdf does not come with Qt patch. There are some issue going with both Qt patched and non-patched. Most common use case is compatible with the patched Qt.

View ddl_prooph.sql
# Event Stream
CREATE TABLE `event_streams` (
`real_stream_name` VARCHAR(150) NOT NULL,
`stream_name` CHAR(41) NOT NULL,
`metadata` TEXT NOT NULL,
`category` VARCHAR(150),
CHECK (`metadata` IS NOT NULL OR JSON_VALID(`metadata`)),
UNIQUE KEY `ix_rsn` (`real_stream_name`),
codeliner / MongoConnection.php
Last active Apr 6, 2017
prooph MongoEventStore v7
View MongoConnection.php
declare(strict_types = 1);
namespace Acme\Infrastructure\MongoDb;
use MongoDB\Client;
use MongoDB\Collection;
class MongoConnection
chalasr / splat_operator.php
Last active Apr 11, 2016
function with dynamic number of type-hinted arguments using the splat operator PHP 5.6
View splat_operator.php
function splat(array ...$args) {
foreach ($args as $arg) {
splat(['firstArray'], ['secondArray']);
// Output: Array( [0] => firstArray ) Array( [0] => secondArray )