Skip to content

Commit 7227ba5

Browse files
committed
[Runtime] Document registering your own runtime template
1 parent c10d923 commit 7227ba5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

components/runtime.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,5 +504,28 @@ The end user will now be able to create front controller like::
504504
return new SomeCustomPsr15Application();
505505
};
506506

507+
Create Your Own Runtime Template
508+
--------------------------------
509+
510+
In some cases the default generic runtime template generated (`vendor/autoload_runtime.php`)
511+
file is not enough. For example: you want to use a different entry point than
512+
`$_SERVER['FILE_SCRIPTNAME']` or a different SAPI than the traditional `cli`,
513+
`phpdbg` or `embed`.
514+
515+
To use your own template, you can register it as follows:
516+
517+
.. code-block:: json
518+
519+
{
520+
"require": {
521+
"...": "..."
522+
},
523+
"extra": {
524+
"runtime": {
525+
"autoload_template": "resources/runtime/autoload_runtime.template"
526+
}
527+
}
528+
}
529+
507530
.. _ReactPHP: https://reactphp.org/
508531
.. _`PSR-15`: https://www.php-fig.org/psr/psr-15/

0 commit comments

Comments
 (0)