initializers

这个设置允许您提供一个或多个C函数在某些扩展生命周期事件上执行——具体来说,GINIT (globals), MINIT (module), RINIT (<0 >0 request</0 >1)。 Check the lifecycle hooks chapter for more information.

  1. {
  2. "initializers": [
  3. {
  4. "globals": [
  5. {
  6. "include": "my/awesome/library.h",
  7. "code": "setup_globals_deps(TSRMLS_C)"
  8. }
  9. ],
  10. "module": [
  11. {
  12. "include": "my/awesome/library.h",
  13. "code": "setup_module_deps(TSRMLS_C)"
  14. }
  15. ],
  16. "request": [
  17. {
  18. "include": "my/awesome/library.h",
  19. "code": "some_c_function(TSRMLS_C)"
  20. },
  21. {
  22. "include": "my/awful/library.h",
  23. "code": "some_other_c_function(TSRMLS_C)"
  24. }
  25. ]
  26. }
  27. ]
  28. }