- ProophEventSourcing - Provides basic functionality for event-sourced aggregates
- ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
- Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
- EventSauce - Pragmatic event sourcing for PHP
- ProophEventMachine - The world's only CQRS / ES framework that lets you pick your Flavour ]* predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
- mmasiukevich/service-bus - CQRS\Event Sourcing\Message based framework
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
FROM node:12.16.1-alpine3.11 as base | |
WORKDIR /var/www | |
COPY package.json package-lock.json ./ | |
RUN npm install | |
COPY ./ ./ |
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 | |
function getLines($file): array { | |
$f = fopen($file, 'r'); | |
if (!$f) throw new Exception(); | |
$lines = []; | |
while ($line = fgets($f)) { | |
$lines[] = $line; | |
} | |
return $lines; | |
} |
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 | |
function createLogger($file)): Generator { | |
$f = fopen($file, 'a'); | |
while (true) { | |
$line = yield; | |
fwrite($f, $line. "\n"); | |
} | |
} | |
$log = createLogger('/path-to-log/file.log'); |
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 | |
$lines = getLines('/path-to-file'); | |
foreach ($lines as $line) { | |
if (SOME CONDITION) { | |
break; | |
} | |
echo $line. "\n"; | |
} |
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 | |
function getLines($file): Generator { | |
$f = fopen($file, 'r'); | |
if (!$f) throw new Exception(); | |
while ($line = fgets($f)) { | |
yield $line; | |
} | |
fclose($f); | |
} |
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 | |
function uploadImages(iterable $images) { | |
foreach ($images as $image) { | |
// code to upload image to somewhere | |
} | |
} |
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 | |
function uploadImages(array $images) { | |
foreach ($images as $image) { | |
// code to upload image to somewhere | |
} | |
} |
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 | |
class FileIterator implements \Iterator { | |
protected $filePointer; | |
protected $data; | |
protected $key; | |
public function __construct($file) { | |
$this->filePointer = fopen($file, 'rb'); | |
if (!$this->filePointer) { |
Add the following xdebug.ini in your docker container:
zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=off
xdebug.idekey=debugit
xdebug.remote_host=docker.for.mac.localhost