You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use PHPFastCGI\FastCGIDaemon\Command\DaemonRunCommand;
31
-
use PHPFastCGI\FastCGIDaemon\DaemonFactory;
30
+
use PHPFastCGI\FastCGIDaemon\ApplicationFactory;
32
31
use Psr\Http\Message\ServerRequestInterface;
33
-
use Symfony\Component\Console\Application;
34
32
use Zend\Diactoros\Response\HtmlResponse;
35
33
36
-
// Create the dependencies for the DaemonRunCommand
37
-
38
-
// Dependency 1: The daemon factory
39
-
$daemonFactory = new DaemonFactory();
40
-
41
-
// Dependency 2: A simple kernel. This is the core of your application
34
+
// A simple kernel. This is the core of your application
42
35
$kernel = function (ServerRequestInterface $request) {
43
36
return new HtmlResponse('<h1>Hello, World!</h1>');
44
37
};
45
38
46
-
// Create an instance of DaemonRunCommand using the daemon factory and the kernel
47
-
$command = new DaemonRunCommand('run', 'Run a FastCGI daemon', $daemonFactory, $kernel);
48
-
49
-
// Create a symfony console application and add the command
50
-
$consoleApplication = new Application();
51
-
$consoleApplication->add($command);
39
+
// Create your Symfony console application using the factory
40
+
$application = (new ApplicationFactory)->createApplication($kernel);
52
41
53
-
// Run the symfony console application
54
-
$consoleApplication->run();
42
+
// Run the Symfony console application
43
+
$application->run();
55
44
```
56
45
57
46
If you wish to configure your FastCGI application to work with the apache web server, you can use the apache FastCGI module to process manage your application.
0 commit comments