-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflight-log.php
More file actions
50 lines (43 loc) · 1.24 KB
/
Copy pathflight-log.php
File metadata and controls
50 lines (43 loc) · 1.24 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
49
50
<?php
/**
* Plugin Name: Flight Log
* Plugin URI: https://wpapps.kirk.at/apps/flight-log/
* Description: Log the flights you take and see where you have been: routes, airlines, aircraft and airports, summarized in a private app on your own site.
* Version: 1.0.0
* Requires at least: 6.0
* Tested up to: 7.1
* Requires PHP: 7.4
* Author: Alex Kirk
* Author URI: https://alex.kirk.at/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: flight-log
*/
namespace FlightLog;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once __DIR__ . '/vendor/autoload.php';
// Autoloader for plugin classes.
spl_autoload_register( function( $class ) {
$prefix = 'FlightLog\\';
$len = strlen( $prefix );
if ( strncmp( $prefix, $class, $len ) !== 0 ) {
return;
}
$file = __DIR__ . '/src/' . str_replace( '\\', '/', substr( $class, $len ) ) . '.php';
if ( file_exists( $file ) ) {
require $file;
}
} );
add_action( 'plugins_loaded', function() {
$app = new App();
$app->init();
} );
register_activation_hook( __FILE__, function() {
$app = new App();
$app->activate();
} );
register_deactivation_hook( __FILE__, function() {
flush_rewrite_rules();
} );