cripts or .shtml files, or anything else that you would * parse through Apache. Note that for a CGI script, the script * must generate valid CGI headers. At the minimum that means it * must generate a Content-Type header. * * To run the sub-request, all buffers are terminated and flushed to the * browser, pending headers are sent too. * * @param string $filename The file that the virtual command will be performed on. * @throws ApacheException * */ function virtual(string $filename): void { error_clear_last(); $result = \virtual($filename); if ($result === false) { throw ApacheException::createFromPhpError(); } }s_ids as $component_id ) { $class_name = $namespace . '\\Components\\' . $component_id; $this->add_component( $component_id, new $class_name() ); } } /** * Registers the Module's widgets. * Assumes namespace structure contains `\Widgets\` * * @access protected * * @param \Elementor\Widgets_Manager $widgets_manager * @return void */ public function register_widgets( \Elementor\Widgets_Manager $widgets_manager ): void { $widget_ids = $this->get_widget_ids(); $namespace = static::namespace_name(); foreach ( $widget_ids as $widget_id ) { $class_name = $namespace . '\\Widgets\\' . $widget_id; $widgets_manager->register( new $class_name() ); } } /** * @access protected * * @return string[] */ protected function get_widget_ids(): array { return []; } /** * @access protected * * @return void */ protected function register_hooks(): void { add_action( 'elementor/widgets/register', [ $this, 'register_widgets' ] ); } /** * Clone. * * Disable class cloning and throw an error on object clone. * * The whole idea of the singleton design pattern is that there is a single * object. Therefore, we don't want the object to be cloned. * * @access private */ public function __clone() { // Cloning instances of the class is forbidden _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'hello-elementor' ), '0.0.1' ); // @codeCoverageIgnore } /** * Wakeup. * * Disable un-serializing of the class. * @access public */ public function __wakeup() { // Un-serializing instances of the class is forbidden _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'hello-elementor' ), '0.0.1' ); // @codeCoverageIgnore } /** * class constructor * * @access protected * * @param ?string[] $components_list */ protected function __construct( ?array $components_list = null ) { $this->register_components( $components_list ); $this->register_hooks(); } }