upskill-event-manager/wordpress-dev/wordpress/wp-content/plugins/code-snippets/php/load.php
bengizmo d1509b3d60 feat(dev-env): implement backup-based development workflow
This commit introduces a more reliable and consistent approach to setting up
the development environment using backups:

- Add setup-from-backup.sh script for environment setup from existing backups
- Standardize script naming and organization
- Move obsolete scripts to bin/obsolete directory
- Update documentation with new workflow instructions
- Create migration guide for transitioning to new workflow
- Update Memory Bank with workflow improvements

The new workflow provides:
- More reliable environment setup
- Faster setup process
- Offline development capability
- Consistent development environments across team members

Breaking changes:
- setup-dev.sh is replaced by setup-from-backup.sh
- sync-and-setup.sh is replaced by separate scripts
- verify-with-wpcli.sh is no longer used

Migration path is documented in MIGRATION_GUIDE.md
2025-03-26 11:26:18 -03:00

68 lines
1.4 KiB
PHP

<?php
/**
* Initialise and load the plugin under the proper namespace.
*
* @package Code_Snippets
*/
namespace Code_Snippets;
/**
* The version number for this release of the plugin.
* This will later be used for upgrades and enqueuing files.
*
* This should be set to the 'Plugin Version' value defined
* in the plugin header.
*
* @var string A PHP-standardized version number string.
*/
const PLUGIN_VERSION = CODE_SNIPPETS_VERSION;
/**
* The full path to the main file of this plugin.
*
* This can later be used with functions such as
* plugin_dir_path(), plugins_url() and plugin_basename()
* to retrieve information about plugin paths.
*
* @var string
*/
const PLUGIN_FILE = CODE_SNIPPETS_FILE;
/**
* Name of the group used for caching data.
*
* @var string
*/
const CACHE_GROUP = 'code_snippets';
/**
* Namespace used for REST API endpoints.
*
* @var string
*/
const REST_API_NAMESPACE = 'code-snippets/v';
// Load dependencies with Composer.
require_once dirname( __DIR__ ) . '/vendor/autoload.php';
/**
* Retrieve the instance of the main plugin class.
*
* @return Plugin
* @since 2.6.0
*/
function code_snippets(): Plugin {
static $plugin;
if ( is_null( $plugin ) ) {
$plugin = new Plugin( PLUGIN_VERSION, PLUGIN_FILE );
}
return $plugin;
}
code_snippets()->load_plugin();
// Execute the snippets once the plugins are loaded.
add_action( 'plugins_loaded', __NAMESPACE__ . '\execute_active_snippets', 1 );