Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit bfaa349

Browse files
committed
defer.php v2
1 parent 550368b commit bfaa349

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6715
-4071
lines changed

.docker/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Dockerfile
2+
FROM php:7.1-zts
3+
4+
# Install Composer, NPM
5+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
6+
;apt update -y \
7+
;apt install -y nodejs npm git zip unzip \
8+
;npm i -g npm
9+
10+
CMD ["/usr/local/bin/composer", "docker"]

.docker/blackfire.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
mkdir -p /tmp/blackfire
4+
architecture=$(case $(uname -m) in i386 | i686 | x86) echo "i386" ;; x86_64 | amd64) echo "amd64" ;; aarch64 | arm64 | armv8) echo "arm64" ;; *) echo "amd64" ;; esac)
5+
curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux/$architecture | tar zxp -C /tmp/blackfire
6+
mv /tmp/blackfire/blackfire /usr/bin/blackfire
7+
rm -Rf /tmp/blackfire
8+
9+
apt install -y wget gnupg2
10+
wget -q -O - https://packages.blackfire.io/gpg.key | apt-key add -
11+
echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list
12+
apt update -y
13+
apt install -y blackfire-php

.docker/docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
3+
services:
4+
test:
5+
tty: true
6+
privileged: true
7+
build: .
8+
image: defer-php-test
9+
container_name: defer-php
10+
hostname: defer-php-test
11+
volumes:
12+
- ..:/home/defer-php
13+
environment:
14+
- APP_ENV=local
15+
working_dir: /home/defer-php

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
* text=auto
2-
/public/* -diff -merge
2+
*.* text eol=lf
3+
4+
/public/* -diff -merge
5+
/tests export-ignore
6+
/phpunit.xml export-ignore

.php_cs

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
<?php
22

33
/**
4-
* A PHP helper class to efficiently defer JavaScript for your website.
5-
* (c) 2019 AppSeeds https://appseeds.net/
4+
* Defer.php aims to help you concentrate on web performance optimization.
5+
* (c) 2021 AppSeeds https://appseeds.net/
66
*
7-
* @package shinsenter/defer.php
8-
* @since 1.0.0
7+
* PHP Version >=5.6
8+
*
9+
* @category Web_Performance_Optimization
10+
* @package AppSeeds
911
* @author Mai Nhut Tan <[email protected]>
10-
* @copyright 2019 AppSeeds
11-
* @see https://github.com/shinsenter/defer.php/blob/develop/README.md
12+
* @copyright 2021 AppSeeds
13+
* @license https://code.shin.company/defer.php/blob/master/LICENSE MIT
14+
* @link https://code.shin.company/defer.php
15+
* @see https://code.shin.company/defer.php/blob/master/README.md
1216
*/
1317

1418
$header = <<<'EOF'
15-
A PHP helper class to efficiently defer JavaScript for your website.
16-
(c) 2019 AppSeeds https://appseeds.net/
19+
Defer.php aims to help you concentrate on web performance optimization.
20+
(c) 2021 AppSeeds https://appseeds.net/
21+
22+
PHP Version >=5.6
1723
18-
@package shinsenter/defer.php
19-
@since 1.0.0
24+
@category Web_Performance_Optimization
25+
@package AppSeeds
2026
@author Mai Nhut Tan <[email protected]>
21-
@copyright 2019 AppSeeds
22-
@see https://github.com/shinsenter/defer.php/blob/develop/README.md
27+
@copyright 2021 AppSeeds
28+
@license https://code.shin.company/defer.php/blob/master/LICENSE MIT
29+
@link https://code.shin.company/defer.php
30+
@see https://code.shin.company/defer.php/blob/master/README.md
2331
EOF;
2432

2533
$rules = [
@@ -92,12 +100,16 @@ $rules = [
92100
];
93101

94102
$finder = \PhpCsFixer\Finder::create()
95-
->in(__DIR__)
103+
->in(__DIR__ . DIRECTORY_SEPARATOR)
96104
->name('*.php')
97-
->exclude('.idea')
105+
->exclude('.docker')
98106
->exclude('.ppm')
107+
->exclude('assets')
99108
->exclude('cache')
100-
->exclude('vendor')
109+
->exclude('patches')
110+
->exclude('public')
111+
->exclude('tests/v1')
112+
->exclude('v1')
101113
->ignoreDotFiles(true)
102114
->ignoreVCS(true);
103115

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Shin
3+
Copyright (c) 2019 AppSeeds
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)