| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Registry factory — Desktop Mode. | |
| 3 | + * Registry factory — OpenStation. | |
| 4 | 4 | * |
| 5 | 5 | * **Why this exists.** Across the plugin, ~15 PHP "registry" |
| 6 | 6 | * functions follow the same shape: |
| 7 | 7 | * |
| 8 | - * function desktop_mode_<thing>_registry( $id = '', $entry = null ) { | |
| 8 | + * function openstation_<thing>_registry( $id = '', $entry = null ) { | |
| 9 | 9 | * static $store = array(); |
| 10 | 10 | * if ( '__flush__' === (string) $id ) { $store = array(); return array(); } |
| 11 | 11 | * if ( '' === (string) $id ) return $store; |
| 12 | 12 | * if ( null !== $entry ) $store[ $id ] = $entry; |
| @@ -23,10 +23,9 @@ | ||
| 23 | 23 | * registry functions in `includes/components.php`, `commands.php`, |
| 24 | 24 | * `settings-tabs.php`, `window-chrome.php`, etc. can become one-line |
| 25 | 25 | * forwarders calling these factories. |
| 26 | 26 | * |
| 27 | - * @package Desktop_Mode | |
| 28 | - * @since 0.8.1 | |
| 27 | + * @package OpenStation | |
| 29 | 28 | */ |
| 30 | 29 | |
| 31 | 30 | defined( 'ABSPATH' ) || exit; |
| 32 | 31 | |
| @@ -44,14 +43,12 @@ | ||
| 44 | 43 | * own private `$state` array — closures in PHP capture by reference |
| 45 | 44 | * via the `use ( &$state )` clause. Every registry instance is |
| 46 | 45 | * therefore isolated; different registries cannot stomp on each other. |
| 47 | 46 | * |
| 48 | - * @since 0.8.1 | |
| 49 | - * | |
| 50 | 47 | * @param array $initial Optional initial entries keyed by id. |
| 51 | 48 | * @return callable Registry closure. |
| 52 | 49 | */ |
| 53 | -function desktop_mode_create_registry( $initial = array() ) { | |
| 50 | +function openstation_create_registry( $initial = array() ) { | |
| 54 | 51 | $state = is_array( $initial ) ? $initial : array(); |
| 55 | 52 | return static function ( $id = '', $entry = null ) use ( &$state ) { |
| 56 | 53 | // Flush — used by tests + the deactivation path that needs to |
| 57 | 54 | // rebuild the registry after a plugin unloaded its callbacks. |
| @@ -78,19 +75,17 @@ | ||
| 78 | 75 | * Build a script-handle registry — boolean-flagged set of WP script |
| 79 | 76 | * handles that the live-refresh payload should advertise so the |
| 80 | 77 | * client can lazy-load them. |
| 81 | 78 | * |
| 82 | - * Same shape as {@see desktop_mode_create_registry()} but values are | |
| 79 | + * Same shape as {@see openstation_create_registry()} but values are | |
| 83 | 80 | * coerced to bool, and the read-one path returns `false` (not `null`) |
| 84 | 81 | * when the handle is unknown — matching the existing convention used |
| 85 | 82 | * across `*_script_registry()` functions. |
| 86 | 83 | * |
| 87 | - * @since 0.8.1 | |
| 88 | - * | |
| 89 | 84 | * @param array $initial Optional initial flags keyed by handle. |
| 90 | 85 | * @return callable Script-registry closure. |
| 91 | 86 | */ |
| 92 | -function desktop_mode_create_script_registry( $initial = array() ) { | |
| 87 | +function openstation_create_script_registry( $initial = array() ) { | |
| 93 | 88 | $state = is_array( $initial ) ? $initial : array(); |
| 94 | 89 | return static function ( $handle = '', $value = null ) use ( &$state ) { |
| 95 | 90 | if ( '__flush__' === (string) $handle ) { |
| 96 | 91 | $state = array(); |