Browse Source

[php/hamlet] Remove Hamlet (#9782)

Hamlet is tagged as broken for all tests.

The framework doesn't have much activity.
The http part hasn't been updated for 4 years.
https://github.com/hamlet-framework/http
Petrik de Heus 4 months ago
parent
commit
de5836d32f
31 changed files with 0 additions and 835 deletions
  1. 0 2
      frameworks/PHP/hamlet/.gitignore
  2. 0 45
      frameworks/PHP/hamlet/Benchmark/Application.php
  3. 0 27
      frameworks/PHP/hamlet/Benchmark/Entities/FortuneEntity.php
  4. 0 29
      frameworks/PHP/hamlet/Benchmark/Entities/Message.php
  5. 0 34
      frameworks/PHP/hamlet/Benchmark/Entities/RandomNumber.php
  6. 0 18
      frameworks/PHP/hamlet/Benchmark/Entities/fortune.mustache
  7. 0 21
      frameworks/PHP/hamlet/Benchmark/Repositories/FortuneRepository.php
  8. 0 34
      frameworks/PHP/hamlet/Benchmark/Repositories/WorldRepository.php
  9. 0 30
      frameworks/PHP/hamlet/Benchmark/Resources/CachedQueriesResource.php
  10. 0 23
      frameworks/PHP/hamlet/Benchmark/Resources/DbResource.php
  11. 0 23
      frameworks/PHP/hamlet/Benchmark/Resources/FortuneResource.php
  12. 0 17
      frameworks/PHP/hamlet/Benchmark/Resources/HelloJsonResource.php
  13. 0 17
      frameworks/PHP/hamlet/Benchmark/Resources/HelloTextResource.php
  14. 0 25
      frameworks/PHP/hamlet/Benchmark/Resources/QueriesCountTrait.php
  15. 0 24
      frameworks/PHP/hamlet/Benchmark/Resources/QueriesResource.php
  16. 0 32
      frameworks/PHP/hamlet/Benchmark/Resources/UpdateResource.php
  17. 0 9
      frameworks/PHP/hamlet/README.md
  18. 0 80
      frameworks/PHP/hamlet/benchmark_config.json
  19. 0 18
      frameworks/PHP/hamlet/composer-swoole.json
  20. 0 18
      frameworks/PHP/hamlet/composer-workerman.json
  21. 0 17
      frameworks/PHP/hamlet/composer.json
  22. 0 54
      frameworks/PHP/hamlet/config.toml
  23. 0 62
      frameworks/PHP/hamlet/deploy/fpm/nginx.conf
  24. 0 17
      frameworks/PHP/hamlet/deploy/fpm/php-fpm.conf
  25. 0 21
      frameworks/PHP/hamlet/deploy/fpm/php.ini
  26. 0 25
      frameworks/PHP/hamlet/hamlet-swoole.dockerfile
  27. 0 36
      frameworks/PHP/hamlet/hamlet-workerman.dockerfile
  28. 0 27
      frameworks/PHP/hamlet/hamlet.dockerfile
  29. 0 15
      frameworks/PHP/hamlet/index.php
  30. 0 18
      frameworks/PHP/hamlet/swoole.php
  31. 0 17
      frameworks/PHP/hamlet/workerman.php

+ 0 - 2
frameworks/PHP/hamlet/.gitignore

@@ -1,2 +0,0 @@
-vendor/
-composer.lock

+ 0 - 45
frameworks/PHP/hamlet/Benchmark/Application.php

@@ -1,45 +0,0 @@
-<?php
-
-namespace Benchmark;
-
-use Benchmark\Resources\{CachedQueriesResource, DbResource, FortuneResource, HelloJsonResource, HelloTextResource, QueriesResource, UpdateResource};
-use Cache\Adapter\Apcu\ApcuCachePool;
-use Hamlet\Database\Database;
-use Hamlet\Http\Applications\AbstractApplication;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Resources\{HttpResource, NotFoundResource};
-use Psr\Cache\CacheItemPoolInterface;
-
-class Application extends AbstractApplication
-{
-    public function __construct(private Database $database, private CacheItemPoolInterface|null $cache = null) {}
-
-    public function findResource(Request $request): HttpResource
-    {
-        switch ($request->getPath()) {
-            case '/plaintext':
-                return new HelloTextResource;
-            case '/json':
-                return new HelloJsonResource;
-            case '/db':
-                return new DbResource($this->database);
-            case '/queries':
-                return new QueriesResource($this->database);
-            case '/cached-worlds':
-                return new CachedQueriesResource($this->getCache($request), $this->database);
-            case '/fortunes':
-                return new FortuneResource($this->database);
-            case '/update':
-                return new UpdateResource($this->database);
-        }
-        return new NotFoundResource;
-    }
-
-    protected function getCache(Request $request): CacheItemPoolInterface
-    {
-        if (!$this->cache) {
-            $this->cache = new ApcuCachePool;
-        }
-        return $this->cache;
-    }
-}

+ 0 - 27
frameworks/PHP/hamlet/Benchmark/Entities/FortuneEntity.php

@@ -1,27 +0,0 @@
-<?php
-
-namespace Benchmark\Entities;
-
-use Hamlet\Http\Entities\AbstractMustacheEntity;
-
-class FortuneEntity extends AbstractMustacheEntity
-{
-    public function __construct(private array $messages) {}
-
-    protected function getTemplateData()
-    {
-        return [
-            'messages' => $this->messages
-        ];
-    }
-
-    protected function getTemplatePath(): string
-    {
-        return __DIR__ . '/fortune.mustache';
-    }
-
-    public function getKey(): string
-    {
-        return md5(var_export($this->messages, true));
-    }
-}

+ 0 - 29
frameworks/PHP/hamlet/Benchmark/Entities/Message.php

@@ -1,29 +0,0 @@
-<?php
-
-namespace Benchmark\Entities;
-
-use Hamlet\Database\Entity;
-use JsonSerializable;
-
-class Message implements Entity, JsonSerializable
-{
-    public function __construct(private int $id, private string $message) {}
-
-    public function id(): int
-    {
-        return $this->id;
-    }
-
-    public function message(): string
-    {
-        return $this->message;
-    }
-
-    public function jsonSerialize(): array
-    {
-        return [
-            'id' => $this->id,
-            'message' => $this->message
-        ];
-    }
-}

+ 0 - 34
frameworks/PHP/hamlet/Benchmark/Entities/RandomNumber.php

@@ -1,34 +0,0 @@
-<?php
-
-namespace Benchmark\Entities;
-
-use Hamlet\Database\Entity;
-use JsonSerializable;
-
-final class RandomNumber implements Entity, JsonSerializable
-{
-    public function __construct(private int $id, private int $randomNumber) {}
-
-    public function id(): int
-    {
-        return $this->id;
-    }
-
-    public function number(): int
-    {
-        return $this->randomNumber;
-    }
-
-    public function withNumber(int $number): self
-    {
-        return new self($this->id, $number);
-    }
-
-    public function jsonSerialize(): array
-    {
-        return [
-            'id' => $this->id,
-            'randomNumber' => $this->randomNumber
-        ];
-    }
-}

+ 0 - 18
frameworks/PHP/hamlet/Benchmark/Entities/fortune.mustache

@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head><title>Fortunes</title></head>
-<body>
-<table>
-    <tr>
-        <th>id</th>
-        <th>message</th>
-    </tr>
-    {{# messages }}
-        <tr>
-            <td>{{ id }}</td>
-            <td>{{ message }}</td>
-        </tr>
-    {{/ messages }}
-</table>
-</body>
-</html>

+ 0 - 21
frameworks/PHP/hamlet/Benchmark/Repositories/FortuneRepository.php

@@ -1,21 +0,0 @@
-<?php
-
-namespace Benchmark\Repositories;
-
-use Benchmark\Entities\Message;
-use Hamlet\Database\Session;
-
-class FortuneRepository
-{
-    /**
-     * @return callable(Session):array<Message>
-     */
-    public function findAll(): callable
-    {
-        return fn (Session $session) =>
-            $session->prepare('SELECT id, message FROM Fortune')
-                ->processAll()
-                ->selectAll()->cast(Message::class)
-                ->collectAll();
-    }
-}

+ 0 - 34
frameworks/PHP/hamlet/Benchmark/Repositories/WorldRepository.php

@@ -1,34 +0,0 @@
-<?php
-
-namespace Benchmark\Repositories;
-
-use Benchmark\Entities\RandomNumber;
-use Hamlet\Database\Session;
-
-class WorldRepository
-{
-    /**
-     * @return callable(Session):?RandomNumber
-     */
-    public function findById(int $id): callable
-    {
-        return fn (Session $session) =>
-            $session->prepare('SELECT id, randomNumber FROM World WHERE id = ?')
-                ->bindInteger($id)
-                ->processOne()
-                ->selectAll()->cast(RandomNumber::class)
-                ->collectHead();
-    }
-
-    /**
-     * @return callable(Session):void
-     */
-    public function updateNumber(RandomNumber $number): callable
-    {
-        return fn (Session $session) =>
-            $session->prepare('UPDATE World SET randomNumber = ? WHERE id = ?')
-                ->bindInteger($number->number())
-                ->bindInteger($number->id())
-                ->execute();
-    }
-}

+ 0 - 30
frameworks/PHP/hamlet/Benchmark/Resources/CachedQueriesResource.php

@@ -1,30 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Cache\Adapter\Common\CacheItem;
-use Hamlet\Database\Database;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Responses\Response;
-use Psr\Cache\CacheItemPoolInterface;
-
-class CachedQueriesResource extends QueriesResource
-{
-    public function __construct(private CacheItemPoolInterface $cache, Database $database)
-    {
-        parent::__construct($database);
-    }
-
-    public function getResponse(Request $request): Response
-    {
-        $count = $this->getQueriesCount($request);
-        $key = 'count.' . $count;
-        $item = $this->cache->getItem($key);
-        if ($item->isHit()) {
-            return $item->get();
-        }
-        $response = parent::getResponse($request);
-        $this->cache->save(new CacheItem($key, true, $response));
-        return $response;
-    }
-}

+ 0 - 23
frameworks/PHP/hamlet/Benchmark/Resources/DbResource.php

@@ -1,23 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Benchmark\Repositories\WorldRepository;
-use Hamlet\Database\{Database};
-use Hamlet\Http\Entities\JsonEntity;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Resources\HttpResource;
-use Hamlet\Http\Responses\{Response, SimpleOKResponse};
-
-class DbResource implements HttpResource
-{
-    public function __construct(protected Database $database) {}
-
-    public function getResponse(Request $request): Response
-    {
-        $repository = new WorldRepository;
-        $id = mt_rand(1, 10000);
-        $record = $this->database->withSession($repository->findById($id));
-        return new SimpleOKResponse(new JsonEntity($record));
-    }
-}

+ 0 - 23
frameworks/PHP/hamlet/Benchmark/Resources/FortuneResource.php

@@ -1,23 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Benchmark\Entities\FortuneEntity;
-use Benchmark\Entities\Message;
-use Benchmark\Repositories\FortuneRepository;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Responses\{Response, SimpleOKResponse};
-
-class FortuneResource extends DbResource
-{
-    public function getResponse(Request $request): Response
-    {
-        $repository = new FortuneRepository;
-        $messages = $this->database->withSession($repository->findAll());
-        $messages[] = new Message(0, 'Additional fortune added at request time.');
-        usort($messages, function (Message $a, Message $b): int {
-            return $a->message() <=> $b->message();
-        });
-        return new SimpleOKResponse(new FortuneEntity($messages));
-    }
-}

+ 0 - 17
frameworks/PHP/hamlet/Benchmark/Resources/HelloJsonResource.php

@@ -1,17 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Hamlet\Http\Entities\JsonEntity;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Resources\HttpResource;
-use Hamlet\Http\Responses\{Response, SimpleOKResponse};
-
-class HelloJsonResource implements HttpResource
-{
-    public function getResponse(Request $request): Response
-    {
-        $entity = new JsonEntity(['message' => 'Hello, World!']);
-        return new SimpleOKResponse($entity);
-    }
-}

+ 0 - 17
frameworks/PHP/hamlet/Benchmark/Resources/HelloTextResource.php

@@ -1,17 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Hamlet\Http\Entities\PlainTextEntity;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Resources\HttpResource;
-use Hamlet\Http\Responses\{Response, SimpleOKResponse};
-
-class HelloTextResource implements HttpResource
-{
-    public function getResponse(Request $request): Response
-    {
-        $entity = new PlainTextEntity('Hello, World!');
-        return new SimpleOKResponse($entity);
-    }
-}

+ 0 - 25
frameworks/PHP/hamlet/Benchmark/Resources/QueriesCountTrait.php

@@ -1,25 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Hamlet\Http\Requests\Request;
-use function Hamlet\Cast\_int;
-
-trait QueriesCountTrait
-{
-    protected function getQueriesCount(Request $request): int
-    {
-        if ($request->hasQueryParam('queries')) {
-            $count = $request->getQueryParam('queries', _int());
-            if ($count < 1) {
-                return 1;
-            } elseif (500 < $count) {
-                return 500;
-            } else {
-                return $count;
-            }
-        } else {
-            return 1;
-        }
-    }
-}

+ 0 - 24
frameworks/PHP/hamlet/Benchmark/Resources/QueriesResource.php

@@ -1,24 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Benchmark\Repositories\WorldRepository;
-use Hamlet\Http\Entities\JsonEntity;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Responses\{Response, SimpleOKResponse};
-
-class QueriesResource extends DbResource
-{
-    use QueriesCountTrait;
-
-    public function getResponse(Request $request): Response
-    {
-        $repository = new WorldRepository;
-        $count = $this->getQueriesCount($request);
-        $payload = $this->database->withSessions(array_map(
-            fn () => $repository->findById(mt_rand(1, 10000)),
-            range(1, $count)
-        ));
-        return new SimpleOKResponse(new JsonEntity($payload));
-    }
-}

+ 0 - 32
frameworks/PHP/hamlet/Benchmark/Resources/UpdateResource.php

@@ -1,32 +0,0 @@
-<?php
-
-namespace Benchmark\Resources;
-
-use Benchmark\Repositories\WorldRepository;
-use Hamlet\Http\Entities\JsonEntity;
-use Hamlet\Http\Requests\Request;
-use Hamlet\Http\Responses\{Response, SimpleOKResponse};
-
-class UpdateResource extends DbResource
-{
-    use QueriesCountTrait;
-
-    public function getResponse(Request $request): Response
-    {
-        $repository = new WorldRepository;
-        $count = $this->getQueriesCount($request);
-        $entries = $this->database->withSessions(array_map(
-            fn () => $repository->findById(mt_rand(1, 10000)),
-            range(1, $count),
-        ));
-        $modifiedEntries = array_map(
-            fn ($entry) => $entry->withNumber(mt_rand(1, 10000)),
-            $entries
-        );
-        $this->database->withSessions(array_map(
-            fn ($modifiedEntry) => $repository->updateNumber($modifiedEntry),
-            $modifiedEntries
-        ));
-        return new SimpleOKResponse(new JsonEntity($modifiedEntries));
-    }
-}

+ 0 - 9
frameworks/PHP/hamlet/README.md

@@ -1,9 +0,0 @@
-# Hamlet Framework Benchmarking Test
-
-This is the [Hamlet Framework](https://github.com/hamlet-framework) portion of a [benchmarking test suite](../)
-
-Current submission tests the following configurations:
-
-- Hamlet
-- Hamlet + Swoole
-- Hamlet + Workerman

+ 0 - 80
frameworks/PHP/hamlet/benchmark_config.json

@@ -1,80 +0,0 @@
-{
-  "framework": "hamlet",
-  "tests": [{
-    "default": {
-      "plaintext_url": "/plaintext",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "cached_query_url": "/cached-worlds?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/update?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "mysql",
-      "framework": "hamlet",
-      "language": "PHP",
-      "flavor": "PHP8.1",
-      "orm": "micro",
-      "platform": "FPM/FastCGI",
-      "webserver": "nginx",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "hamlet",
-      "notes": "",
-      "versus": "php",
-      "tags": ["broken"]
-    },
-    "swoole": {
-      "plaintext_url": "/plaintext",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "cached_query_url": "/cached-worlds?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/update?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "mysql",
-      "framework": "hamlet",
-      "language": "PHP",
-      "flavor": "PHP8",
-      "orm": "micro",
-      "platform": "swoole",
-      "webserver": "none",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "hamlet-swoole",
-      "notes": "",
-      "versus": "swoole",
-      "tags": ["broken"]
-    },
-    "workerman": {
-      "plaintext_url": "/plaintext",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/queries?queries=",
-      "cached_query_url": "/cached-worlds?queries=",
-      "fortune_url": "/fortunes",
-      "update_url": "/update?queries=",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "mysql",
-      "framework": "hamlet",
-      "language": "PHP",
-      "flavor": "PHP8",
-      "orm": "micro",
-      "platform": "workerman",
-      "webserver": "none",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "hamlet-workerman",
-      "notes": "",
-      "versus": "workerman",
-      "tags": ["broken"]
-    }
-  }]
-}

+ 0 - 18
frameworks/PHP/hamlet/composer-swoole.json

@@ -1,18 +0,0 @@
-{
-  "config": {
-    "optimize-autoloader": true,
-    "classmap-authoritative": true
-  },
-  "require": {
-    "php": "^8",
-    "hamlet-framework/http" : "@stable",
-    "hamlet-framework/http-swoole": "@stable",
-    "hamlet-framework/db-mysql-swoole": "@stable",
-    "cache/array-adapter": "@stable"
-  },
-  "autoload": {
-    "psr-4": {
-      "Benchmark\\": "Benchmark/"
-    }
-  }
-}

+ 0 - 18
frameworks/PHP/hamlet/composer-workerman.json

@@ -1,18 +0,0 @@
-{
-  "config": {
-    "optimize-autoloader": true,
-    "classmap-authoritative": true
-  },
-  "require": {
-    "php": "^8",
-    "hamlet-framework/http" : "@stable",
-    "hamlet-framework/http-workerman": "@stable",
-    "hamlet-framework/db-pdo": "@stable",
-    "cache/array-adapter": "@stable"
-  },
-  "autoload": {
-    "psr-4": {
-      "Benchmark\\": "Benchmark/"
-    }
-  }
-}

+ 0 - 17
frameworks/PHP/hamlet/composer.json

@@ -1,17 +0,0 @@
-{
-  "config": {
-    "optimize-autoloader": true,
-    "classmap-authoritative": true
-  },
-  "require": {
-    "php": "^8",
-    "hamlet-framework/http" : "@stable",
-    "hamlet-framework/db-pdo": "@stable",
-    "cache/apcu-adapter": "@stable"
-  },
-  "autoload": {
-    "psr-4": {
-      "Benchmark\\": "Benchmark/"
-    }
-  }
-}

+ 0 - 54
frameworks/PHP/hamlet/config.toml

@@ -1,54 +0,0 @@
-[framework]
-name = "hamlet"
-
-[main]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.cached_query = "/cached-worlds?queries="
-urls.update = "/update?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Fullstack"
-database = "mysql"
-database_os = "Linux"
-os = "Linux"
-orm = "micro"
-platform = "FPM/FastCGI"
-webserver = "nginx"
-versus = "php"
-
-[workerman]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/update?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Fullstack"
-database = "mysql"
-database_os = "Linux"
-os = "Linux"
-orm = "micro"
-platform = "workerman"
-webserver = "none"
-versus = "workerman"
-
-[swoole]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries?queries="
-urls.update = "/update?queries="
-urls.fortune = "/fortunes"
-approach = "Realistic"
-classification = "Fullstack"
-database = "mysql"
-database_os = "Linux"
-os = "Linux"
-orm = "micro"
-platform = "swoole"
-webserver = "none"
-versus = "swoole"

+ 0 - 62
frameworks/PHP/hamlet/deploy/fpm/nginx.conf

@@ -1,62 +0,0 @@
-user www-data;
-worker_processes auto;
-error_log stderr error;
-worker_rlimit_nofile 200000;
-
-events {
-    worker_connections 32768;
-    multi_accept on;
-}
-
-http {
-    access_log off;
-    server_tokens off;
-
-    sendfile on;
-    tcp_nopush on;
-    tcp_nodelay on;
-    keepalive_timeout 65;
-    keepalive_disable none;
-    keepalive_requests 1000;
-
-    #the bench don't use any static file
-    #open_file_cache max=2000 inactive=20s;
-    #open_file_cache_valid 60s;
-    #open_file_cache_min_uses 5;
-    #open_file_cache_errors off;
-
-    fastcgi_buffers 256 16k;
-    fastcgi_buffer_size 128k;
-    fastcgi_connect_timeout 120s;
-    fastcgi_send_timeout 120s;
-    fastcgi_read_timeout 120s;
-    fastcgi_busy_buffers_size 256k;
-    fastcgi_temp_file_write_size 256k;
-    reset_timedout_connection on;
-    server_names_hash_bucket_size 100;
-
-    upstream fastcgi_backend {
-        server unix:/var/run/php-fpm.sock;
-        keepalive 40;
-    }
-
-    server {
-        listen 8080;
-        server_name localhost;
-
-        root /app;
-        index  index.php;
-
-        location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-            fastcgi_pass   fastcgi_backend;
-            fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
-            include        /etc/nginx/fastcgi_params;
-        }
-    }
-}

+ 0 - 17
frameworks/PHP/hamlet/deploy/fpm/php-fpm.conf

@@ -1,17 +0,0 @@
-[global]
-pid = /var/run/php-fpm.pid
-error_log = /dev/stderr
-systemd_interval = 0
-
-[www]
-user = www-data
-group = www-data
-listen = /var/run/php-fpm.sock
-listen.backlog = 65535
-listen.owner = www-data
-listen.group = www-data
-pm = static
-pm.max_children = 1024
-pm.start_servers = 512
-pm.min_spare_servers = 50
-pm.max_spare_servers = 512

+ 0 - 21
frameworks/PHP/hamlet/deploy/fpm/php.ini

@@ -1,21 +0,0 @@
-opcache.enable_file_override = 1
-opcache.memory_consumption = 96
-opcache.interned_strings_buffer = 16
-opcache.max_accelerated_files = 10000
-opcache.save_comments = 1
-opcache.consistency_checks = 0
-opcache.enable = 1
-opcache.enable_cli=1
-opcache.optimization_level = 0xFFFFFFFF
-opcache.huge_code_pages = 0
-opcache.validate_timestamps = 0
-opcache.jit_buffer_size = 128M
-opcache.jit = 1255
-
-realpath_cache_ttl = 1200
-memory_limit = 512M
-
-display_errors = 0
-error_reporting = E_ALL
-zend.assertions = 0
-assert.exception = 0

+ 0 - 25
frameworks/PHP/hamlet/hamlet-swoole.dockerfile

@@ -1,25 +0,0 @@
-FROM php:8.0
-
-RUN pecl install swoole > /dev/null && \
-    docker-php-ext-enable swoole
-
-RUN docker-php-ext-install mysqli > /dev/null && \
-    docker-php-ext-enable mysqli
-
-RUN apt-get update -yqq && \
-    apt-get install -yqq git unzip
-
-COPY ./deploy/fpm/php.ini /usr/local/etc/php/conf.d/hamlet.ini
-
-RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
-ADD ./ /php
-WORKDIR /php
-COPY ./composer-swoole.json composer.json
-RUN chmod -R 777 /php
-
-RUN composer update --no-dev --quiet
-
-EXPOSE 8080
-
-CMD php /php/swoole.php

+ 0 - 36
frameworks/PHP/hamlet/hamlet-workerman.dockerfile

@@ -1,36 +0,0 @@
-FROM php:8.0-zts
-
-ENV PHP_VERSION 8.0
-ENV PARALLEL_VERSION 360c667b7632a639a983f17c5d97b92cbe4f7c95
-
-RUN docker-php-ext-install pdo_mysql > /dev/null && docker-php-ext-enable pdo_mysql
-RUN docker-php-ext-install sockets   > /dev/null && docker-php-ext-enable sockets
-RUN docker-php-ext-install pcntl     > /dev/null && docker-php-ext-enable pcntl
-
-RUN apt-get update -yqq > /dev/null \
-    && apt-get install -yqq git unzip libevent-dev libssl-dev > /dev/null
-
-RUN git clone https://github.com/krakjoe/parallel \
-    && cd parallel \
-    && git checkout 360c667b7632a639a983f17c5d97b92cbe4f7c95 \
-    && phpize > /dev/null \
-    && ./configure --enable-parallel > /dev/null \
-    && make > /dev/null \
-    && make install > /dev/null
-
-RUN pecl install event-3.0.5 > /dev/null \
-    && echo "extension=event.so" > /usr/local/etc/php/conf.d/event.ini
-
-COPY deploy/fpm/php.ini /usr/local/etc/php/conf.d/hamlet.ini
-
-RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
-
-ADD ./ /hamlet
-WORKDIR /hamlet
-COPY ./composer-workerman.json composer.json
-
-RUN composer update --no-dev --quiet
-
-EXPOSE 8080
-
-CMD php /hamlet/workerman.php start

+ 0 - 27
frameworks/PHP/hamlet/hamlet.dockerfile

@@ -1,27 +0,0 @@
-FROM ubuntu:20.04
-
-ENV PHP_VERSION 8.1
-ARG DEBIAN_FRONTEND=noninteractive
-
-RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
-RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
-RUN apt-get update -yqq > /dev/null && \
-    apt-get install -yqq nginx git unzip curl \
-    php${PHP_VERSION}-cli php${PHP_VERSION}-fpm php${PHP_VERSION}-apcu php${PHP_VERSION}-pdo-mysql php${PHP_VERSION}-dev > /dev/null
-
-COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
-
-ADD ./ /app
-WORKDIR /app
-
-RUN composer update --no-dev --quiet
-
-COPY deploy/fpm/php-fpm.conf /etc/php/${PHP_VERSION}/fpm/php-fpm.conf
-COPY deploy/fpm/php.ini /etc/php/${PHP_VERSION}/fpm/php.ini
-
-RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/${PHP_VERSION}/fpm/php-fpm.conf ; fi;
-
-EXPOSE 8080
-
-CMD service php${PHP_VERSION}-fpm start \
-    && nginx -c /app/deploy/fpm/nginx.conf -g "daemon off;"

+ 0 - 15
frameworks/PHP/hamlet/index.php

@@ -1,15 +0,0 @@
-<?php
-
-use Benchmark\Application;
-use Hamlet\Database\PDO\PDODatabase;
-use Hamlet\Http\Bootstraps\ServerBootstrap;
-
-require_once __DIR__ . '/vendor/autoload.php';
-
-$database = new PDODatabase(
-    'mysql:host=tfb-database;dbname=hello_world',
-    'benchmarkdbuser',
-    'benchmarkdbpass'
-);
-$application = new Application($database);
-ServerBootstrap::run($application);

+ 0 - 18
frameworks/PHP/hamlet/swoole.php

@@ -1,18 +0,0 @@
-<?php
-
-use Benchmark\Application;
-use Cache\Adapter\PHPArray\ArrayCachePool;
-use Hamlet\Database\MySQLSwoole\MySQLSwooleDatabase;
-use Hamlet\Http\Swoole\Bootstraps\SwooleBootstrap;
-
-require_once __DIR__ . '/vendor/autoload.php';
-
-$database = new MySQLSwooleDatabase(
-    'tfb-database',
-    'benchmarkdbuser',
-    'benchmarkdbpass',
-    'hello_world',
-    intdiv(512, swoole_cpu_num())
-);
-$application = new Application($database, new ArrayCachePool);
-SwooleBootstrap::run('0.0.0.0', 8080, $application, $database);

+ 0 - 17
frameworks/PHP/hamlet/workerman.php

@@ -1,17 +0,0 @@
-<?php
-
-use Benchmark\Application;
-use Cache\Adapter\PHPArray\ArrayCachePool;
-use Hamlet\Database\PDO\PDODatabase;
-use Hamlet\Http\Workerman\Bootstraps\WorkermanBootstrap;
-
-require_once __DIR__ . '/vendor/autoload.php';
-
-$database = new PDODatabase(
-    'mysql:host=tfb-database;dbname=hello_world',
-    'benchmarkdbuser',
-    'benchmarkdbpass'
-);
-$cache = new ArrayCachePool;
-$application = new Application($database, $cache);
-WorkermanBootstrap::run('0.0.0.0', 8080, $application);