- Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
- EventCentric.Core - Event Sourcing and CQRS in PHP
- LiteCQRS - Small convention based CQRS library for PHP
- predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
- ProophEventSourcing - Provides basic functionality for event-sourced aggregates
- ProophEventStore - PHP 5.4+ EventStore Implementation
- ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
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 | |
// ref: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/ | |
// Validate Email | |
if (filter_var('[email protected]', FILTER_VALIDATE_EMAIL)) { | |
echo "Your email is ok."; | |
} else { | |
echo "Wrong email address format."; | |
} | |
//Validate Username |
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
function convertPersianNumbersToEnglish($number) | |
{ | |
$persian = array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'); | |
$num = range(0, 9); | |
return (int)str_replace($persian, $num, $number); | |
} |
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 BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |
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
public function generateSvgGradientAction() { | |
$from_stop = isset($_GET['from']) ? $_GET['from'] : '000000'; | |
$to_stop = isset($_GET['to']) ? $_GET['to'] : '000000'; | |
header('Content-type: image/svg+xml; charset=utf-8'); | |
echo '<?xml version="1.0"?> | |
'; |
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 | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial | |
*/ | |
class VideoStream | |
{ | |
private $path = ""; |
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 | |
/** | |
* This function takes in a color string and test whether it is in hex format. | |
* If so it will simply return a '#' prefixed version to make it the standard | |
* hex format, or return it as-is. | |
* | |
* This is done to make linking to this file within css a bit easier, since we'd | |
* need to escape the '#' so the browser doesn't treat it as a hash and ignore | |
* it when requesting content. Otherwise users would have to link using: | |
* |
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
-module(calc). | |
-export([prime_numbers/1]). | |
% Source: https://wbear.wordpress.com/2011/12/08/prime-numbers-with-erlang/ | |
% Sieve of Eratosthenes algorithm for finding all prime numbers up to N. | |
% http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
% Generate list of prime numbers up to N. | |
prime_numbers(N) when is_number(N) -> | |
prime_numbers(N, generate(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
#!/bin/bash | |
PHP_VERSION=7.4.2 | |
# Command lines tools | |
xcode-select --install | |
# Install dependencies | |
brew install wget autoconf openssl lzlib curl imap-uw readline postgresql gettext libxslt libiconv bison pkg-config krb5 bzip2 openldap tidy-html5 | |
# Dirs |
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 TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |
OlderNewer