/
admin-page-framework.php
91 lines (90 loc) · 4.7 KB
/
admin-page-framework.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
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
Admin Page Framework v3.8.30b02 by Michael Uno
Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator>
<http://en.michaeluno.jp/admin-page-framework>
Copyright (c) 2013-2021, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> */
if (!class_exists('AdminPageFramework_Registry', false)):
abstract class AdminPageFramework_Registry_Base {
const VERSION = '3.8.30b02';
const NAME = 'Admin Page Framework';
const DESCRIPTION = 'Facilitates WordPress plugin and theme development.';
const URI = 'http://en.michaeluno.jp/admin-page-framework';
const AUTHOR = 'Michael Uno';
const AUTHOR_URI = 'http://en.michaeluno.jp/';
const COPYRIGHT = 'Copyright (c) 2013-2021, Michael Uno';
const LICENSE = 'MIT <http://opensource.org/licenses/MIT>';
const CONTRIBUTORS = '';
}
final class AdminPageFramework_Registry extends AdminPageFramework_Registry_Base {
const TEXT_DOMAIN = 'admin-page-framework';
const TEXT_DOMAIN_PATH = '/language';
static public $bIsMinifiedVersion = true;
static public $bIsDevelopmentVersion = true;
static public $sAutoLoaderPath;
static public $sIncludeClassListPath;
static public $aClassFiles = array();
static public $sFilePath = '';
static public $sDirPath = '';
static public function setUp($sFilePath = __FILE__) {
self::$sFilePath = $sFilePath;
self::$sDirPath = dirname(self::$sFilePath);
self::$sIncludeClassListPath = self::$sDirPath . '/admin-page-framework-include-class-list.php';
self::$aClassFiles = self::_getClassFilePathList(self::$sIncludeClassListPath);
self::$sAutoLoaderPath = isset(self::$aClassFiles['AdminPageFramework_RegisterClasses']) ? self::$aClassFiles['AdminPageFramework_RegisterClasses'] : '';
self::$bIsMinifiedVersion = class_exists('AdminPageFramework_MinifiedVersionHeader', false);
self::$bIsDevelopmentVersion = isset(self::$aClassFiles['AdminPageFramework_InclusionClassFilesHeader']);
}
static private function _getClassFilePathList($sInclusionClassListPath) {
$aClassFiles = array();
include ($sInclusionClassListPath);
return $aClassFiles;
}
static public function getVersion() {
if (!isset(self::$sAutoLoaderPath)) {
trigger_error(self::NAME . ': ' . ' : ' . sprintf(__('The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework'), __METHOD__, 'setUp()'), E_USER_WARNING);
return self::VERSION;
}
$_aMinifiedVesionSuffix = array(0 => '', 1 => '.min',);
$_aDevelopmentVersionSuffix = array(0 => '', 1 => '.dev',);
return self::VERSION . $_aMinifiedVesionSuffix[( integer )self::$bIsMinifiedVersion] . $_aDevelopmentVersionSuffix[( integer )self::$bIsDevelopmentVersion];
}
static public function getInfo() {
$_oReflection = new ReflectionClass(__CLASS__);
return $_oReflection->getConstants() + $_oReflection->getStaticProperties();
}
}
endif;
if (!class_exists('AdminPageFramework_Bootstrap', false)):
final class AdminPageFramework_Bootstrap {
static private $_bLoaded = false;
public function __construct($sLibraryPath) {
if (!$this->_isLoadable()) {
return;
}
AdminPageFramework_Registry::setUp($sLibraryPath);
if (AdminPageFramework_Registry::$bIsMinifiedVersion) {
return;
}
$this->_include();
}
private function _isLoadable() {
if (self::$_bLoaded) {
return false;
}
self::$_bLoaded = true;
return defined('ABSPATH');
}
private function _include() {
include (AdminPageFramework_Registry::$sAutoLoaderPath);
new AdminPageFramework_RegisterClasses('', array('exclude_class_names' => array('AdminPageFramework_MinifiedVersionHeader', 'AdminPageFramework_BeautifiedVersionHeader',),), AdminPageFramework_Registry::$aClassFiles);
self::$_bXDebug = isset(self::$_bXDebug) ? self::$_bXDebug : extension_loaded('xdebug');
if (self::$_bXDebug) {
new AdminPageFramework_Utility;
new AdminPageFramework_WPUtility;
}
}
static private $_bXDebug;
}
new AdminPageFramework_Bootstrap(__FILE__);
endif;