-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDspace.php
79 lines (67 loc) · 2.13 KB
/
Dspace.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* Plugin Name: Dspace-Plugin
* Plugin URI: http://sedici.unlp.edu.ar/
* Description: This plugin connects the repository SEDICI in wordpress, with the purpose of showing the publications of authors or institutions. [2.1.0] Added support to Dspace 7 API + Video display.
* Version: 2.1-0
* Author: SEDICI - Pablo Terrone - Ezequiel Manzur
* Author URI: http://sedici.unlp.edu.ar/
* Text Domain: wp-dspace
* Copyright (c) 2015 SEDICI UNLP, http://sedici.unlp.edu.ar
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*/
namespace Wp_dspace;
define( __NAMESPACE__ . '\DS', __NAMESPACE__ . '\\' );
define( DS . 'PLUGIN_NAME', 'wp-dspace' );
define( DS . 'PLUGIN_VERSION', '2.2-0' );
define( DS . 'PLUGIN_NAME_DIR', plugin_dir_path( __FILE__ ) );
define( DS . 'PLUGIN_NAME_URL', plugin_dir_url( __FILE__ ) );
define( DS . 'PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
define( DS . 'PLUGIN_TEXT_DOMAIN', 'wp-dspace' );
/**
* Autoload Classes
*/
require_once( PLUGIN_NAME_DIR . 'inc/libraries/autoloader_wp_dspace.php' );
require_once 'configuration/config.php';
require_once 'configuration/class-configuration.php';
foreach ( glob ( "configuration/*_config.php" ) as $app ) {
require_once $app;
}
/**
* Register Activation and Deactivation Hooks
* This action is documented in inc/core/class-activator.php
*/
register_activation_hook( __FILE__, array( DS . 'Inc\Core\Activator', 'activate' ) );
/**
* The code that runs during plugin deactivation.
* This action is documented inc/core/class-deactivator.php
*/
register_deactivation_hook( __FILE__, array( DS . 'Inc\Core\Deactivator', 'deactivate' ) );
/**
* Plugin Singleton Container
*/
class WP_Dspace {
static $init;
/**
* Loads the plugin
* @access public
*/
public static function init() {
if ( null == self::$init ) {
self::$init = new Inc\Core\Init();
self::$init->run();
}
return self::$init;
}
}
/*
* Comienza la ejecución del plugin
*/
function wp_dspace_init(){
return WP_Dspace::init();
}
/**
* Si se accede desde afuera de wordpress aborta la ejecución.
*/
if ( ! defined( 'WPINC' ) ) die;
wp_dspace_init();