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
# docker-compose.yml | |
version: '3' | |
services: | |
web: | |
container_name: my_php_app | |
build: . | |
ports: | |
- "80:80" | |
volumes: | |
- cache:/data/cache |
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/sh | |
# build/composer.sh | |
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" | |
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] | |
then | |
>&2 echo 'ERROR: Invalid installer signature' |
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
;build/supervisor.conf | |
[supervisord] | |
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) | |
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) | |
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) | |
nodaemon=true | |
[program:nginx] | |
command=/usr/sbin/nginx -g 'daemon off;' | |
autostart=true |
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
# build/site.conf | |
server { | |
listen 7102; | |
server_name ~.; | |
root /var/www/html/public; | |
location / { | |
try_files $uri /index.php$is_args$args; | |
} |
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
# Dockerfile | |
FROM phusion/baseimage | |
ENV DEBIAN_FRONTEND noninteractive | |
# Install PHP | |
RUN add-apt-repository -y ppa:ondrej/php && apt-get update | |
RUN apt-get install -y \ | |
# Only install the php extensions you need. | |
php7.1-fpm \ | |
php7.1-mcrypt \ |
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 | |
/** | |
* @param int $page | |
* @param int $total | |
* @param int $range | |
* | |
* @return array | |
*/ | |
function getPages(int $page, int $total, int $range): array | |
{ |
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 | |
namespace App\Command; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
/** | |
* Class MyCommand | |
* |
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 | |
class User | |
{ | |
/** | |
* @var string | |
*/ | |
private $name; |
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
/** | |
* @param $value | |
* @param string $param | |
* @return string | |
*/ | |
public function appendParam($param, $value) | |
{ | |
$url = $this->request->getUri(); | |
$queryString = parse_url($url, PHP_URL_QUERY); | |
$params = []; |
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
{% for label, flashes in app.session.flashbag.all %} | |
{% for flash in flashes %} | |
<div class="alert alert-{{ label }}"> | |
{{ flash }} | |
</div> | |
{% endfor %} | |
{% endfor %} |
NewerOlder