-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbbpresskr.php
executable file
·71 lines (57 loc) · 2.24 KB
/
bbpresskr.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
<?php
/**
* @package bbPressKR
* @copyright 2014-2015 082NeT([email protected])
*/
/*
Plugin Name: bbPressKR
Plugin URI: http://082net.com/
Description: bbPress 포럼 플러그인을 한국형 게시판으로 사용하기 위한 플러그인입니다. 기본, 갤러리, 웹진 형식을 지원하며, 기본적인 게시판별 권한을 지원합니다.
Version: 0.1
Author: 082NeT
Author URI: http://082net.com/
License: GPLv2 or later
Text Domain: bbpresskr
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if ( !defined( 'ABSPATH' ) ) die('Forbidden');
define( 'BBPKR_PATH', dirname(__FILE__) );
define( 'BBPKR_INC', BBPKR_PATH . '/inc' );
define( 'BBPKR_LIB', BBPKR_PATH . '/lib' );
spl_autoload_register(function ($class) {
// project-specific namespace prefix
$prefix = 'bbPressKR\\';
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
// no, move to the next registered autoloader
return;
}
// get the relative class name
$relativeClass = substr($class, $len);
$relativeClass = str_replace('_', '-', strtolower($relativeClass));
$fileInc = rtrim(BBPKR_INC, '/') . '/' . str_replace('\\', '/', $relativeClass) . '.php';
$fileLib = rtrim(BBPKR_LIB, '/') . '/' . str_replace('\\', '/', $relativeClass) . '.php';
// if the file exists, require it
if (file_exists($fileInc)) {
require $fileInc;
} elseif ( file_exists($fileLib) ) {
require $fileLib;
}
});
require( BBPKR_INC . '/functions-compat.php' );
require( BBPKR_INC . '/functions.php' );
global $bbpkr;
$bbpkr = bbpresskr();