-
Notifications
You must be signed in to change notification settings - Fork 0
/
gecka.php
57 lines (45 loc) · 1.57 KB
/
gecka.php
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
51
52
53
54
55
56
57
<?php
/*
* Plugin Name: Gecka Library
* Plugin URI: http://gecka-apps.com/wordpress-plugins/gecka-library
* Description: A usefull library of classes and additions for plugin developpement
* Version: 1.0-beta1
* Author: Gecka
* Author URI: http://gecka.nc
* License: GPL2+
* Text Domain: gecka
* Domain Path: /Languages/
*/
// version
define( 'GK_VERSION', '1.0-beta1');
// absolute path
define( 'GK_PATH', dirname(__FILE__) );
// url
define( 'GK_URL', plugins_url('', __FILE__) );
// Load the textdomain
load_plugin_textdomain('gecka', false, dirname(plugin_basename(__FILE__)) . '/Languages');
// require PHP 5
function gecka_activation_check() {
if (version_compare(PHP_VERSION, '5.2.4', '<')) {
deactivate_plugins( basename(dirname(__FILE__)) . '/' . basename(__FILE__) ); // Deactivate ourself
wp_die( sprintf( __("Sorry, the Gecka Library requires PHP 5.2.4 or higher. You use PHP %s. Ask your host how to enable PHP 5.2.4 or higher as the default on your servers.", 'gecka'), PHP_VERSION) );
}
}
register_activation_hook(__FILE__, 'gecka_activation_check');
// ensure PHP5 code doesn't throw an error on PHP4 installs
if ( ! version_compare(PHP_VERSION, '5.2.4', '<') ) {
/**
* Gecka library init hook
* You can use the gecka-init action to check that the Gecka Library is
* installed and active
*/
function gecka_init() {
do_action( 'gecka-init' );
}
add_action( 'plugins_loaded', 'gecka_init', -50 );
require_once 'gecka.class.php';
$Gecka = Gecka::instance(GK_PATH);
}
function gecka_version () {
return GK_VERSION;
}