This file contains hidden or 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 | |
declare(strict_types=1); | |
/** | |
* Crache du XML, yay. | |
*/ | |
class XmlRequestWriter | |
{ | |
/** |
This file contains hidden or 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 | |
/** | |
* Run in folder where to scan: | |
* php -f /path/to/duplicated_functions.php | |
* | |
* For more detailed debug information: | |
* DEBUG=1 php -f /path/to/duplicated_functions.php | |
*/ | |
declare (strict_types=1); |
This file contains hidden or 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 | |
/** | |
* Maps PHP native types to normalized names | |
*/ | |
interface TypeMap | |
{ | |
const TYPE_ARRAY = 'array'; | |
const TYPE_NULL = 'null'; | |
const TYPE_STRING = 'string'; |
This file contains hidden or 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 usage($programeName) { | |
echo <<<EOT | |
Usage: | |
{$programeName} TRACE_FILE | |
EOT; | |
} |
This file contains hidden or 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
#!/usr/bin/php | |
<?php | |
function panic_bootstrap_database($site_host = null, $incomming_host = null) { | |
$_SERVER['REMOTE_ADDR'] = $incomming_host ? $incomming_host : '127.0.0.1'; | |
$_SERVER['HTTP_HOST'] = $site_host ? $site_host : '127.0.0.1'; | |
$_SERVER['SCRIPT_NAME'] = '/index.php'; | |
define('DRUPAL_ROOT', __DIR__ . '/../html'); |
This file contains hidden or 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
/** | |
* @see \Symfony\Component\HttpKernel\Controller\ErrorController | |
*/ | |
final class ErrorController | |
{ | |
private bool $debug = false; | |
private ErrorRendererInterface $errorRenderer; | |
private Environment $twig; | |
/** |
This file contains hidden or 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
case 'https': | |
// Note: Only works when PHP is compiled with OpenSSL support. | |
$port = isset($uri['port']) ? $uri['port'] : 443; | |
$socket = 'ssl://' . $uri['host'] . ':' . $port; | |
$options['headers']['Host'] = $uri['host'] . ($port != 443 ? ':' . $port : ''); | |
if (empty($options['context'])) { | |
$options['context'] = stream_context_create(); | |
} | |
stream_context_set_option($options['context'], 'ssl', 'verify_host', false); |
This file contains hidden or 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 | |
if [ "`id -u`" != "0" ]; then | |
echo "Script must be run as root" | |
exit 1 | |
fi | |
IGNORE_BIN=0 | |
ROOT_PATH=`pwd` |
This file contains hidden or 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 applyIBANMaks(input) { | |
var mask = '____ ____ ____ ____ ____ ____ ____'.split(''); | |
var cursorPositionDelta = 0; | |
function strip(value) { | |
return value.split('').filter(function (chr) { | |
return /[a-zA-Z\d]/.test(chr); | |
}); | |
} |
NewerOlder