本文整理汇总了PHP中Main::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::init方法的具体用法?PHP Main::init怎么用?PHP Main::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Main
*
* 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;
* version 3 of the License.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
/**
*
*/
set_time_limit(0);
header("Content-Type: text/html; charset=utf-8");
define("UNIT_TEST", false);
require_once "config/version.php";
require_once "core/include/base/system/system_config.class.php";
SystemConfig::load_system_config("config/main.php");
date_default_timezone_set($server['timezone']);
require_once "core/include/base/system/template.class.php";
require_once "core/include/base/system/html_template.class.php";
require_once "core/include/base/system/js_template.class.php";
Template::set_fallback_folder("xhtml");
Template::set_current_folder("xhtml");
require_once "core/main.php";
$main = new Main();
$main->init();
示例2: translator
translator_edit($option, $task);
break;
case 'del_lang':
case 'lang':
translator($option);
break;
case 'recurse_database':
goRecurseDatabases();
break;
case 'recurse_files':
goRecurseFiles();
break;
case 'cleanup':
include_once "classes/main.class.php";
$main = new Main();
$main->init($_CONFIG);
$main->cleanUp();
break;
case 'refresh':
generateBackuprefresh($cid, $option, $_REQUEST['backup'], $_CONFIG['refresh_mode']);
break;
case 'generate':
if (empty($_POST) || !wp_verify_nonce($_POST['csrf'], 'generate')) {
print 'Sorry, your nonce did not verify.';
exit;
}
if ($_CONFIG['refresh_mode']) {
$_REQUEST['mode'] = "start";
if ($_CONFIG['enable_db_backup']) {
goRecurseDatabases();
}
示例3: init
<?php
/*
* Created on 19.09.2009
*
* @see http://github.com/swwwfactory/entry8
*
*/
namespace swwwfactory\Dev;
class Main
{
public static function init()
{
//called
include __DIR__ . '/utils.php';
include __DIR__ . '/loader.php';
}
public static function setup()
{
//setup
echo 'Called phar stub with method: ', __METHOD__, PHP_EOL;
}
}
Main::init();
示例4: function
<?php
/**
* Plugin Name: Combined Query
* Description: This plugin allows you to combine multiple WP_Query() queries, into a single one.
* Plugin URI: https://github.com/birgire/wp-combined-queries
* Author: birgire
* GitHub Plugin URI: https://github.com/birgire/wp-combined-queries.git
* Author URI: https://github.com/birgire
* License: MIT
* Version: 1.0.0
*/
namespace Birgir\CombinedQuery;
/**
* Autoload
*/
\add_action('plugins_loaded', function () {
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
}
});
/**
* Init
*/
\add_action('init', function () {
if (class_exists(__NAMESPACE__ . '\\Main')) {
$o = new Main();
$o->init(new Generator(new EmptyQuery()), $GLOBALS['wpdb']);
}
});