1
0
Fork 0
mirror of synced 2024-06-14 08:44:49 +12:00

Merge pull request #7637 from appwrite/feat-remove-opcache

Remove preloading
This commit is contained in:
Jake Barnby 2024-02-24 00:17:02 +13:00 committed by GitHub
commit d744f8177d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 121 deletions

View file

@ -133,16 +133,9 @@ RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
# Enable Extensions
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
RUN if [ "$DEBUG" == "true" ]; then echo "opcache.enable=0" >> /usr/local/etc/php/conf.d/appwrite.ini; fi
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi
RUN echo "opcache.preload_user=www-data" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.preload=/usr/src/code/app/preload.php" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.enable_cli=1" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "default_socket_timeout=-1" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.jit_buffer_size=100M" >> /usr/local/etc/php/conf.d/appwrite.ini
RUN echo "opcache.jit=1235" >> /usr/local/etc/php/conf.d/appwrite.ini
EXPOSE 80
CMD [ "php", "app/http.php", "-dopcache.preload=opcache.preload=/usr/src/code/app/preload.php" ]
CMD [ "php", "app/http.php" ]

View file

@ -1,51 +0,0 @@
<?php
/**
* Init
*
* Inializes both Appwrite API entry point, queue workers, and CLI tasks.
* Set configuration, framework resources, app constants
*
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
require __DIR__ . '/../vendor/autoload.php';
}
use Utopia\Preloader\Preloader;
include __DIR__ . '/controllers/general.php';
$preloader = new Preloader();
foreach (
[
realpath(__DIR__ . '/../vendor/composer'),
realpath(__DIR__ . '/../vendor/amphp'),
realpath(__DIR__ . '/../vendor/felixfbecker'),
realpath(__DIR__ . '/../vendor/twig/twig'),
realpath(__DIR__ . '/../vendor/guzzlehttp/guzzle'),
realpath(__DIR__ . '/../vendor/slickdeals'),
realpath(__DIR__ . '/../vendor/psr/log'),
realpath(__DIR__ . '/../vendor/matomo'),
realpath(__DIR__ . '/../vendor/symfony'),
realpath(__DIR__ . '/../vendor/mongodb'),
realpath(__DIR__ . '/../vendor/utopia-php/websocket'), // TODO: remove workerman autoload
realpath(__DIR__ . '/../vendor/utopia-php/cache'), // TODO: remove memcached autoload
realpath(__DIR__ . '/../vendor/utopia-php/queue/src/Queue/Adapter/Workerman.php'), // TODO: remove workerman autoload
] as $key => $value
) {
if ($value !== false) {
$preloader->ignore($value);
}
}
$preloader
->paths(realpath(__DIR__ . '/../app/config'))
->paths(realpath(__DIR__ . '/../app/controllers'))
->paths(realpath(__DIR__ . '/../src'))
->load();

View file

@ -62,7 +62,6 @@
"utopia-php/orchestration": "0.9.*",
"utopia-php/platform": "0.5.*",
"utopia-php/pools": "0.4.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/queue": "0.7.*",
"utopia-php/registry": "0.5.*",
"utopia-php/storage": "0.18.*",

67
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "510f3498b35c5ec3289b7bed6a2ef9c9",
"content-hash": "37887fb414be6480280484aa41c0df9d",
"packages": [
{
"name": "adhocore/jwt",
@ -2218,59 +2218,6 @@
},
"time": "2022-11-22T07:55:45+00:00"
},
{
"name": "utopia-php/preloader",
"version": "0.2.4",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/preloader.git",
"reference": "65ef48392e72172f584b0baa2e224f9a1cebcce0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/preloader/zipball/65ef48392e72172f584b0baa2e224f9a1cebcce0",
"reference": "65ef48392e72172f584b0baa2e224f9a1cebcce0",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"vimeo/psalm": "4.0.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Utopia\\Preloader\\": "src/Preloader"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Eldad Fux",
"email": "team@appwrite.io"
}
],
"description": "Utopia Preloader library is simple and lite library for managing PHP preloading configuration",
"keywords": [
"framework",
"php",
"preload",
"preloader",
"preloading",
"upf",
"utopia"
],
"support": {
"issues": "https://github.com/utopia-php/preloader/issues",
"source": "https://github.com/utopia-php/preloader/tree/0.2.4"
},
"time": "2020-10-24T07:04:59+00:00"
},
{
"name": "utopia-php/queue",
"version": "0.7.0",
@ -3131,16 +3078,16 @@
},
{
"name": "nikic/php-parser",
"version": "v5.0.0",
"version": "v5.0.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc"
"reference": "2218c2252c874a4624ab2f613d86ac32d227bc69"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc",
"reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2218c2252c874a4624ab2f613d86ac32d227bc69",
"reference": "2218c2252c874a4624ab2f613d86ac32d227bc69",
"shasum": ""
},
"require": {
@ -3183,9 +3130,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0"
"source": "https://github.com/nikic/PHP-Parser/tree/v5.0.1"
},
"time": "2024-01-07T17:17:35+00:00"
"time": "2024-02-21T19:24:10+00:00"
},
{
"name": "phar-io/manifest",

View file

@ -92,7 +92,6 @@ services:
- php
- -e
- app/http.php
- -dopcache.preload=opcache.preload=/usr/src/code/app/preload.php
environment:
- _APP_ENV
- _APP_WORKER_PER_CORE