Attribute Macro ext_php_rs::php_startup[][src]

#[php_startup]
Expand description

Annotates a function that will be called by PHP when the module starts up. Generally used to register classes and constants.

As well as annotating the function, any classes and constants that had been declared using the php_class, php_const and php_impl attributes will be registered inside this function.

This function must be declared before the php_module function, as this function needs to be declared when building the module.

This function will automatically be generated if not already declared with this macro if you have registered any classes or constants when using the php_module macro.

Example

#[php_startup]
pub fn startup_function() {
    // do whatever you need to do...
}