^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$
- Semantic versioning http://semver.org/
- Source of the regex npm/node-semver#32
<?php | |
declare(strict_types=1); | |
use Doctrine\ORM\EntityManagerInterface; | |
use ProxyManager\Factory\LazyLoadingValueHolderFactory; | |
use ProxyManager\Proxy\VirtualProxyInterface; | |
use Psr\Container\ContainerInterface; | |
use Swoole\ArrayObject; | |
use Swoole\Coroutine; |
#!/bin/bash | |
usage() { | |
if [ ! -z $1 ]; then | |
echo -e "ERROR:\n" 1>&2 | |
fi | |
echo "Usage: $0 -f /path/to/README.md -u dockerhub-username [-r dockerhub-repo-prefix] -n repo-name" 1>&2 | |
exit 1; | |
} | |
while getopts ":r:u:f:n:" o; do |
^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$
$function = new Twig_SimpleFunction('qprw', function (array $replacements) { | |
parse_str($_SERVER['QUERY_STRING'], $qp); | |
foreach ($replacements as $k => $v) { | |
$qp[$k] = $v; | |
} | |
return '?'.http_build_query($qp); | |
}); |
<?php | |
namespace jkuchar\Doctrine\DBAL\Driver\PDOPgSql; | |
use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineOriginalDriver; | |
/** | |
* Adds ability to set search path to PostgreSQL driver | |
* @package App\Doctrine |
<?php | |
use GuzzleHttp\Post\PostFile; | |
$request = $client->createRequest('POST', 'http://example.com/'); | |
$postBody = $request->getBody(); | |
$readStream = $flysystem->readStream($fileLocation); | |
$postBody->addFile(new PostFile('test', $readStream); | |
$response = $client->send($request); |
#!/usr/bin/env php | |
<?php | |
define('MIGRATIONS_DIR', 'app/DoctrineMigrations'); | |
list(, $previousHead, $currentHead) = $argv; | |
$excessMigrations = getExcessMigrations($previousHead, $currentHead); | |
rsort($excessMigrations); | |
removeExcessMigrations($excessMigrations, $previousHead); | |
addMissingMigrations(); |
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# forked by Gianluca Guarini | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
} |