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 alpine as builder | |
RUN apk update && apk upgrade && apk add --no-cache ca-certificates;\ | |
update-ca-certificates | |
FROM scratch | |
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | |
COPY ./local-php-security-checker /usr/local/bin/local-php-security-checker | |
WORKDIR "/app" |
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 | |
# NOTICE it only collects translations made by __() function | |
find ./ -iname '*.php' | xargs xgettext --keyword=__ --language=PHP --add-comments --sort-output -o languages/gr-sms.pot |
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 | |
# A wrapper for the box command. | |
# Disables the phar.readonly PHP option before running the build command. | |
# | |
if [ -z "${@}" ] | |
then | |
CMD=build | |
else | |
CMD="${@}" |
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 | |
const MAX_REDIRECTS = 5; | |
const MAX_WAIT = 30; // don't wait longer than N seconds. | |
const USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'; | |
function curl_get_fileinfo($url): array | |
{ |
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
#!/usr/bin/env php | |
<?php | |
define('URL1', 'http://php.net/manual/en/ref.stream.php'); | |
define('URL2', 'http://php.net/manual/en/function.stream-filter-append.php'); | |
function stream_make_notification_handler(string $stream_id) { | |
return function ($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) use ($stream_id) { | |
echo "STREAM: {$stream_id}\t"; | |
switch ($notification_code) { |
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 | |
# | |
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Remove stopped containers | |
docker rm $(docker ps -aqf status=exited) | |
# Remove untagged images | |
docker rmi $(docker images | awk '{ if ("<none>" == $1) print $3 }') |
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 | |
/** | |
* Using Steam Id provider example. | |
* | |
* Requires: iignatov/lightopenid @{link https://github.com/iignatov/LightOpenID} | |
*/ | |
ini_set('log_errors', 0); | |
ini_set('display_errors', 1); | |
ini_set('error_reporting', -1); |
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
/* | |
* Extracts query results as PHP array. | |
* Tested against PhpStorm 2017.1.3 | |
* Put the file under following path: | |
* ${HOME}/.PhpStorm2017.1/config/extensions/com.intellij.database/data/extractors | |
*/ | |
SEPARATOR = "," | |
QUOTE = "\"" | |
NEWLINE = System.getProperty("line.separator") |