PluginProbe
Cool Timeline (Horizontal & Vertical Timeline) / trunk
Cool Timeline (Horizontal & Vertical Timeline) vtrunk
3.4.0 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 2.2.3 2.3.3 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.6.1 2.7.1 2.8.3 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 All 79 releases
cool-timeline / admin / cp-onboarding / framework / bootstrap.php

bootstrap.php in Cool Timeline (Horizontal & Vertical Timeline) trunk, at admin/cp-onboarding/framework/bootstrap.php

37 lines 942 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals -- Shared framework bootstrap keeps legacy cpo_* identifiers.
3 /**
4 * Framework bootstrap — registers a lightweight autoloader for the
5 * CoolPlugins\Onboarding namespace. No Composer required.
6 *
7 * @package CoolPlugins\Onboarding
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 if ( ! defined( 'CPO_ONBOARDING_DIR' ) ) {
15 define( 'CPO_ONBOARDING_DIR', __DIR__ );
16 }
17
18 spl_autoload_register(
19 static function ( $class ) {
20 $prefix = 'CoolPlugins\\Onboarding\\';
21 $len = strlen( $prefix );
22
23 if ( 0 !== strncmp( $prefix, $class, $len ) ) {
24 return;
25 }
26
27 // CoolPlugins\Onboarding\Demo_Generator -> src/class-demo-generator.php
28 $relative = substr( $class, $len );
29 $relative = strtolower( str_replace( '_', '-', $relative ) );
30 $file = CPO_ONBOARDING_DIR . '/src/class-' . $relative . '.php';
31
32 if ( is_readable( $file ) ) {
33 require_once $file;
34 }
35 }
36 );
37