swoole.php 453 B

1234567891011121314151617
  1. <?php
  2. use Benchmark\Application;
  3. use Hamlet\Database\MySQLSwoole\MySQLSwooleDatabase;
  4. use Hamlet\Http\Swoole\Bootstraps\SwooleBootstrap;
  5. require_once __DIR__ . '/vendor/autoload.php';
  6. $database = new MySQLSwooleDatabase(
  7. 'tfb-database',
  8. 'benchmarkdbuser',
  9. 'benchmarkdbpass',
  10. 'hello_world',
  11. intdiv(512, swoole_cpu_num())
  12. );
  13. $application = new Application($database);
  14. SwooleBootstrap::run('0.0.0.0', 8080, $application, $database);