workerman.php 483 B

1234567891011121314151617
  1. <?php
  2. use Benchmark\Application;
  3. use Cache\Adapter\PHPArray\ArrayCachePool;
  4. use Hamlet\Database\PDO\PDODatabase;
  5. use Hamlet\Http\Workerman\Bootstraps\WorkermanBootstrap;
  6. require_once __DIR__ . '/vendor/autoload.php';
  7. $database = new PDODatabase(
  8. 'mysql:host=tfb-database;dbname=hello_world',
  9. 'benchmarkdbuser',
  10. 'benchmarkdbpass'
  11. );
  12. $cache = new ArrayCachePool;
  13. $application = new Application($database, $cache);
  14. WorkermanBootstrap::run('0.0.0.0', 8080, $application);