├── .editorconfig
├── .env
├── .env.test
├── .github
└── workflows
│ └── tests.yml
├── .gitignore
├── LICENSE
├── README.md
├── app
├── .htaccess
├── AppCache.php
├── AppKernel.php
├── SymfonyRequirements.php
├── autoload.php
├── check.php
├── console
└── phpunit.xml.dist
├── bin
├── .htaccess
├── build_code_changes_30.sh
├── build_code_changes_31.sh
├── build_code_changes_32.sh
├── build_code_changes_33.sh
├── build_docs.sh
├── console
├── patch-type-declarations
├── php-parse
├── phpunit
├── sql-formatter
├── update_phpbb.sh
├── update_symfony.sh
├── var-dump-server
└── yaml-lint
├── composer.json
├── composer.lock
├── composer.phar
├── config
├── bootstrap.php
├── bundles.php
├── config.yml
├── config_dev.yml
├── config_prod.yml
├── config_test.yml
├── packages
│ ├── cache.yaml
│ ├── dev
│ │ └── monolog.yaml
│ ├── doctrine.yaml
│ ├── framework.yaml
│ ├── prod
│ │ ├── deprecations.yaml
│ │ ├── doctrine.yaml
│ │ ├── monolog.yaml
│ │ └── routing.yaml
│ ├── sensio_framework_extra.yaml
│ ├── test
│ │ ├── framework.yaml
│ │ ├── monolog.yaml
│ │ └── twig.yaml
│ └── twig.yaml
├── routes.yaml
├── routes
│ └── annotations.yaml
├── routing_dev.yml
├── security.yml
└── services.yaml
├── data
└── code-changes
│ └── template
│ ├── 30_nav.html
│ ├── 31_nav.html
│ ├── 32_nav.html
│ ├── 33_nav.html
│ ├── overall_footer.html
│ └── overall_header.html
├── phpunit.xml.dist
├── src
├── .htaccess
├── Controller
│ ├── .gitignore
│ └── DefaultController.php
├── DependencyInjection
│ └── PhpbbArea51Extension.php
├── Entity
│ └── .gitignore
├── Kernel.php
├── Repository
│ └── .gitignore
├── TrackerChart.php
├── TrackerChartFactory.php
└── code-changes
│ ├── create_diffs.php
│ └── includes
│ ├── diff.php
│ ├── engine.php
│ └── renderer.php
├── symfony.lock
├── templates
├── base.html.twig
├── default
│ ├── contributors.html.twig
│ ├── contributorsList.html.twig
│ ├── downloads.html.twig
│ ├── index.html.twig
│ ├── projects.html.twig
│ └── stats.html.twig
└── layout.html.twig
├── tests
├── Controller
│ └── DefaultControllerTest.php
└── bootstrap.php
└── web
├── .htaccess
├── analytics.js
├── area51.css
├── code-changes
├── css
│ ├── admin.css
│ ├── code_changes.css
│ ├── code_changes.js
│ └── images
│ │ ├── arrow_right.gif
│ │ ├── bg_tabs1.gif
│ │ ├── bg_tabs2.gif
│ │ ├── corners_left.gif
│ │ ├── corners_right.gif
│ │ ├── file-A.png
│ │ ├── file-D.png
│ │ ├── file-M.png
│ │ ├── file.png
│ │ ├── folder-A.png
│ │ ├── folder-D.png
│ │ ├── folder-M.png
│ │ ├── folder-closed-A.png
│ │ ├── folder-closed-D.png
│ │ ├── folder-closed-M.png
│ │ ├── folder-closed.png
│ │ ├── folder.png
│ │ ├── innerbox_bg.gif
│ │ ├── toggle.gif
│ │ ├── treeview-default-line.gif
│ │ └── treeview-default.gif
└── index.php
├── config.php
├── favicon.ico
├── header.css
├── images
├── api.png
├── area51.png
├── back_phpbb.png
├── ci.png
├── code-changes.png
├── coding-style.png
├── development-discussion.png
├── github.png
├── header_bg.png
├── mainlogo.png
├── phpbb_small.png
├── sflogo.png
├── symfony.png
└── tracker.png
├── index.php
├── phpBB
├── robots.txt
├── subSilver.css
└── writable
└── stats
└── .keep
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for standardising the coding style between different editors
2 | # http://editorconfig.org/
3 |
4 | root = true
5 |
6 | [*]
7 | end_of_line = lf
8 | indent_size = 4
9 | indent_style = spaces
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
13 | [*.md]
14 | trim_trailing_whitespace = false
15 |
16 | [*.yml]
17 | indent_size = 4
18 | indent_style = space
19 |
--------------------------------------------------------------------------------
/.env:
--------------------------------------------------------------------------------
1 | # In all environments, the following files are loaded if they exist,
2 | # the latter taking precedence over the former:
3 | #
4 | # * .env contains default values for the environment variables needed by the app
5 | # * .env.local uncommitted file with local overrides
6 | # * .env.$APP_ENV committed environment-specific defaults
7 | # * .env.$APP_ENV.local uncommitted environment-specific overrides
8 | #
9 | # Real environment variables win over .env files.
10 | #
11 | # DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12 | # https://symfony.com/doc/current/configuration/secrets.html
13 | #
14 | # Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15 | # https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16 |
17 | ###> doctrine/doctrine-bundle ###
18 | # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
19 | # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
20 | #
21 | # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
22 | # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/db_name?serverVersion=8"
23 | tracker_chart_root_path="./"
24 | DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/db_name?serverVersion=15&charset=utf8"
25 | ###< doctrine/doctrine-bundle ###
26 | ###> symfony/framework-bundle ###
27 | APP_ENV=dev
28 | APP_SECRET=b4fa2a1d061b78975eea395d6f6a9ca5
29 | #TRUSTED_PROXIES=127.0.0.1,127.0.0.2
30 | #TRUSTED_HOSTS='^(localhost|example\.com)$'
31 | ###< symfony/framework-bundle ###
32 |
--------------------------------------------------------------------------------
/.env.test:
--------------------------------------------------------------------------------
1 | # define your env variables for the test env here
2 | KERNEL_CLASS='App\Kernel'
3 | APP_SECRET='$ecretf0rt3st'
4 | SYMFONY_DEPRECATIONS_HELPER=999999
5 | PANTHER_APP_ENV=panther
6 | PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
7 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Test Area51
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | pull_request:
8 | branches:
9 | - master
10 |
11 | jobs:
12 | test-area51:
13 | strategy:
14 | matrix:
15 | include:
16 | - php: '8.1'
17 | - php: '8.2'
18 | - php: '8.3'
19 |
20 | name: Test Area51 - ${{ matrix.php }}
21 | runs-on: ubuntu-latest
22 | steps:
23 | - name: Checkout repository
24 | uses: actions/checkout@v3
25 | with:
26 | fetch-depth: 100
27 |
28 | - name: Setup PHP
29 | uses: shivammathur/setup-php@v2
30 | with:
31 | php-version: ${{ matrix.php }}
32 | extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv
33 | coverage: none
34 |
35 | - name: Setup environment for dev-hooks
36 | env:
37 | PHP_VERSION: ${{ matrix.php }}
38 | run: |
39 | php composer.phar install --no-interaction
40 |
41 | - name: Run unit tests
42 | run: |
43 | php bin/phpunit --verbose --stop-on-error
44 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | app/cache
2 | data/code-changes/*
3 | web/code-changes/*
4 | web/writable/stats/*
5 | web/phpBB/*
6 | vendor
7 | *.cache
8 | *.log
9 | bin/doctrine*
10 | app/config/parameters.yml
11 | /.idea/
12 |
13 | ###> phpunit/phpunit ###
14 | /phpunit.xml
15 | .phpunit.result.cache
16 | ###< phpunit/phpunit ###
17 |
18 | ###> symfony/framework-bundle ###
19 | /.env.local
20 | /.env.local.php
21 | /.env.*.local
22 | /public/bundles/
23 | /var/
24 | /vendor/
25 | ###< symfony/framework-bundle ###
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Area51
2 |
3 | [Area51](http://area51.phpbb.com) is the development site of phpBB.
4 |
5 | ## About
6 |
7 | This repository contains the source code for the area51 website. It is
8 | based on Symfony2.
9 |
10 | ## Installation
11 |
12 | First of all, install the dependencies.
13 |
14 | $ php composer.phar install
15 |
16 | Copy `app/config/parameters.dist.yml` to `app/config/parameters.yml`
17 | and adjust the configuration.
18 |
19 | Point your webroot to `/web`.
20 |
21 | ## Tests
22 |
23 | To run tests, after installing dependencies, run the following from
24 | the project root
25 |
26 | $ bin/phpunit -c app/
27 |
28 | ## License
29 |
30 | See `LICENSE`.
31 |
--------------------------------------------------------------------------------
/app/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/app/AppCache.php:
--------------------------------------------------------------------------------
1 | getEnvironment(), array('dev', 'test'))) {
26 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
27 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
28 | $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
29 | }
30 |
31 | return $bundles;
32 | }
33 |
34 | public function registerContainerConfiguration(LoaderInterface $loader)
35 | {
36 | $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
37 | }
38 |
39 | public function getRootDir()
40 | {
41 | return __DIR__;
42 | }
43 | public function getCacheDir()
44 | {
45 | return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
46 | }
47 | public function getLogDir()
48 | {
49 | return dirname(__DIR__).'/var/logs';
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/autoload.php:
--------------------------------------------------------------------------------
1 | add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
12 | }
13 |
14 | AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
15 |
16 | return $loader;
--------------------------------------------------------------------------------
/app/check.php:
--------------------------------------------------------------------------------
1 | getPhpIniConfigPath();
8 |
9 | echo_title('Symfony Requirements Checker');
10 |
11 | echo '> PHP is using the following php.ini file:'.PHP_EOL;
12 | if ($iniPath) {
13 | echo_style('green', ' '.$iniPath);
14 | } else {
15 | echo_style('yellow', ' WARNING: No configuration file (php.ini) used by PHP!');
16 | }
17 |
18 | echo PHP_EOL.PHP_EOL;
19 |
20 | echo '> Checking Symfony requirements:'.PHP_EOL.' ';
21 |
22 | $messages = array();
23 | foreach ($symfonyRequirements->getRequirements() as $req) {
24 | if ($helpText = get_error_message($req, $lineSize)) {
25 | echo_style('red', 'E');
26 | $messages['error'][] = $helpText;
27 | } else {
28 | echo_style('green', '.');
29 | }
30 | }
31 |
32 | $checkPassed = empty($messages['error']);
33 |
34 | foreach ($symfonyRequirements->getRecommendations() as $req) {
35 | if ($helpText = get_error_message($req, $lineSize)) {
36 | echo_style('yellow', 'W');
37 | $messages['warning'][] = $helpText;
38 | } else {
39 | echo_style('green', '.');
40 | }
41 | }
42 |
43 | if ($checkPassed) {
44 | echo_block('success', 'OK', 'Your system is ready to run Symfony projects');
45 | } else {
46 | echo_block('error', 'ERROR', 'Your system is not ready to run Symfony projects');
47 |
48 | echo_title('Fix the following mandatory requirements', 'red');
49 |
50 | foreach ($messages['error'] as $helpText) {
51 | echo ' * '.$helpText.PHP_EOL;
52 | }
53 | }
54 |
55 | if (!empty($messages['warning'])) {
56 | echo_title('Optional recommendations to improve your setup', 'yellow');
57 |
58 | foreach ($messages['warning'] as $helpText) {
59 | echo ' * '.$helpText.PHP_EOL;
60 | }
61 | }
62 |
63 | echo PHP_EOL;
64 | echo_style('title', 'Note');
65 | echo ' The command console could use a different php.ini file'.PHP_EOL;
66 | echo_style('title', '~~~~');
67 | echo ' than the one used with your web server. To be on the'.PHP_EOL;
68 | echo ' safe side, please check the requirements from your web'.PHP_EOL;
69 | echo ' server using the ';
70 | echo_style('yellow', 'web/config.php');
71 | echo ' script.'.PHP_EOL;
72 | echo PHP_EOL;
73 |
74 | exit($checkPassed ? 0 : 1);
75 |
76 | function get_error_message(Requirement $requirement, $lineSize)
77 | {
78 | if ($requirement->isFulfilled()) {
79 | return;
80 | }
81 |
82 | $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
83 | $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;
84 |
85 | return $errorMessage;
86 | }
87 |
88 | function echo_title($title, $style = null)
89 | {
90 | $style = $style ?: 'title';
91 |
92 | echo PHP_EOL;
93 | echo_style($style, $title.PHP_EOL);
94 | echo_style($style, str_repeat('~', strlen($title)).PHP_EOL);
95 | echo PHP_EOL;
96 | }
97 |
98 | function echo_style($style, $message)
99 | {
100 | // ANSI color codes
101 | $styles = array(
102 | 'reset' => "\033[0m",
103 | 'red' => "\033[31m",
104 | 'green' => "\033[32m",
105 | 'yellow' => "\033[33m",
106 | 'error' => "\033[37;41m",
107 | 'success' => "\033[37;42m",
108 | 'title' => "\033[34m",
109 | );
110 | $supports = has_color_support();
111 |
112 | echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
113 | }
114 |
115 | function echo_block($style, $title, $message)
116 | {
117 | $message = ' '.trim($message).' ';
118 | $width = strlen($message);
119 |
120 | echo PHP_EOL.PHP_EOL;
121 |
122 | echo_style($style, str_repeat(' ', $width));
123 | echo PHP_EOL;
124 | echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT));
125 | echo PHP_EOL;
126 | echo_style($style, $message);
127 | echo PHP_EOL;
128 | echo_style($style, str_repeat(' ', $width));
129 | echo PHP_EOL;
130 | }
131 |
132 | function has_color_support()
133 | {
134 | static $support;
135 |
136 | if (null === $support) {
137 | if (DIRECTORY_SEPARATOR == '\\') {
138 | $support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
139 | } else {
140 | $support = function_exists('posix_isatty') && @posix_isatty(STDOUT);
141 | }
142 | }
143 |
144 | return $support;
145 | }
146 |
--------------------------------------------------------------------------------
/app/console:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
19 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
20 |
21 | $kernel = new AppKernel($env, $debug);
22 | $application = new Application($kernel);
23 | $application->run($input);
--------------------------------------------------------------------------------
/app/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
17 |
18 | ../src/*/*Bundle/Tests
19 | ../src/*/Bundle/*Bundle/Tests
20 |
21 |
22 |
23 |
28 |
29 |
30 |
31 | ../src
32 |
33 | ../src/*/*Bundle/Resources
34 | ../src/*/*Bundle/Tests
35 | ../src/*/Bundle/*Bundle/Resources
36 | ../src/*/Bundle/*Bundle/Tests
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/bin/.htaccess:
--------------------------------------------------------------------------------
1 | deny from all
--------------------------------------------------------------------------------
/bin/build_code_changes_30.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | mode="side-by-side"
3 | basedir=`cd $(dirname "$BASH_SOURCE"); cd ..; pwd`
4 | outdir=`cd "$basedir"; cd ./web/code-changes/; pwd`
5 | datadir=`cd "$basedir"; cd ./data/code-changes/; pwd`
6 | latest="3.0.14"
7 | releases="3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.7-PL1 3.0.8 3.0.9 3.0.10 3.0.11 3.0.12 3.0.13 3.0.13-PL1"
8 |
9 | # Set up the file structure
10 | if [ ! -d "$datadir/repo" ];
11 | then
12 | mkdir "$datadir"/repo
13 | fi
14 |
15 | if [ ! -d "$datadir/versions" ];
16 | then
17 | mkdir "$datadir"/versions
18 | fi
19 |
20 | # Clone the repository
21 | if [ ! -d "$datadir/repo/phpBB" ];
22 | then
23 | git clone git@github.com:phpbb/phpbb.git "$datadir"/repo
24 | code=$?
25 | if [ $code -ne 0 ];
26 | then
27 | exit $code
28 | fi
29 | fi
30 |
31 | # Update the repository
32 | cd "$datadir"/repo
33 | rm -f log.txt # Clean up interrupted runs
34 |
35 | git fetch --quiet
36 | git reset --quiet --hard HEAD
37 |
38 | # Grab the latest version
39 | if [ ! -d "$datadir/versions/$latest" ];
40 | then
41 | echo "Checking out latest version"
42 | git checkout release-$latest --quiet
43 | mkdir "$datadir"/versions/$latest
44 | cp -R phpBB/. "$datadir"/versions/$latest
45 | fi
46 |
47 | # Copy the older release files
48 | for tag in $releases
49 | do
50 | if [ ! -d "$datadir/versions/$tag" ];
51 | then
52 | echo "Checking out $tag"
53 | git checkout release-$tag --quiet
54 | mkdir "$datadir"/versions/$tag
55 | cp -R phpBB/. "$datadir"/versions/$tag
56 | fi
57 | done
58 |
59 | # Generate the code changes
60 | for tag in $releases
61 | do
62 | echo "Building code changes for $tag-$latest"
63 | if [ ! -d "$outdir/$tag/$mode/$latest" ];
64 | then
65 | mkdir -p "$outdir"/$tag/$mode/$latest
66 | fi
67 |
68 | git diff --name-status release-$tag release-$latest > "$datadir"/log.txt
69 | php "$basedir"/src/code-changes/create_diffs.php "$outdir" "$datadir" $tag $latest side-by-side "$datadir"/log.txt
70 | rm -f "$datadir"/log.txt
71 | done
72 |
73 | echo "Done"
74 |
--------------------------------------------------------------------------------
/bin/build_code_changes_31.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | mode="side-by-side"
3 | basedir=`cd $(dirname "$BASH_SOURCE"); cd ..; pwd`
4 | outdir=`cd "$basedir"; cd ./web/code-changes/; pwd`
5 | datadir=`cd "$basedir"; cd ./data/code-changes/; pwd`
6 | latest="3.1.12"
7 | releases="3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.7-pl1 3.1.8 3.1.9 3.1.10 3.1.11"
8 |
9 | # Set up the file structure
10 | if [ ! -d "$datadir/repo" ];
11 | then
12 | mkdir "$datadir"/repo
13 | fi
14 |
15 | if [ ! -d "$datadir/versions" ];
16 | then
17 | mkdir "$datadir"/versions
18 | fi
19 |
20 | # Clone the repository
21 | if [ ! -d "$datadir/repo/phpBB" ];
22 | then
23 | git clone git@github.com:phpbb/phpbb.git "$datadir"/repo
24 | code=$?
25 | if [ $code -ne 0 ];
26 | then
27 | exit $code
28 | fi
29 | fi
30 |
31 | # Update the repository
32 | cd "$datadir"/repo
33 | rm -f log.txt # Clean up interrupted runs
34 |
35 | git fetch --quiet
36 | git reset --quiet --hard HEAD
37 |
38 | # Grab the latest version
39 | if [ ! -d "$datadir/versions/$latest" ];
40 | then
41 | echo "Checking out latest version"
42 | git checkout release-$latest --quiet
43 | mkdir "$datadir"/versions/$latest
44 | cp -R phpBB/. "$datadir"/versions/$latest
45 | fi
46 |
47 | # Copy the older release files
48 | for tag in $releases
49 | do
50 | if [ ! -d "$datadir/versions/$tag" ];
51 | then
52 | echo "Checking out $tag"
53 | git checkout release-$tag --quiet
54 | mkdir "$datadir"/versions/$tag
55 | cp -R phpBB/. "$datadir"/versions/$tag
56 | fi
57 | done
58 |
59 | # Generate the code changes
60 | for tag in $releases
61 | do
62 | echo "Building code changes for $tag-$latest"
63 | if [ ! -d "$outdir/$tag/$mode/$latest" ];
64 | then
65 | mkdir -p "$outdir"/$tag/$mode/$latest
66 | fi
67 |
68 | git diff --name-status release-$tag release-$latest > "$datadir"/log.txt
69 | php "$basedir"/src/code-changes/create_diffs.php "$outdir" "$datadir" $tag $latest side-by-side "$datadir"/log.txt
70 | rm -f "$datadir"/log.txt
71 | done
72 |
73 | echo "Done"
74 |
--------------------------------------------------------------------------------
/bin/build_code_changes_32.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | mode="side-by-side"
3 | basedir=`cd $(dirname "$BASH_SOURCE"); cd ..; pwd`
4 | outdir=`cd "$basedir"; cd ./web/code-changes/; pwd`
5 | datadir=`cd "$basedir"; cd ./data/code-changes/; pwd`
6 | latest="3.2.11"
7 | releases="3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.2.10"
8 |
9 | # Set up the file structure
10 | if [ ! -d "$datadir/repo" ];
11 | then
12 | mkdir "$datadir"/repo
13 | fi
14 |
15 | if [ ! -d "$datadir/versions" ];
16 | then
17 | mkdir "$datadir"/versions
18 | fi
19 |
20 | # Clone the repository
21 | if [ ! -d "$datadir/repo/phpBB" ];
22 | then
23 | git clone git@github.com:phpbb/phpbb.git "$datadir"/repo
24 | code=$?
25 | if [ $code -ne 0 ];
26 | then
27 | exit $code
28 | fi
29 | fi
30 |
31 | # Update the repository
32 | cd "$datadir"/repo
33 | rm -f log.txt # Clean up interrupted runs
34 |
35 | git fetch --quiet
36 | git reset --quiet --hard HEAD
37 |
38 | # Grab the latest version
39 | if [ ! -d "$datadir/versions/$latest" ];
40 | then
41 | echo "Checking out latest version"
42 | git checkout release-$latest --quiet
43 | mkdir "$datadir"/versions/$latest
44 | cp -R phpBB/. "$datadir"/versions/$latest
45 | fi
46 |
47 | # Copy the older release files
48 | for tag in $releases
49 | do
50 | if [ ! -d "$datadir/versions/$tag" ];
51 | then
52 | echo "Checking out $tag"
53 | git checkout release-$tag --quiet
54 | mkdir "$datadir"/versions/$tag
55 | cp -R phpBB/. "$datadir"/versions/$tag
56 | fi
57 | done
58 |
59 | # Generate the code changes
60 | for tag in $releases
61 | do
62 | echo "Building code changes for $tag-$latest"
63 | if [ ! -d "$outdir/$tag/$mode/$latest" ];
64 | then
65 | mkdir -p "$outdir"/$tag/$mode/$latest
66 | fi
67 |
68 | git diff --name-status release-$tag release-$latest > "$datadir"/log.txt
69 | php "$basedir"/src/code-changes/create_diffs.php "$outdir" "$datadir" $tag $latest side-by-side "$datadir"/log.txt
70 | rm -f "$datadir"/log.txt
71 | done
72 |
73 | echo "Done"
74 |
--------------------------------------------------------------------------------
/bin/build_code_changes_33.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | mode="side-by-side"
3 | basedir=`cd $(dirname "$BASH_SOURCE"); cd ..; pwd`
4 | outdir=`cd "$basedir"; cd ./web/code-changes/; pwd`
5 | datadir=`cd "$basedir"; cd ./data/code-changes/; pwd`
6 | latest="3.3.15"
7 | releases="3.3.0-b1 3.3.0-b2 3.3.0-RC1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14"
8 |
9 | # Set up the file structure
10 | if [ ! -d "$datadir/repo" ];
11 | then
12 | mkdir "$datadir"/repo
13 | fi
14 |
15 | if [ ! -d "$datadir/versions" ];
16 | then
17 | mkdir "$datadir"/versions
18 | fi
19 |
20 | # Clone the repository
21 | if [ ! -d "$datadir/repo/phpBB" ];
22 | then
23 | git clone git@github.com:phpbb/phpbb.git "$datadir"/repo
24 | code=$?
25 | if [ $code -ne 0 ];
26 | then
27 | exit $code
28 | fi
29 | fi
30 |
31 | # Update the repository
32 | cd "$datadir"/repo
33 | rm -f log.txt # Clean up interrupted runs
34 |
35 | git fetch --quiet
36 | git reset --quiet --hard HEAD
37 |
38 | # Grab the latest version
39 | if [ ! -d "$datadir/versions/$latest" ];
40 | then
41 | echo "Checking out latest version"
42 | git checkout release-$latest --quiet
43 | mkdir "$datadir"/versions/$latest
44 | cp -R phpBB/. "$datadir"/versions/$latest
45 | fi
46 |
47 | # Copy the older release files
48 | for tag in $releases
49 | do
50 | if [ ! -d "$datadir/versions/$tag" ];
51 | then
52 | echo "Checking out $tag"
53 | git checkout release-$tag --quiet
54 | mkdir "$datadir"/versions/$tag
55 | cp -R phpBB/. "$datadir"/versions/$tag
56 | fi
57 | done
58 |
59 | # Generate the code changes
60 | for tag in $releases
61 | do
62 | echo "Building code changes for $tag-$latest"
63 | if [ ! -d "$outdir/$tag/$mode/$latest" ];
64 | then
65 | mkdir -p "$outdir"/$tag/$mode/$latest
66 | fi
67 |
68 | git diff --name-status release-$tag release-$latest > "$datadir"/log.txt
69 | php "$basedir"/src/code-changes/create_diffs.php "$outdir" "$datadir" $tag $latest side-by-side "$datadir"/log.txt
70 | rm -f "$datadir"/log.txt
71 | done
72 |
73 | echo "Done"
74 |
--------------------------------------------------------------------------------
/bin/build_docs.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | exec {BASH_XTRACEFD}>&1
3 | set -ex
4 |
5 | ROOT=`cd $(dirname "$BASH_SOURCE"); cd ..; pwd`
6 | DOCS="$ROOT/web/docs"
7 | PHPBBREPO="$ROOT/docs-phpbb"
8 | DOCREPO="$ROOT/documentation"
9 |
10 | # $1 local directory
11 | # $2 repo URL
12 | # $3 reference repository
13 | update_repo()
14 | {
15 | if [ -d "$1" ]
16 | then
17 | cd "$1"
18 | git remote update
19 | else
20 | if [ -d "$3/.git" ]
21 | then
22 | CLONEARGS="--reference $3"
23 | else
24 | CLONEARGS=""
25 | fi
26 |
27 | git clone "$2" "$1" $CLONEARGS
28 | cd "$1"
29 | git config branch.autosetuprebase always
30 | fi
31 | }
32 |
33 | # $1 repository directory
34 | # $2 branch name
35 | # $3 target directory
36 | copy_phpbb_docs()
37 | {
38 | cd $1
39 | mkdir -p "$3"
40 | git checkout --force "$2"
41 | git reset --hard "origin/$2"
42 | rsync -a --delete 'phpBB/docs/' "$3"
43 | }
44 |
45 | # $1 repository directory
46 | # $2 branch name
47 | update_sphinx_docs()
48 | {
49 | cd $1
50 | git checkout --force "$2"
51 | git reset --hard "origin/$2"
52 | }
53 |
54 | update_repo "$PHPBBREPO" 'https://github.com/phpbb/phpbb.git' "$ROOT/area51-phpbb3"
55 | update_repo "$DOCREPO" 'https://github.com/phpbb/documentation.git'
56 |
57 | update_sphinx_docs $DOCREPO "3.2.x"
58 | update_sphinx_docs $DOCREPO "3.3.x"
59 | update_sphinx_docs $DOCREPO "master"
60 |
61 | # Copy phpBB docs directory
62 | copy_phpbb_docs $PHPBBREPO "3.0.x" "$DOCS/30x/"
63 | copy_phpbb_docs $PHPBBREPO "3.1.x" "$DOCS/31x/"
64 | copy_phpbb_docs $PHPBBREPO "3.2.x" "$DOCS/32x/"
65 | copy_phpbb_docs $PHPBBREPO "3.3.x" "$DOCS/33x/"
66 | copy_phpbb_docs $PHPBBREPO "master" "$DOCS/master/"
67 |
68 | cd $DOCREPO
69 | # Create documentation and copy master to main directory.
70 | # Sphinx-multiversion does no longer create a copy of the master version
71 | # in the main directory so we have to redirect people with an index.html
72 | /usr/local/bin/sphinx-multiversion development "$DOCS/dev/"
73 | cp development/_templates/index.html "$DOCS/dev/"
74 |
75 | # Generate API documentation for 3.3.x and master
76 | cd $PHPBBREPO
77 | git checkout 3.3.x
78 | cd phpBB
79 | ../composer.phar install
80 | cd ../build
81 | ../phpBB/vendor/bin/phing docs-all
82 | rsync -a --delete api/output/ "$DOCS/code/"
83 |
--------------------------------------------------------------------------------
/bin/console:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | getParameterOption(['--env', '-e'], null, true)) {
23 | putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
24 | }
25 |
26 | if ($input->hasParameterOption('--no-debug', true)) {
27 | putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
28 | }
29 |
30 | require dirname(__DIR__).'/config/bootstrap.php';
31 |
32 | if ($_SERVER['APP_DEBUG']) {
33 | umask(0000);
34 |
35 | if (class_exists(Debug::class)) {
36 | Debug::enable();
37 | }
38 | }
39 |
40 | $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
41 | $application = new Application($kernel);
42 | $application->run($input);
43 |
--------------------------------------------------------------------------------
/bin/patch-type-declarations:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | realpath = realpath($opened_path) ?: $opened_path;
34 | $opened_path = $this->realpath;
35 | $this->handle = fopen($this->realpath, $mode);
36 | $this->position = 0;
37 |
38 | return (bool) $this->handle;
39 | }
40 |
41 | public function stream_read($count)
42 | {
43 | $data = fread($this->handle, $count);
44 |
45 | if ($this->position === 0) {
46 | $data = preg_replace('{^#!.*\r?\n}', '', $data);
47 | }
48 |
49 | $this->position += strlen($data);
50 |
51 | return $data;
52 | }
53 |
54 | public function stream_cast($castAs)
55 | {
56 | return $this->handle;
57 | }
58 |
59 | public function stream_close()
60 | {
61 | fclose($this->handle);
62 | }
63 |
64 | public function stream_lock($operation)
65 | {
66 | return $operation ? flock($this->handle, $operation) : true;
67 | }
68 |
69 | public function stream_seek($offset, $whence)
70 | {
71 | if (0 === fseek($this->handle, $offset, $whence)) {
72 | $this->position = ftell($this->handle);
73 | return true;
74 | }
75 |
76 | return false;
77 | }
78 |
79 | public function stream_tell()
80 | {
81 | return $this->position;
82 | }
83 |
84 | public function stream_eof()
85 | {
86 | return feof($this->handle);
87 | }
88 |
89 | public function stream_stat()
90 | {
91 | return array();
92 | }
93 |
94 | public function stream_set_option($option, $arg1, $arg2)
95 | {
96 | return true;
97 | }
98 |
99 | public function url_stat($path, $flags)
100 | {
101 | $path = substr($path, 17);
102 | if (file_exists($path)) {
103 | return stat($path);
104 | }
105 |
106 | return false;
107 | }
108 | }
109 | }
110 |
111 | if (
112 | (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
113 | || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
114 | ) {
115 | return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/symfony/error-handler/Resources/bin/patch-type-declarations');
116 | }
117 | }
118 |
119 | return include __DIR__ . '/..'.'/vendor/symfony/error-handler/Resources/bin/patch-type-declarations';
120 |
--------------------------------------------------------------------------------
/bin/php-parse:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | realpath = realpath($opened_path) ?: $opened_path;
34 | $opened_path = $this->realpath;
35 | $this->handle = fopen($this->realpath, $mode);
36 | $this->position = 0;
37 |
38 | return (bool) $this->handle;
39 | }
40 |
41 | public function stream_read($count)
42 | {
43 | $data = fread($this->handle, $count);
44 |
45 | if ($this->position === 0) {
46 | $data = preg_replace('{^#!.*\r?\n}', '', $data);
47 | }
48 |
49 | $this->position += strlen($data);
50 |
51 | return $data;
52 | }
53 |
54 | public function stream_cast($castAs)
55 | {
56 | return $this->handle;
57 | }
58 |
59 | public function stream_close()
60 | {
61 | fclose($this->handle);
62 | }
63 |
64 | public function stream_lock($operation)
65 | {
66 | return $operation ? flock($this->handle, $operation) : true;
67 | }
68 |
69 | public function stream_seek($offset, $whence)
70 | {
71 | if (0 === fseek($this->handle, $offset, $whence)) {
72 | $this->position = ftell($this->handle);
73 | return true;
74 | }
75 |
76 | return false;
77 | }
78 |
79 | public function stream_tell()
80 | {
81 | return $this->position;
82 | }
83 |
84 | public function stream_eof()
85 | {
86 | return feof($this->handle);
87 | }
88 |
89 | public function stream_stat()
90 | {
91 | return array();
92 | }
93 |
94 | public function stream_set_option($option, $arg1, $arg2)
95 | {
96 | return true;
97 | }
98 |
99 | public function url_stat($path, $flags)
100 | {
101 | $path = substr($path, 17);
102 | if (file_exists($path)) {
103 | return stat($path);
104 | }
105 |
106 | return false;
107 | }
108 | }
109 | }
110 |
111 | if (
112 | (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
113 | || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
114 | ) {
115 | return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/nikic/php-parser/bin/php-parse');
116 | }
117 | }
118 |
119 | return include __DIR__ . '/..'.'/vendor/nikic/php-parser/bin/php-parse';
120 |
--------------------------------------------------------------------------------
/bin/phpunit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | realpath = realpath($opened_path) ?: $opened_path;
35 | $opened_path = 'phpvfscomposer://'.$this->realpath;
36 | $this->handle = fopen($this->realpath, $mode);
37 | $this->position = 0;
38 |
39 | return (bool) $this->handle;
40 | }
41 |
42 | public function stream_read($count)
43 | {
44 | $data = fread($this->handle, $count);
45 |
46 | if ($this->position === 0) {
47 | $data = preg_replace('{^#!.*\r?\n}', '', $data);
48 | }
49 | $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data);
50 | $data = str_replace('__FILE__', var_export($this->realpath, true), $data);
51 |
52 | $this->position += strlen($data);
53 |
54 | return $data;
55 | }
56 |
57 | public function stream_cast($castAs)
58 | {
59 | return $this->handle;
60 | }
61 |
62 | public function stream_close()
63 | {
64 | fclose($this->handle);
65 | }
66 |
67 | public function stream_lock($operation)
68 | {
69 | return $operation ? flock($this->handle, $operation) : true;
70 | }
71 |
72 | public function stream_seek($offset, $whence)
73 | {
74 | if (0 === fseek($this->handle, $offset, $whence)) {
75 | $this->position = ftell($this->handle);
76 | return true;
77 | }
78 |
79 | return false;
80 | }
81 |
82 | public function stream_tell()
83 | {
84 | return $this->position;
85 | }
86 |
87 | public function stream_eof()
88 | {
89 | return feof($this->handle);
90 | }
91 |
92 | public function stream_stat()
93 | {
94 | return array();
95 | }
96 |
97 | public function stream_set_option($option, $arg1, $arg2)
98 | {
99 | return true;
100 | }
101 |
102 | public function url_stat($path, $flags)
103 | {
104 | $path = substr($path, 17);
105 | if (file_exists($path)) {
106 | return stat($path);
107 | }
108 |
109 | return false;
110 | }
111 | }
112 | }
113 |
114 | if (
115 | (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
116 | || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
117 | ) {
118 | return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/phpunit/phpunit/phpunit');
119 | }
120 | }
121 |
122 | return include __DIR__ . '/..'.'/vendor/phpunit/phpunit/phpunit';
123 |
--------------------------------------------------------------------------------
/bin/sql-formatter:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | realpath = realpath($opened_path) ?: $opened_path;
34 | $opened_path = $this->realpath;
35 | $this->handle = fopen($this->realpath, $mode);
36 | $this->position = 0;
37 |
38 | return (bool) $this->handle;
39 | }
40 |
41 | public function stream_read($count)
42 | {
43 | $data = fread($this->handle, $count);
44 |
45 | if ($this->position === 0) {
46 | $data = preg_replace('{^#!.*\r?\n}', '', $data);
47 | }
48 |
49 | $this->position += strlen($data);
50 |
51 | return $data;
52 | }
53 |
54 | public function stream_cast($castAs)
55 | {
56 | return $this->handle;
57 | }
58 |
59 | public function stream_close()
60 | {
61 | fclose($this->handle);
62 | }
63 |
64 | public function stream_lock($operation)
65 | {
66 | return $operation ? flock($this->handle, $operation) : true;
67 | }
68 |
69 | public function stream_seek($offset, $whence)
70 | {
71 | if (0 === fseek($this->handle, $offset, $whence)) {
72 | $this->position = ftell($this->handle);
73 | return true;
74 | }
75 |
76 | return false;
77 | }
78 |
79 | public function stream_tell()
80 | {
81 | return $this->position;
82 | }
83 |
84 | public function stream_eof()
85 | {
86 | return feof($this->handle);
87 | }
88 |
89 | public function stream_stat()
90 | {
91 | return array();
92 | }
93 |
94 | public function stream_set_option($option, $arg1, $arg2)
95 | {
96 | return true;
97 | }
98 |
99 | public function url_stat($path, $flags)
100 | {
101 | $path = substr($path, 17);
102 | if (file_exists($path)) {
103 | return stat($path);
104 | }
105 |
106 | return false;
107 | }
108 | }
109 | }
110 |
111 | if (
112 | (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
113 | || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
114 | ) {
115 | return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/doctrine/sql-formatter/bin/sql-formatter');
116 | }
117 | }
118 |
119 | return include __DIR__ . '/..'.'/vendor/doctrine/sql-formatter/bin/sql-formatter';
120 |
--------------------------------------------------------------------------------
/bin/update_phpbb.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | exec {BASH_XTRACEFD}>&1
3 | set -e
4 |
5 | REMOTE=origin
6 | BRANCH=master
7 |
8 | HERE=$(dirname "$0")
9 | cd "$HERE/../area51-phpbb3/phpBB"
10 | git fetch "$REMOTE"
11 |
12 | if [ `git rev-parse "$BRANCH"` != `git rev-parse "$REMOTE/$BRANCH"` ]
13 | then
14 | git reset --hard "$REMOTE/$BRANCH"
15 | ../composer.phar install --no-dev --optimize-autoloader
16 | bin/phpbbcli.php --safe-mode db:migrate
17 | bin/phpbbcli.php --safe-mode cache:purge
18 | rm cache/production/*.{lock,php}
19 | rm -r cache/production/twig/
20 | fi
21 |
--------------------------------------------------------------------------------
/bin/update_symfony.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | exec {BASH_XTRACEFD}>&1
3 | set -e
4 |
5 | REMOTE=origin
6 | BRANCH=master
7 |
8 | HERE=$(dirname "$0")
9 | cd "$HERE/../"
10 | git fetch "$REMOTE"
11 |
12 | if [ `git rev-parse "$BRANCH"` != `git rev-parse "$REMOTE/$BRANCH"` ]
13 | then
14 | git reset --hard "$REMOTE/$BRANCH"
15 | ./composer.phar install --no-dev --optimize-autoloader
16 | bin/console cache:clear --env=prod
17 | bin/console cache:warmup --env=prod
18 | chmod -R 777 var/cache/*
19 | rm -rf var/cache/prod/
20 | mkdir var/cache/prod/
21 | chmod -R 777 var/cache/*
22 | fi
23 |
--------------------------------------------------------------------------------
/bin/var-dump-server:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | realpath = realpath($opened_path) ?: $opened_path;
34 | $opened_path = $this->realpath;
35 | $this->handle = fopen($this->realpath, $mode);
36 | $this->position = 0;
37 |
38 | return (bool) $this->handle;
39 | }
40 |
41 | public function stream_read($count)
42 | {
43 | $data = fread($this->handle, $count);
44 |
45 | if ($this->position === 0) {
46 | $data = preg_replace('{^#!.*\r?\n}', '', $data);
47 | }
48 |
49 | $this->position += strlen($data);
50 |
51 | return $data;
52 | }
53 |
54 | public function stream_cast($castAs)
55 | {
56 | return $this->handle;
57 | }
58 |
59 | public function stream_close()
60 | {
61 | fclose($this->handle);
62 | }
63 |
64 | public function stream_lock($operation)
65 | {
66 | return $operation ? flock($this->handle, $operation) : true;
67 | }
68 |
69 | public function stream_seek($offset, $whence)
70 | {
71 | if (0 === fseek($this->handle, $offset, $whence)) {
72 | $this->position = ftell($this->handle);
73 | return true;
74 | }
75 |
76 | return false;
77 | }
78 |
79 | public function stream_tell()
80 | {
81 | return $this->position;
82 | }
83 |
84 | public function stream_eof()
85 | {
86 | return feof($this->handle);
87 | }
88 |
89 | public function stream_stat()
90 | {
91 | return array();
92 | }
93 |
94 | public function stream_set_option($option, $arg1, $arg2)
95 | {
96 | return true;
97 | }
98 |
99 | public function url_stat($path, $flags)
100 | {
101 | $path = substr($path, 17);
102 | if (file_exists($path)) {
103 | return stat($path);
104 | }
105 |
106 | return false;
107 | }
108 | }
109 | }
110 |
111 | if (
112 | (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
113 | || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
114 | ) {
115 | return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/symfony/var-dumper/Resources/bin/var-dump-server');
116 | }
117 | }
118 |
119 | return include __DIR__ . '/..'.'/vendor/symfony/var-dumper/Resources/bin/var-dump-server';
120 |
--------------------------------------------------------------------------------
/bin/yaml-lint:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | realpath = realpath($opened_path) ?: $opened_path;
34 | $opened_path = $this->realpath;
35 | $this->handle = fopen($this->realpath, $mode);
36 | $this->position = 0;
37 |
38 | return (bool) $this->handle;
39 | }
40 |
41 | public function stream_read($count)
42 | {
43 | $data = fread($this->handle, $count);
44 |
45 | if ($this->position === 0) {
46 | $data = preg_replace('{^#!.*\r?\n}', '', $data);
47 | }
48 |
49 | $this->position += strlen($data);
50 |
51 | return $data;
52 | }
53 |
54 | public function stream_cast($castAs)
55 | {
56 | return $this->handle;
57 | }
58 |
59 | public function stream_close()
60 | {
61 | fclose($this->handle);
62 | }
63 |
64 | public function stream_lock($operation)
65 | {
66 | return $operation ? flock($this->handle, $operation) : true;
67 | }
68 |
69 | public function stream_seek($offset, $whence)
70 | {
71 | if (0 === fseek($this->handle, $offset, $whence)) {
72 | $this->position = ftell($this->handle);
73 | return true;
74 | }
75 |
76 | return false;
77 | }
78 |
79 | public function stream_tell()
80 | {
81 | return $this->position;
82 | }
83 |
84 | public function stream_eof()
85 | {
86 | return feof($this->handle);
87 | }
88 |
89 | public function stream_stat()
90 | {
91 | return array();
92 | }
93 |
94 | public function stream_set_option($option, $arg1, $arg2)
95 | {
96 | return true;
97 | }
98 |
99 | public function url_stat($path, $flags)
100 | {
101 | $path = substr($path, 17);
102 | if (file_exists($path)) {
103 | return stat($path);
104 | }
105 |
106 | return false;
107 | }
108 | }
109 | }
110 |
111 | if (
112 | (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
113 | || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
114 | ) {
115 | return include("phpvfscomposer://" . __DIR__ . '/..'.'/vendor/symfony/yaml/Resources/bin/yaml-lint');
116 | }
117 | }
118 |
119 | return include __DIR__ . '/..'.'/vendor/symfony/yaml/Resources/bin/yaml-lint';
120 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "phpbb/area51",
3 | "description": "phpBB's Area51 site",
4 | "autoload": {
5 | "psr-4": {
6 | "App\\": "src/"
7 | }
8 | },
9 | "require": {
10 | "doctrine/orm": "~2.2,>=2.2.3",
11 | "doctrine/doctrine-bundle": "^2.1",
12 | "php": "^8.1",
13 | "symfony/monolog-bundle": "~3.8",
14 | "symfony/flex": "^2.4",
15 | "symfony/framework-bundle": "^6.3",
16 | "symfony/twig-bundle": "^6.3",
17 | "twig/extra-bundle": "^2.12|^3.0",
18 | "twig/twig": "^2.12|^3.0",
19 | "symfony/yaml": "^6.3",
20 | "sensio/framework-extra-bundle": "^6.2",
21 | "symfony/asset": "^6.3",
22 | "symfony/dotenv": "^6.3"
23 | },
24 | "require-dev": {
25 | "phpunit/phpunit": "~9.6",
26 | "symfony/browser-kit": "^6.3",
27 | "symfony/css-selector": "^6.3"
28 | },
29 | "conflict": {
30 | "symfony/symfony": "*"
31 | },
32 | "config": {
33 | "bin-dir": "bin",
34 | "allow-plugins": {
35 | "symfony/flex": true
36 | }
37 | },
38 | "extra": {
39 | "extra": {
40 | "public-dir": "web",
41 | "symfony-var-dir": "var",
42 | "symfony-bin-dir": "bin",
43 | "symfony-assets-install": "relative"
44 | }
45 | },
46 | "minimum-stability": "stable",
47 | "scripts": {
48 | "auto-scripts": {
49 | "cache:clear": "symfony-cmd",
50 | "assets:install %PUBLIC_DIR%": "symfony-cmd"
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/composer.phar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phpbb/area51/543dc09c88d7f6adbbae32a470dc4a0f3eb4f122/composer.phar
--------------------------------------------------------------------------------
/config/bootstrap.php:
--------------------------------------------------------------------------------
1 | =1.2)
13 | if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {
14 | (new Dotenv(false))->populate($env);
15 | } else {
16 | // load all the .env files
17 | (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
18 | }
19 |
20 | $_SERVER += $_ENV;
21 | $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
22 | $_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
23 | $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
24 |
--------------------------------------------------------------------------------
/config/bundles.php:
--------------------------------------------------------------------------------
1 | ['all' => true],
5 | Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
6 | Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
7 | Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
8 | Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
9 | Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
10 | ];
11 |
--------------------------------------------------------------------------------
/config/config.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: parameters.yml }
3 | # - { resource: security.yml }
4 |
5 | framework:
6 | secret: "%secret%"
7 | router: { resource: "%kernel.root_dir%/config/routing.yml" }
8 | form: true
9 | csrf_protection: true
10 | validation: { enable_annotations: true }
11 | templating:
12 | engines: ['twig']
13 | assets:
14 | version: 111020132212
15 | version_format: "%%s?v%%s"
16 | session: ~
17 | esi: { enabled: true }
18 |
19 | # Twig Configuration
20 | twig:
21 | debug: "%kernel.debug%"
22 | strict_variables: "%kernel.debug%"
23 |
24 | # Assetic Configuration
25 | assetic:
26 | debug: "%kernel.debug%"
27 | use_controller: false
28 | filters:
29 | cssrewrite: ~
30 | # closure:
31 | # jar: %kernel.root_dir%/java/compiler.jar
32 | # yui_css:
33 | # jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar
34 |
35 | # Doctrine Configuration
36 | # doctrine:
37 | # dbal:
38 | # driver: %database_driver%
39 | # host: %database_host%
40 | # dbname: %database_name%
41 | # user: %database_user%
42 | # password: %database_password%
43 | # charset: UTF8
44 |
45 | # orm:
46 | # auto_generate_proxy_classes: %kernel.debug%
47 | # auto_mapping: true
48 |
49 | # Swiftmailer Configuration
50 | # swiftmailer:
51 | # transport: %mailer_transport%
52 | # host: %mailer_host%
53 | # username: %mailer_user%
54 | # password: %mailer_password%
55 |
56 | # jms_security_extra:
57 | # secure_controllers: true
58 | # secure_all_services: false
59 |
60 | sensio_framework_extra:
61 | cache: { annotations: true }
62 |
63 | services:
64 | tracker_chart_factory:
65 | class: App\TrackerChartFactory
66 | arguments: ["%tracker_chart.root_path%"]
67 |
--------------------------------------------------------------------------------
/config/config_dev.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config.yml }
3 |
4 | framework:
5 | router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
6 | profiler: { only_exceptions: false }
7 |
8 | web_profiler:
9 | toolbar: true
10 | intercept_redirects: false
11 |
12 | monolog:
13 | handlers:
14 | main:
15 | type: stream
16 | path: "%kernel.logs_dir%/%kernel.environment%.log"
17 | level: debug
18 | firephp:
19 | type: firephp
20 | level: info
21 |
22 | assetic:
23 | use_controller: true
24 |
--------------------------------------------------------------------------------
/config/config_prod.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config.yml }
3 |
4 | #doctrine:
5 | # metadata_cache_driver: apc
6 | # result_cache_driver: apc
7 | # query_cache_driver: apc
8 |
9 | monolog:
10 | handlers:
11 | main:
12 | type: fingers_crossed
13 | action_level: error
14 | handler: nested
15 | nested:
16 | type: stream
17 | path: %kernel.logs_dir%/%kernel.environment%.log
18 | level: debug
19 |
--------------------------------------------------------------------------------
/config/config_test.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config_dev.yml }
3 |
4 | framework:
5 | test: ~
6 | session:
7 | storage_id: session.storage.mock_file
8 |
9 | web_profiler:
10 | toolbar: false
11 | intercept_redirects: false
12 |
--------------------------------------------------------------------------------
/config/packages/cache.yaml:
--------------------------------------------------------------------------------
1 | framework:
2 | cache:
3 | # Unique name of your app: used to compute stable namespaces for cache keys.
4 | #prefix_seed: your_vendor_name/app_name
5 |
6 | # The "app" cache stores to the filesystem by default.
7 | # The data in this cache should persist between deploys.
8 | # Other options include:
9 |
10 | # Redis
11 | #app: cache.adapter.redis
12 | #default_redis_provider: redis://localhost
13 |
14 | # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
15 | #app: cache.adapter.apcu
16 |
17 | # Namespaced pools use the above "app" backend by default
18 | #pools:
19 | #my.dedicated.cache: null
20 |
--------------------------------------------------------------------------------
/config/packages/dev/monolog.yaml:
--------------------------------------------------------------------------------
1 | monolog:
2 | handlers:
3 | main:
4 | type: stream
5 | path: "%kernel.logs_dir%/%kernel.environment%.log"
6 | level: debug
7 | channels: ["!event"]
8 | # uncomment to get logging in your browser
9 | # you may have to allow bigger header sizes in your Web server configuration
10 | #firephp:
11 | # type: firephp
12 | # level: info
13 | #chromephp:
14 | # type: chromephp
15 | # level: info
16 | console:
17 | type: console
18 | process_psr_3_messages: false
19 | channels: ["!event", "!doctrine", "!console"]
20 |
--------------------------------------------------------------------------------
/config/packages/doctrine.yaml:
--------------------------------------------------------------------------------
1 | doctrine:
2 | dbal:
3 | url: '%env(resolve:DATABASE_URL)%'
4 |
5 | # IMPORTANT: You MUST configure your server version,
6 | # either here or in the DATABASE_URL env var (see .env file)
7 | #server_version: '15'
8 |
9 | # only needed for MySQL
10 | charset: utf8mb4
11 | default_table_options:
12 | collate: utf8mb4_unicode_ci
13 |
14 | # backtrace queries in profiler (increases memory usage per request)
15 | #profiling_collect_backtrace: '%kernel.debug%'
16 | orm:
17 | auto_generate_proxy_classes: true
18 | naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
19 | auto_mapping: true
20 | mappings:
21 | App:
22 | is_bundle: false
23 | type: annotation
24 | dir: '%kernel.project_dir%/src/Entity'
25 | prefix: 'App\Entity'
26 | alias: App
27 |
--------------------------------------------------------------------------------
/config/packages/framework.yaml:
--------------------------------------------------------------------------------
1 | framework:
2 | secret: '%env(APP_SECRET)%'
3 | #csrf_protection: true
4 | #http_method_override: true
5 |
6 | # Enables session support. Note that the session will ONLY be started if you read or write from it.
7 | # Remove or comment this section to explicitly disable session support.
8 | session:
9 | handler_id: null
10 | cookie_samesite: lax
11 |
12 | #esi: true
13 | #fragments: true
14 | php_errors:
15 | log: true
16 |
--------------------------------------------------------------------------------
/config/packages/prod/deprecations.yaml:
--------------------------------------------------------------------------------
1 | # As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
2 | #monolog:
3 | # channels: [deprecation]
4 | # handlers:
5 | # deprecation:
6 | # type: stream
7 | # channels: [deprecation]
8 | # path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
9 |
--------------------------------------------------------------------------------
/config/packages/prod/doctrine.yaml:
--------------------------------------------------------------------------------
1 | doctrine:
2 | orm:
3 | auto_generate_proxy_classes: false
4 | metadata_cache_driver:
5 | type: pool
6 | pool: doctrine.system_cache_pool
7 | query_cache_driver:
8 | type: pool
9 | pool: doctrine.system_cache_pool
10 | result_cache_driver:
11 | type: pool
12 | pool: doctrine.result_cache_pool
13 |
14 | framework:
15 | cache:
16 | pools:
17 | doctrine.result_cache_pool:
18 | adapter: cache.app
19 | doctrine.system_cache_pool:
20 | adapter: cache.system
21 |
--------------------------------------------------------------------------------
/config/packages/prod/monolog.yaml:
--------------------------------------------------------------------------------
1 | monolog:
2 | handlers:
3 | main:
4 | type: fingers_crossed
5 | action_level: error
6 | handler: nested
7 | excluded_http_codes: [404, 405]
8 | buffer_size: 50 # How many messages should be saved? Prevent memory leaks
9 | nested:
10 | type: stream
11 | path: "%kernel.logs_dir%/%kernel.environment%.log"
12 | level: debug
13 | console:
14 | type: console
15 | process_psr_3_messages: false
16 | channels: ["!event", "!doctrine"]
17 |
--------------------------------------------------------------------------------
/config/packages/prod/routing.yaml:
--------------------------------------------------------------------------------
1 | framework:
2 | router:
3 | strict_requirements: null
4 |
--------------------------------------------------------------------------------
/config/packages/sensio_framework_extra.yaml:
--------------------------------------------------------------------------------
1 | sensio_framework_extra:
2 | router:
3 | annotations: false
4 |
--------------------------------------------------------------------------------
/config/packages/test/framework.yaml:
--------------------------------------------------------------------------------
1 | framework:
2 | test: true
3 | session:
4 | storage_factory_id: session.storage.factory.mock_file
5 |
--------------------------------------------------------------------------------
/config/packages/test/monolog.yaml:
--------------------------------------------------------------------------------
1 | monolog:
2 | handlers:
3 | main:
4 | type: fingers_crossed
5 | action_level: error
6 | handler: nested
7 | excluded_http_codes: [404, 405]
8 | channels: ["!event"]
9 | nested:
10 | type: stream
11 | path: "%kernel.logs_dir%/%kernel.environment%.log"
12 | level: debug
13 |
--------------------------------------------------------------------------------
/config/packages/test/twig.yaml:
--------------------------------------------------------------------------------
1 | twig:
2 | strict_variables: true
3 |
--------------------------------------------------------------------------------
/config/packages/twig.yaml:
--------------------------------------------------------------------------------
1 | twig:
2 | default_path: '%kernel.project_dir%/templates'
3 | debug: '%kernel.debug%'
4 | strict_variables: '%kernel.debug%'
5 | exception_controller: null
6 |
--------------------------------------------------------------------------------
/config/routes.yaml:
--------------------------------------------------------------------------------
1 | #index:
2 | # path: /
3 | # controller: App\Controller\DefaultController::index
4 |
--------------------------------------------------------------------------------
/config/routes/annotations.yaml:
--------------------------------------------------------------------------------
1 | controllers:
2 | resource: ../../src/Controller/
3 | type: annotation
4 |
5 | kernel:
6 | resource: ../../src/Kernel.php
7 | type: annotation
8 |
--------------------------------------------------------------------------------
/config/routing_dev.yml:
--------------------------------------------------------------------------------
1 | _assetic:
2 | resource: .
3 | type: assetic
4 |
5 | _wdt:
6 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
7 | prefix: /_wdt
8 |
9 | _profiler:
10 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
11 | prefix: /_profiler
12 |
13 | _main:
14 | resource: routing.yml
15 |
--------------------------------------------------------------------------------
/config/security.yml:
--------------------------------------------------------------------------------
1 | security:
2 | encoders:
3 | Symfony\Component\Security\Core\User\User: plaintext
4 |
5 | role_hierarchy:
6 | ROLE_ADMIN: ROLE_USER
7 | ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
8 |
9 | providers:
10 | in_memory:
11 | users:
12 | user: { password: userpass, roles: [ 'ROLE_USER' ] }
13 | admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
14 |
15 | firewalls:
16 | dev:
17 | pattern: ^/(_(profiler|wdt)|css|images|js)/
18 | security: false
19 |
20 | login:
21 | pattern: ^/demo/secured/login$
22 | security: false
23 |
24 | secured_area:
25 | pattern: ^/demo/secured/
26 | form_login:
27 | check_path: /demo/secured/login_check
28 | login_path: /demo/secured/login
29 | logout:
30 | path: /demo/secured/logout
31 | target: /demo/
32 | #anonymous: ~
33 | #http_basic:
34 | # realm: "Secured Demo Area"
35 |
36 | access_control:
37 | #- { path: /login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
38 |
--------------------------------------------------------------------------------
/config/services.yaml:
--------------------------------------------------------------------------------
1 | # This file is the entry point to configure your own services.
2 | # Files in the packages/ subdirectory configure your dependencies.
3 |
4 | # Put parameters here that don't need to change on each machine where the app is deployed
5 | # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
6 | parameters:
7 |
8 | services:
9 | # default configuration for services in *this* file
10 | _defaults:
11 | autowire: true # Automatically injects dependencies in your services.
12 | autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
13 | public: false # Allows optimizing the container by removing unused services; this also means
14 | # fetching services directly from the container via $container->get() won't work.
15 | # The best practice is to be explicit about your dependencies anyway.
16 |
17 | # makes classes in src/ available to be used as services
18 | # this creates a service per class whose id is the fully-qualified class name
19 | App\:
20 | resource: '../src/*'
21 | exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
22 |
23 | # controllers are imported separately to make sure services can be injected
24 | # as action arguments even if you don't extend any base controller class
25 | App\Controller\:
26 | resource: '../src/Controller'
27 | tags: ['controller.service_arguments']
28 |
29 | # add more service definitions when explicit configuration is needed
30 | # please note that last definitions always *replace* previous ones
31 |
--------------------------------------------------------------------------------
/data/code-changes/template/30_nav.html:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/data/code-changes/template/31_nav.html:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/data/code-changes/template/32_nav.html:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/data/code-changes/template/33_nav.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/data/code-changes/template/overall_footer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
19 |
20 |
23 |
24 |