<?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.
$code_snippets_autoloader = require dirname( __DIR__ ) . '/vendor/autoload.php';
// Remove all original (non-prefixed) vendor namespace mappings to prevent collisions with other plugins.
// Since Imposter rewrites namespaces to Code_Snippets\Vendor\*, we need to remove the original PSR-4
// mappings that Composer generates so other plugins can load their own copies of these libraries.
if ( $code_snippets_autoloader instanceof \Composer\Autoload\ClassLoader ) {
$prefixes = $code_snippets_autoloader->getPrefixesPsr4();
$our_prefix = 'Code_Snippets\\Vendor\\';
foreach ( $prefixes as $namespace => $paths ) {
// Remove any non-Code_Snippets namespace that has a corresponding prefixed version
if ( strpos( $namespace, $our_prefix ) === false ) {
$prefixed_namespace = $our_prefix . $namespace;
if ( isset( $prefixes[ $prefixed_namespace ] ) ) {
$code_snippets_autoloader->setPsr4( $namespace, [] );
}
}
}
}
/**
* 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();
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| admin-menus/ | 2026-07-30 21:37 | 28.18 KB | 76129f60960:kunden | dxwrx-r--r | |
| cloud/ | 2026-07-30 21:37 | 41.72 KB | 76129f60960:kunden | dxwrx-r--r | |
| evaluation/ | 2026-07-30 21:37 | 9.05 KB | 76129f60960:kunden | dxwrx-r--r | |
| export/ | 2026-07-30 21:37 | 11.41 KB | 76129f60960:kunden | dxwrx-r--r | |
| flat-files/ | 2026-07-30 21:37 | 24.48 KB | 76129f60960:kunden | dxwrx-r--r | |
| front-end/ | 2026-07-30 21:37 | 15.83 KB | 76129f60960:kunden | dxwrx-r--r | |
| migration/ | 2026-07-30 21:37 | 25.78 KB | 76129f60960:kunden | dxwrx-r--r | |
| rest-api/ | 2026-07-30 21:37 | 22.67 KB | 76129f60960:kunden | dxwrx-r--r | |
| settings/ | 2026-07-30 21:37 | 41.32 KB | 76129f60960:kunden | dxwrx-r--r | |
| views/ | 2026-07-30 21:37 | 18.36 KB | 76129f60960:kunden | dxwrx-r--r | |
| class-admin.php | 2026-07-30 21:37 | 12 KB | 76129f60960:kunden | -xw-x----- | |
| class-contextual-help.php | 2026-07-30 21:37 | 6.46 KB | 76129f60960:kunden | -xw-x----- | |
| class-data-item.php | 2026-07-30 21:37 | 6.56 KB | 76129f60960:kunden | -xw-x----- | |
| class-db.php | 2026-07-30 21:37 | 10.12 KB | 76129f60960:kunden | -xw-x----- | |
| class-licensing.php | 2026-07-30 21:37 | 314 B | 76129f60960:kunden | -xw-x----- | |
| class-list-table.php | 2026-07-30 21:37 | 43.83 KB | 76129f60960:kunden | -xw-x----- | |
| class-plugin.php | 2026-07-30 21:37 | 11.08 KB | 76129f60960:kunden | -xw-x----- | |
| class-snippet.php | 2026-07-30 21:37 | 13.88 KB | 76129f60960:kunden | -xw-x----- | |
| class-upgrade.php | 2026-07-30 21:37 | 6.55 KB | 76129f60960:kunden | -xw-x----- | |
| class-validator.php | 2026-07-30 21:37 | 7.02 KB | 76129f60960:kunden | -xw-x----- | |
| class-welcome-api.php | 2026-07-30 21:37 | 9.53 KB | 76129f60960:kunden | -xw-x----- | |
| deactivation-notice.php | 2026-07-30 21:37 | 1.94 KB | 76129f60960:kunden | -xw-x----- | |
| editor.php | 2026-07-30 21:37 | 3.48 KB | 76129f60960:kunden | -xw-x----- | |
| load.php | 2026-07-30 21:37 | 2.16 KB | 76129f60960:kunden | -xw-x----- | |
| snippet-ops.php | 2026-07-30 21:37 | 20.99 KB | 76129f60960:kunden | -xw-x----- | |
| strings.php | 2026-07-30 21:37 | 1.8 KB | 76129f60960:kunden | -xw-x----- | |
| uninstall.php | 2026-07-30 21:37 | 2.54 KB | 76129f60960:kunden | -xw-x----- | |