本文整理汇总了PHP中pb_backupbuddy::_plugin_url方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy::_plugin_url方法的具体用法?PHP pb_backupbuddy::_plugin_url怎么用?PHP pb_backupbuddy::_plugin_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_backupbuddy
的用法示例。
在下文中一共展示了pb_backupbuddy::_plugin_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init($pluginbuddy_settings, $pluginbuddy_init = 'init.php')
{
self::$start_time = microtime(true);
self::$_settings = array_merge((array) self::$_settings, (array) $pluginbuddy_settings);
// Merge settings over framework defaults.
// Set up various path variables.
self::$_plugin_path = dirname(dirname(__FILE__));
$relative_path = ltrim(str_replace('\\', '/', str_replace(rtrim(ABSPATH, '\\\\/'), '', self::$_plugin_path)), '\\\\/');
self::$_plugin_url = site_url() . '/' . ltrim($relative_path, '/');
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
self::$_plugin_url = str_replace('http://', 'https://', self::$_plugin_url);
}
// Handle https URLs properly.
if (isset($_GET['page'])) {
// If in an admin page then append page querystring.
self::$_self_link = array_shift(explode('?', $_SERVER['REQUEST_URI'])) . '?page=' . htmlentities($_GET['page']);
}
// Set the init file.
self::$_settings['init'] = $pluginbuddy_init;
// Removed. see add_page(). Now using create_function() to bypass need for this. self::$_callbacks = new pluginbuddy_callbacks();
// Load thumbnail live downsizer if needed.
if (isset(self::$_settings['modules']['downsizer']) && self::$_settings['modules']['downsizer'] === true) {
require_once self::$_plugin_path . '/pluginbuddy/_image_downsize.php';
}
// filesystem class controller.
if (isset(self::$_settings['modules']['filesystem']) && self::$_settings['modules']['filesystem'] === true) {
self::init_class_controller('filesystem');
}
// format class controller.
if (isset(self::$_settings['modules']['format']) && self::$_settings['modules']['format'] === true) {
self::init_class_controller('format');
}
if (is_admin()) {
// Load automatic upgrades system if needed.
if (isset(self::$_settings['modules']['updater']) && self::$_settings['modules']['updater'] === true) {
require_once self::$_plugin_path . '/pluginbuddy/lib/updater/updater.php';
$preloader_class = 'pb_' . self::settings('slug') . '_updaterpreloader';
$updater_preloader = new $preloader_class(self::settings('slug'));
}
// Load UI system.
self::init_class_controller('ui');
// Load media library system if needed.
if (isset(self::$_settings['modules']['media_library']) && self::$_settings['modules']['media_library'] === true) {
self::add_ajax('media_library');
}
// Add troubleshooting sending system.
self::add_ajax('pbframework_troubleshooting');
// Load activation hook if in admin and activation file exists.
if (file_exists(self::$_plugin_path . '/controllers/activation.php')) {
register_activation_hook(self::$_plugin_path . '/' . pb_backupbuddy::settings('init'), create_function('', "require_once('" . self::$_plugin_path . "/controllers/activation.php');"));
// Run some code when plugin is activated in dashboard.
}
} else {
// Public side.
// Do nothing.
}
}
示例2: init
public static function init($pluginbuddy_settings, $pluginbuddy_init = 'init.php')
{
self::$start_time = microtime(true);
self::$_settings = array_merge((array) self::$_settings, (array) $pluginbuddy_settings);
// Merge settings over framework defaults.
if (function_exists('plugin_dir_url')) {
// URL and path functions available (not in ImportBuddy but inside WordPress).
self::$_plugin_path = rtrim(plugin_dir_path(dirname(__FILE__)), '/\\');
self::$_plugin_url = rtrim(plugin_dir_url(dirname(__FILE__)), '/\\');
} else {
// Generate URL and paths old way (old WordPress versions or inside ImportBuddy).
self::$_plugin_path = dirname(dirname(__FILE__));
$relative_path = ltrim(str_replace('\\', '/', str_replace(rtrim(ABSPATH, '\\\\/'), '', self::$_plugin_path)), '\\\\/');
if (defined('PB_STANDALONE') && PB_STANDALONE === true) {
self::$_plugin_url = 'importbuddy';
// Relative importbuddy path.
} else {
// Normal full path.
self::$_plugin_url = site_url() . '/' . ltrim($relative_path, '/');
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
// Handle https URLs properly.
self::$_plugin_url = str_replace('http://', 'https://', self::$_plugin_url);
}
}
}
if (isset($_GET['page'])) {
// If in an admin page then append page querystring.
$arr = explode('?', $_SERVER['REQUEST_URI']);
// avoid reference error by setting here.
self::$_self_link = array_shift($arr) . '?page=' . htmlentities($_GET['page']);
unset($arr);
}
// Set the init file.
self::$_settings['init'] = $pluginbuddy_init;
// filesystem class controller.
if (isset(self::$_settings['modules']['filesystem']) && self::$_settings['modules']['filesystem'] === true) {
self::init_class_controller('filesystem');
}
// format class controller.
if (isset(self::$_settings['modules']['format']) && self::$_settings['modules']['format'] === true) {
self::init_class_controller('format');
}
if (is_admin()) {
// Load UI system.
self::init_class_controller('ui');
// Load activation hook if in admin and activation file exists.
if (file_exists(self::$_plugin_path . '/controllers/activation.php')) {
$escaped_plugin_path = preg_replace('#^\\\\\\\\#', '\\\\\\\\\\\\\\\\', self::$_plugin_path);
// Replace a path starting with \\ to be \\\\ so that when create_function parses the backslash it will return back to \\.
register_activation_hook(self::$_plugin_path . '/' . pb_backupbuddy::settings('init'), create_function('', "require_once('" . $escaped_plugin_path . "/controllers/activation.php');"));
// Run some code when plugin is activated in dashboard.
}
} else {
// Public side.
// Do nothing.
}
}