本文整理汇总了PHP中Guardian::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Guardian::get方法的具体用法?PHP Guardian::get怎么用?PHP Guardian::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guardian
的用法示例。
在下文中一共展示了Guardian::get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
return array('timezone' => 'Asia/Jakarta', 'charset' => 'utf-8', 'language' => 'en_US', 'language_direction' => 'ltr', 'shield' => 'normal', 'per_page' => 7, 'email_notification' => true, 'comments' => true, 'comment_moderation' => false, 'comment_notification_email' => true, 'resource_versioning' => true, 'excerpt_length' => 300, 'excerpt_tail' => '…', 'html_minifier' => true, 'html_parser' => HTML_PARSER, 'widget_year_first' => true, 'widget_include_css' => true, 'widget_include_js' => true, 'title' => 'My Awesome Site', 'title_separator' => ' – ', 'slogan' => 'Site slogan goes here.', 'description' => 'Site description goes here.', 'keywords' => 'blog, diary, notes, personal', 'spam_keywords' => "", 'author' => Guardian::get('author'), 'author_profile_url' => "", 'author_email' => Guardian::get('email'), 'index' => array('title' => 'Article', 'slug' => 'article', 'per_page' => 7), 'tag' => array('title' => 'Tagged in %s', 'slug' => 'tag', 'per_page' => 7), 'archive' => array('title' => 'Archive %s', 'slug' => 'archive', 'per_page' => 7), 'search' => array('title' => 'Search Results for “%s”', 'slug' => 'search', 'per_page' => 7), 'manager' => array('title' => 'Manager', 'slug' => 'manager', 'per_page' => 7), 'defaults' => array('article_title' => "", 'article_content' => "", 'article_custom_css' => "<style media=\"screen\">\n\n</style>", 'article_custom_js' => "<script>\n\n</script>", 'page_title' => "", 'page_content' => "", 'page_custom_css' => "<style media=\"screen\">\n\n</style>", 'page_custom_js' => "<script>\n\n</script>"));
示例2: array
File::open($file)->moveTo(SHIELD . DS . $folder . DS . $name);
}
Notify::success(Config::speak('notify_file_updated', '<code>' . File::B($path) . '</code>'));
Weapon::fire('on_shield_update', array($G, $P));
Weapon::fire('on_shield_repair', array($G, $P));
Guardian::kick($config->manager->slug . '/shield/' . $folder . '/repair/file:' . File::url($name));
}
}
Shield::lot(array('segment' => 'shield', 'the_shield' => $folder, 'the_name' => $path, 'the_content' => $content))->attach('manager', false);
});
/**
* Shield Killer
* -------------
*/
Route::accept(array($config->manager->slug . '/shield/kill/id:(:any)', $config->manager->slug . '/shield/(:any)/kill/file:(:all)'), function ($folder = "", $path = false) use($config, $speak) {
if (Guardian::get('status') !== 'pilot' || $folder === "") {
Shield::abort();
}
$info = Shield::info($folder, true);
if ($path) {
$path = File::path($path);
if (!($file = File::exist(SHIELD . DS . $folder . DS . $path))) {
Shield::abort();
// File not found!
}
} else {
if (!($file = File::exist(SHIELD . DS . $folder))) {
Shield::abort();
// Folder not found!
}
}
示例3: explode
$new = explode(DS, $new);
Session::set('recent_file_update', $new[0]);
Weapon::fire('on_asset_update', array($P, $P));
Weapon::fire('on_asset_repair', array($P, $P));
Guardian::kick($config->manager->slug . '/asset/1' . $p);
}
}
}
Shield::lot(array('segment' => 'asset', 'the_name' => $old, 'the_content' => is_file(ASSET . DS . $old) && strpos(',' . SCRIPT_EXT . ',', ',' . File::E($old) . ',') !== false ? File::open(ASSET . DS . $old)->read() : false))->attach('manager', false);
});
/**
* Asset Killer
* ------------
*/
Route::accept($config->manager->slug . '/asset/kill/(file|files):(:all)', function ($path = "", $name = "") use($config, $speak) {
if (Guardian::get('status') !== 'pilot') {
Shield::abort();
}
$name = File::path($name);
$p = Request::get('path');
$p = $p ? '?path=' . urlencode($p) : "";
if (strpos($name, ';') !== false) {
$deletes = explode(';', $name);
} else {
if (!File::exist(ASSET . DS . $name)) {
Shield::abort();
// File not found!
} else {
$deletes = array($name);
}
}
示例4: function
*/
Weapon::add('shield_before', function () {
$config = Config::get();
$speak = Config::speak();
$total = $config->__total_comments;
$destination = LOG . DS . 'comments.total.log';
if ($file = File::exist($destination)) {
$old = (int) File::open($file)->read();
$total = $total > $old ? $total - $old : 0;
} else {
File::write($total)->saveTo($destination, 0600);
}
// Side Menu
$menus = array($speak->article => array('icon' => 'file-text', 'url' => $config->manager->slug . '/article', 'stack' => 9.01), $speak->page => array('icon' => 'file', 'url' => $config->manager->slug . '/page', 'stack' => 9.02), $speak->tag => array('icon' => 'tags', 'url' => $config->manager->slug . '/tag', 'stack' => 9.039999999999999), $speak->asset => array('icon' => 'briefcase', 'url' => $config->manager->slug . '/asset', 'stack' => 9.06));
// Top Menu
$bars = array($speak->user => array('icon' => 'user', 'description' => Guardian::get('author'), 'stack' => 9), $speak->log_out => array('icon' => 'sign-out', 'url' => $config->manager->slug . '/logout', 'description' => $speak->log_out, 'stack' => 30));
// only for `pilot`
if (Guardian::happy(1)) {
$menus[$speak->config] = array('icon' => 'cogs', 'url' => $config->manager->slug . '/config', 'stack' => 9);
$menus[$speak->comment] = array('icon' => 'comments', 'url' => $config->manager->slug . '/comment', 'count' => $total, 'stack' => 9.029999999999999);
$menus[$speak->menu] = array('icon' => 'bars', 'url' => $config->manager->slug . '/menu', 'stack' => 9.050000000000001);
$menus[$speak->field] = array('icon' => 'th-list', 'url' => $config->manager->slug . '/field', 'stack' => 9.07);
$menus[$speak->shortcode] = array('icon' => 'coffee', 'url' => $config->manager->slug . '/shortcode', 'stack' => 9.08);
$menus[$speak->shield] = array('icon' => 'shield', 'url' => $config->manager->slug . '/shield', 'stack' => 9.09);
$menus[$speak->plugin] = array('icon' => 'plug', 'url' => $config->manager->slug . '/plugin', 'stack' => 9.1);
$menus[$speak->cache] = array('icon' => 'clock-o', 'url' => $config->manager->slug . '/cache', 'stack' => 9.109999999999999);
$bars[$speak->config] = array('icon' => 'cog', 'url' => $config->manager->slug . '/config', 'stack' => 9.01);
if ($errors = File::exist(ini_get('error_log'))) {
$total = 0;
if (filesize($errors) > MAX_ERROR_FILE_SIZE) {
File::open($errors)->delete();
示例5: array
<?php
return array('timezone' => 'Asia/Jakarta', 'charset' => 'utf-8', 'language' => 'en_US', 'language_direction' => 'ltr', 'shield' => 'normal', 'per_page' => 7, 'comments' => array('allow' => true, 'moderation' => false), 'excerpt' => array('length' => 300, 'prefix' => "", 'suffix' => '…', 'id' => 'more:%d'), 'html_parser' => array('type' => array('HTML' => 'HTML'), 'active' => 'HTML'), 'widget_include_css' => true, 'widget_include_js' => true, 'title' => 'My Awesome Site', 'title_separator' => ' – ', 'slogan' => 'Site slogan goes here.', 'description' => 'Site description goes here.', 'keywords' => 'blog, diary, notes, personal', 'keywords_spam' => "", 'author' => array('name' => Guardian::get('author'), 'email' => Guardian::get('email'), 'url' => ""), 'index' => array('title' => 'Article', 'slug' => 'article', 'per_page' => 7), 'tag' => array('title' => 'Tagged in %s', 'slug' => 'tag', 'per_page' => 7), 'archive' => array('title' => 'Archive %s', 'slug' => 'archive', 'per_page' => 7), 'search' => array('title' => 'Search for “%s”', 'slug' => 'search', 'per_page' => 7), 'manager' => array('title' => "", 'slug' => 'manager', 'per_page' => 7), 'defaults' => array('article_title' => "", 'article_content' => "", 'article_css' => "<style media=\"screen\">\n\n</style>", 'article_js' => "<script>\n\n</script>", 'page_title' => "", 'page_content' => "", 'page_css' => "<style media=\"screen\">\n\n</style>", 'page_js' => "<script>\n\n</script>"));
示例6: call_user_func
Notify::success(Config::speak('notify_success_' . ($id ? 'updated' : 'created'), $title) . ($extension === '.txt' ? ' <a class="pull-right" href="' . call_user_func('Get::' . $segment . 'Anchor', $_)->url . '" target="_blank"><i class="fa fa-eye"></i> ' . $speak->view . '</a>' : ""));
Weapon::fire(array('on_' . $segment . '_update', 'on_' . $segment . '_' . ($id ? 'repair' : 'construct')), array($G, $P));
Guardian::kick($config->manager->slug . '/' . $segment . '/repair/id:' . Date::format($date, 'U'));
}
}
Shield::lot(array('segment' => $segment))->attach('manager');
});
/**
* Post Killer
* -----------
*/
Route::accept($config->manager->slug . '/(' . $post . ')/kill/id:(:num)', function ($segment = "", $id = "") use($config, $speak, $response) {
if (!($post = call_user_func('Get::' . $segment, $id, array('content', 'tags')))) {
Shield::abort();
}
if (!Guardian::happy(1) && Guardian::get('author') !== $post->author) {
Shield::abort();
}
Config::set(array('page_title' => $speak->deleting . ': ' . $post->title . $config->title_separator . $config->manager->title, 'page' => $post, 'cargo' => 'kill.post.php'));
$G = array('data' => Mecha::A($post));
if ($request = Request::post()) {
Guardian::checkToken($request['token']);
File::open($post->path)->delete();
// Deleting response(s) ...
if ($responses = call_user_func('Get::' . $response . 's', 'DESC', 'post:' . $id, 'txt,hold')) {
foreach ($responses as $v) {
File::open($v)->delete();
}
}
$P = array('data' => $request);
include __DIR__ . DS . 'task.kill.substance.php';
示例7: function
Weapon::add('tab_content_2_before', function ($page, $segment) use($config, $speak) {
$segment = $segment[0];
include __DIR__ . DS . 'unit' . DS . 'form' . DS . 'fields[].php';
}, 1);
File::write($config->{'__total_' . $segment . 's'})->saveTo(LOG . DS . $segment . 's.total.log', 0600);
if ($id && ($response = call_user_func('Get::' . $segment, $id, array('message')))) {
if (!Guardian::happy(1)) {
Shield::abort();
}
$title = $speak->editing . ': ' . ($response->permalink !== '#' ? Cell::a($response->permalink, $speak->{$segment}, true) : $speak->{$segment}) . $config->title_separator . $config->manager->title;
} else {
if ($id !== false) {
Shield::abort();
// File not found!
}
$response = Mecha::O(array('id' => "", 'path' => "", 'post' => "", 'parent' => "", 'state' => 'pending', 'date' => array('W3C' => ""), 'name_raw' => Guardian::get('author'), 'email' => Guardian::get('email'), 'url_raw' => "", 'status_raw' => Guardian::get('status_raw'), 'content_type_raw' => $config->html_parser->active, 'fields_raw' => array(), 'message_raw' => ""));
$title = Config::speak('manager.title_new_', $speak->{$segment}) . $config->title_separator . $config->manager->title;
}
$G = array('data' => Mecha::A($response));
Config::set(array('page_title' => $title, 'page' => $response, 'html_parser' => array('active' => $response->content_type_raw), 'cargo' => 'repair.response.php'));
if ($request = Request::post()) {
$request = Filter::apply('request:__' . $segment, $request, $id);
Guardian::checkToken($request['token']);
$rid = $id ? $id : time();
$request['post'] = Request::post('post');
$request['parent'] = Request::post('parent');
$extension = $request['extension'];
$name = $request['name'];
$email = $request['email'];
$url = isset($request['url']) && trim($request['url']) !== "" ? $request['url'] : false;
$message = $request['message'];
示例8: function
}
}
Weapon::add('SHIPMENT_REGION_BOTTOM', function () {
echo Asset::javascript('manager/assets/sword/editor.compose.js', "", 'sword/editor.compose.min.js');
}, 11);
Shield::lot(array('segment' => 'page', 'default' => $page))->attach('manager', false);
});
/**
* Page Killer
* -----------
*/
Route::accept($config->manager->slug . '/page/kill/id:(:num)', function ($id = "") use($config, $speak) {
if (!($page = Get::page($id, array('comments')))) {
Shield::abort();
}
if (Guardian::get('status') !== 'pilot' && Guardian::get('author') !== $page->author) {
Shield::abort();
}
Config::set(array('page_title' => $speak->deleting . ': ' . $page->title . $config->title_separator . $config->manager->title, 'page' => $page, 'cargo' => DECK . DS . 'workers' . DS . 'kill.page.php'));
$G = array('data' => Mecha::A($page));
if ($request = Request::post()) {
Guardian::checkToken($request['token']);
File::open($page->path)->delete();
$task_connect = $page;
$P = array('data' => $request);
include DECK . DS . 'workers' . DS . 'task.field.3.php';
include DECK . DS . 'workers' . DS . 'task.custom.3.php';
Notify::success(Config::speak('notify_success_deleted', $page->title));
Weapon::fire('on_page_update', array($G, $G));
Weapon::fire('on_page_destruct', array($G, $G));
Guardian::kick($config->manager->slug . '/page');
示例9: array
?>
</span>
</td>
<td>
<?php
echo Form::text('name[]', $tag->name, null, array('class' => 'input-block', 'readonly' => Guardian::get('status') !== 'pilot' ? true : null));
?>
</td>
<td>
<?php
echo Form::text('slug[]', $tag->slug, null, array('class' => 'input-block', 'readonly' => Guardian::get('status') !== 'pilot' ? true : null));
?>
</td>
<td>
<?php
echo Form::text('description[]', Converter::toText($tag->description), null, array('class' => 'input-block', 'readonly' => Guardian::get('status') !== 'pilot' ? true : null));
?>
</td>
</tr>
<?php
}
?>
<tr>
<td class="text-right">
<?php
echo Form::text('id[]', max($id) + 1, null, array('class' => array('input-block', 'no-appearance'), 'autocomplete' => 'off'));
?>
</td>
<td>
<?php
echo Form::text('name[]', Guardian::wayback('name.' . (max($id) + 1)), null, array('class' => 'input-block'));