-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknowledge.php
More file actions
48 lines (40 loc) · 1.27 KB
/
knowledge.php
File metadata and controls
48 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Plugin Name: Knowledge
* Plugin URI: https://github.com/stevecopeza/knowledge
* Description: A local-first, ownership-first knowledge repository designed for epistemic durability.
* Version: 0.1.1
* Author: Steve Cope
* Author URI: https://cope.zone
* Text Domain: knowledge
* Domain Path: /languages
* Requires PHP: 8.0
*/
namespace Knowledge;
use Knowledge\Infrastructure\Plugin;
// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Define Constants
define( 'KNOWLEDGE_VERSION', '0.1.0' );
define( 'KNOWLEDGE_PATH', plugin_dir_path( __FILE__ ) );
define( 'KNOWLEDGE_URL', plugin_dir_url( __FILE__ ) );
define( 'KNOWLEDGE_DATA_PATH', WP_CONTENT_DIR . '/kb-data' );
// Load Autoloader
if ( file_exists( KNOWLEDGE_PATH . 'vendor/autoload.php' ) ) {
require KNOWLEDGE_PATH . 'vendor/autoload.php';
}
// Initialize Plugin
function knowledge_init() {
static $plugin = null;
if ( $plugin === null ) {
$plugin = new Plugin();
$plugin->run();
}
return $plugin;
}
add_action( 'plugins_loaded', 'Knowledge\\knowledge_init' );
// Register Activation Hook
register_activation_hook( __FILE__, [ 'Knowledge\\Infrastructure\\Plugin', 'activate' ] );
register_deactivation_hook( __FILE__, [ 'Knowledge\\Infrastructure\\Plugin', 'deactivate' ] );