Skip to content

Commit 399d20a

Browse files
committed
🔄 synced file(s) with pimcore/sync-common-files
1 parent 78e2f80 commit 399d20a

File tree

8 files changed

+287
-0
lines changed

8 files changed

+287
-0
lines changed

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
* -text
3+
4+
5+
# Exclude build/test files from archive to reduce ZIP size for composer dist download
6+
/.github export-ignore
7+
/tests export-ignore
8+
/.editorconfig export-ignore
9+
/.gitattributes export-ignore
10+
/.gitignore export-ignore
11+
/.markdownlint.json export-ignore
12+
/.php-cs-fixer.dist.php export-ignore
13+
/CLA.md export-ignore
14+
/CONTRIBUTING.md export-ignore
15+
/codeception.dist.yml export-ignore
16+
/phpstan* export-ignore

.github/ci/files/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
APP_ENV=test
2+
APP_DEBUG=true

.github/ci/files/.my.cnf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[client]
2+
host=127.0.0.1
3+
port=33006
4+
user=root
5+
password=

.github/ci/files/bin/console

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env php
2+
<?php
3+
/**
4+
* Pimcore
5+
*
6+
* This source file is available under two different licenses:
7+
* - GNU General Public License version 3 (GPLv3)
8+
* - Pimcore Enterprise License (PEL)
9+
* Full copyright and license information is available in
10+
* LICENSE.md which is distributed with this source code.
11+
*
12+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
13+
* @license http://www.pimcore.org/license GPLv3 and PEL
14+
*/
15+
16+
ob_get_clean();
17+
18+
if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
19+
include $a;
20+
} elseif (file_exists($a = __DIR__ . '/../../../../vendor/autoload.php')) {
21+
include $a;
22+
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
23+
include $a;
24+
} else {
25+
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
26+
exit(1);
27+
}
28+
29+
\Pimcore\Bootstrap::setProjectRoot();
30+
31+
define('PIMCORE_CONSOLE', true);
32+
33+
34+
$input = new \Symfony\Component\Console\Input\ArgvInput();
35+
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
36+
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
37+
}
38+
39+
if ($input->hasParameterOption('--no-debug', true)) {
40+
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
41+
}
42+
43+
/** @var \Pimcore\Kernel $kernel */
44+
$kernel = \Pimcore\Bootstrap::startupCli();
45+
$application = new \Pimcore\Console\Application($kernel);
46+
$application->run();

.github/ci/files/kernel/Kernel.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Pimcore
4+
*
5+
* This source file is available under two different licenses:
6+
* - GNU General Public License version 3 (GPLv3)
7+
* - Pimcore Enterprise License (PEL)
8+
* Full copyright and license information is available in
9+
* LICENSE.md which is distributed with this source code.
10+
*
11+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
12+
* @license http://www.pimcore.org/license GPLv3 and PEL
13+
*/
14+
15+
namespace App;
16+
17+
use Pimcore\Kernel as BaseKernel;
18+
19+
class Kernel extends BaseKernel
20+
{
21+
22+
}

.github/ci/files/public/.htaccess

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Use the front controller as index file. It serves as a fallback solution when
2+
# every other rewrite/redirect fails (e.g. in an aliased environment without
3+
# mod_rewrite). Additionally, this reduces the matching process for the
4+
# start page (path "/") because otherwise Apache will apply the rewriting rules
5+
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
6+
DirectoryIndex index_test.php
7+
8+
# By default, Apache does not evaluate symbolic links if you did not enable this
9+
# feature in your server configuration. Uncomment the following line if you
10+
# install assets as symlinks or if you experience problems related to symlinks
11+
# when compiling LESS/Sass/CoffeScript assets.
12+
# Options FollowSymlinks
13+
14+
# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
15+
# to the front controller "/app.php" but be rewritten to "/app.php/app".
16+
<IfModule mod_negotiation.c>
17+
Options -MultiViews
18+
</IfModule>
19+
20+
# mime types
21+
AddType video/mp4 .mp4
22+
AddType video/webm .webm
23+
AddType image/jpeg .pjpeg
24+
25+
Options +SymLinksIfOwnerMatch
26+
27+
# Use UTF-8 encoding for anything served text/plain or text/html
28+
AddDefaultCharset utf-8
29+
30+
RewriteEngine On
31+
32+
<IfModule mod_headers.c>
33+
<FilesMatch "\.(jpe?g|png)$">
34+
Header always unset X-Content-Type-Options
35+
</FilesMatch>
36+
</IfModule>
37+
38+
# Determine the RewriteBase automatically and set it as environment variable.
39+
# If you are using Apache aliases to do mass virtual hosting or installed the
40+
# project in a subdirectory, the base path will be prepended to allow proper
41+
# resolution of the app.php file and to redirect to the correct URI. It will
42+
# work in environments without path prefix as well, providing a safe, one-size
43+
# fits all solution. But as you do not need it in this case, you can comment
44+
# the following 2 lines to eliminate the overhead.
45+
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
46+
RewriteRule ^(.*) - [E=BASE:%1]
47+
48+
# Sets the HTTP_AUTHORIZATION header removed by Apache
49+
RewriteCond %{HTTP:Authorization} .
50+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
51+
52+
# Redirect to URI without front controller to prevent duplicate content
53+
# (with and without `/app.php`). Only do this redirect on the initial
54+
# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
55+
# endless redirect loop (request -> rewrite to front controller ->
56+
# redirect -> request -> ...).
57+
# So in case you get a "too many redirects" error or you always get redirected
58+
# to the start page because your Apache does not expose the REDIRECT_STATUS
59+
# environment variable, you have 2 choices:
60+
# - disable this feature by commenting the following 2 lines or
61+
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
62+
# following RewriteCond (best solution)
63+
RewriteCond %{ENV:REDIRECT_STATUS} ^$
64+
RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
65+
66+
<IfModule mod_status.c>
67+
RewriteCond %{REQUEST_URI} ^/(fpm|server)-(info|status|ping)
68+
RewriteRule . - [L]
69+
</IfModule>
70+
71+
# restrict access to dotfiles
72+
RewriteCond %{REQUEST_FILENAME} -d [OR]
73+
RewriteCond %{REQUEST_FILENAME} -l [OR]
74+
RewriteCond %{REQUEST_FILENAME} -f
75+
RewriteRule /\.|^\.(?!well-known/) - [F,L]
76+
77+
# ASSETS: check if request method is GET (because of WebDAV) and if the requested file (asset) exists on the filesystem, if both match, deliver the asset directly
78+
RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)
79+
RewriteCond %{DOCUMENT_ROOT}/var/assets%{REQUEST_URI} -f
80+
RewriteRule ^(.*)$ /var/assets%{REQUEST_URI} [PT,L]
81+
82+
# Thumbnails
83+
RewriteCond %{REQUEST_URI} .*/(image|video)-thumb__[\d]+__.*
84+
RewriteCond %{DOCUMENT_ROOT}/var/tmp/%1-thumbnails%{REQUEST_URI} -f
85+
RewriteRule ^(.*)$ /var/tmp/%1-thumbnails%{REQUEST_URI} [PT,L]
86+
87+
# cache-buster rule for scripts & stylesheets embedded using view helpers
88+
RewriteRule ^cache-buster\-[\d]+/(.*) $1 [PT,L]
89+
90+
# If the requested filename exists, simply serve it.
91+
# We only want to let Apache serve files and not directories.
92+
RewriteCond %{REQUEST_FILENAME} -f
93+
RewriteRule ^ - [L]
94+
95+
# Rewrite all other queries to the front controller.
96+
RewriteRule ^ %{ENV:BASE}/index_test.php [L]
97+
98+
99+
100+
101+
##########################################
102+
### OPTIONAL PERFORMANCE OPTIMIZATIONS ###
103+
##########################################
104+
105+
<IfModule mod_deflate.c>
106+
# Force compression for mangled headers.
107+
# http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
108+
<IfModule mod_setenvif.c>
109+
<IfModule mod_headers.c>
110+
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
111+
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
112+
</IfModule>
113+
</IfModule>
114+
115+
# Compress all output labeled with one of the following MIME-types
116+
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
117+
# and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
118+
# as `AddOutputFilterByType` is still in the core directives).
119+
<IfModule mod_filter.c>
120+
AddOutputFilterByType DEFLATE application/atom+xml application/javascript application/json \
121+
application/vnd.ms-fontobject application/x-font-ttf application/rss+xml \
122+
application/x-web-app-manifest+json application/xhtml+xml \
123+
application/xml font/opentype image/svg+xml image/x-icon \
124+
text/css text/html text/plain text/x-component text/xml text/javascript
125+
</IfModule>
126+
</IfModule>
127+
128+
<IfModule mod_expires.c>
129+
ExpiresActive on
130+
ExpiresDefault "access plus 31536000 seconds"
131+
132+
# specific overrides
133+
#ExpiresByType text/css "access plus 1 year"
134+
</IfModule>
135+
136+
<IfModule pagespeed_module>
137+
# pimcore mod_pagespeed integration
138+
# pimcore automatically disables mod_pagespeed in the following situations: debug-mode on, /admin, preview, editmode, ...
139+
# if you want to disable pagespeed for specific actions in pimcore you can use $this->disableBrowserCache() in your action
140+
RewriteCond %{REQUEST_URI} ^/(mod_)?pagespeed_(statistics|message|console|beacon|admin|global_admin)
141+
RewriteRule . - [L]
142+
143+
ModPagespeed Off
144+
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
145+
ModPagespeedModifyCachingHeaders off
146+
ModPagespeedRewriteLevel PassThrough
147+
# low risk filters
148+
ModPagespeedEnableFilters remove_comments,recompress_images
149+
# low and moderate filters, recommended filters, but can cause problems
150+
ModPagespeedEnableFilters lazyload_images,extend_cache_images,inline_preview_images,sprite_images
151+
ModPagespeedEnableFilters combine_css,rewrite_css,move_css_to_head,flatten_css_imports,extend_cache_css,prioritize_critical_css
152+
ModPagespeedEnableFilters extend_cache_scripts,combine_javascript,canonicalize_javascript_libraries,rewrite_javascript
153+
# high risk
154+
#ModPagespeedEnableFilters defer_javascript,local_storage_cache
155+
</IfModule>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Pimcore
4+
*
5+
* This source file is available under two different licenses:
6+
* - GNU General Public License version 3 (GPLv3)
7+
* - Pimcore Enterprise License (PEL)
8+
* Full copyright and license information is available in
9+
* LICENSE.md which is distributed with this source code.
10+
*
11+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
12+
* @license http://www.pimcore.org/license GPLv3 and PEL
13+
*/
14+
15+
use Pimcore\Tool;
16+
use Symfony\Component\HttpFoundation\Request;
17+
18+
include __DIR__ . "/../vendor/autoload.php";
19+
20+
define('PIMCORE_PROJECT_ROOT', __DIR__ . '/..');
21+
define('APP_ENV', 'test');
22+
23+
\Pimcore\Bootstrap::setProjectRoot();
24+
\Pimcore\Bootstrap::bootstrap();
25+
26+
$request = Request::createFromGlobals();
27+
28+
// set current request as property on tool as there's no
29+
// request stack available yet
30+
Tool::setCurrentRequest($request);
31+
32+
/** @var \Pimcore\Kernel $kernel */
33+
$kernel = \Pimcore\Bootstrap::kernel();
34+
35+
// reset current request - will be read from request stack from now on
36+
Tool::setCurrentRequest(null);
37+
38+
$response = $kernel->handle($request);
39+
$response->send();
40+
41+
$kernel->terminate($request, $response);

.github/ci/files/templates/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)