-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautoload.php.tmpl
More file actions
46 lines (43 loc) · 1.6 KB
/
autoload.php.tmpl
File metadata and controls
46 lines (43 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Recoil instrumenting autoloader.
*
* This autoloader instruments Recoil coroutines with debugging code that allows
* the Recoil development tools to inspect strand behaviour at run-time. All
* other code is unaffected. The standard Composer autoloader is used to locate
* files for inclusion.
*
* If you are seeing this file in your vendor directory and you're not sure why
* it's here, run:
*
* composer why recoilphp/dev
*
* Instrumentation is only intended to occur during development, as both the
* generation and execution of the instrumentation code incurs an overhead.
*
* To disable the execution of instrumented code, set "zend.assertions" to
* "production mode" (-1) in the PHP configuration.
*
* Instrumentation can be disabled temporarily by setting the environment
* variable RECOIL_INSTRUMENTATION to "none".
*
* To disable the instrumentation permantently (and remove this autoloader
* entirely), run the following command in the root directory of the project:
*
* composer config extra.recoil.instrumentation none && composer dump-autoload
*
* Additionally, this autoloader will not be installed if composer install is
* run with the --no-dev option, even if recoil/dev is installed.
*
* @link https://github.com/recoilphp/recoil
* @link https://github.com/recoilphp/dev
*/
use Recoil\Dev\Composer\Plugin;
use Recoil\Dev\Instrumentation\Autoloader\Autoloader;
return (function () {
$classLoader = require __DIR__ . '/autoload.uninstrumented.php';
return Autoloader::install(
$classLoader,
getenv('RECOIL_INSTRUMENTATION') ?: %mode%
);
})();