本文整理汇总了PHP中Weapon::fire方法的典型用法代码示例。如果您正苦于以下问题:PHP Weapon::fire方法的具体用法?PHP Weapon::fire怎么用?PHP Weapon::fire使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon::fire方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
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';
// Deleting custom CSS and JavaScript file of post ...
File::open(CUSTOM . DS . Date::slug($id) . '.txt')->delete();
File::open(CUSTOM . DS . Date::slug($id) . '.draft')->delete();
Weapon::fire(array('on_custom_update', 'on_custom_destruct'), array($G, $P));
// Deleting custom PHP file of post ...
File::open(File::D($post->path) . DS . $post->slug . '.php')->delete();
Notify::success(Config::speak('notify_success_deleted', $post->title));
Weapon::fire(array('on_' . $segment . '_update', 'on_' . $segment . '_destruct'), array($G, $G));
Guardian::kick($config->manager->slug . '/' . $segment);
} else {
Notify::warning(Config::speak('notify_confirm_delete_', '<strong>' . $post->title . '</strong>'));
Notify::warning(Config::speak('notify_confirm_delete_page', strtolower($speak->{$segment}), strtolower($speak->{$response . 's'})));
}
Shield::lot(array('segment' => $segment))->attach('manager');
});
示例2:
<?php
Weapon::fire('SHIPMENT_REGION_TOP');
?>
<?php
Weapon::fire('shell_before');
?>
<?php
echo Asset::stylesheet(array($config->protocol . ICON_LIBRARY_PATH, 'assets/shell/atom.css', 'assets/shell/layout.css'));
?>
<?php
Weapon::fire('shell_after');
?>
</head>
<body>
<?php
Weapon::fire('cargo_before');
?>
<div class="blog-wrapper">
<header class="blog-header">
<?php
if ($config->url_current == $config->url) {
?>
<h1 class="blog-title"><?php
echo $config->title;
?>
</h1>
<?php
} else {
?>
<h1 class="blog-title"><a href="<?php
echo $config->url;
示例3: array
?>
<?php
Shield::chunk('comment.form.message');
?>
<?php
Weapon::fire('comment_form_textarea_after', $hooks);
?>
<?php
Shield::chunk('comment.form.math');
?>
<div class="grid-group">
<span class="grid span-1"></span>
<div class="grid span-5">
<p>
<?php
Weapon::fire('comment_form_button_before', $hooks);
?>
<?php
echo Form::button($speak->publish, null, 'submit', null, array('class' => array('btn', 'btn-construct')));
?>
<?php
Weapon::fire('comment_form_button_after', $hooks);
?>
</p>
<p><?php
echo $speak->comment_wizard;
?>
</p>
</div>
</div>
</form>
示例4: function
<?php
/**
* Shortcode Manager
* -----------------
*/
Route::accept($config->manager->slug . '/shortcode', function () use($config, $speak) {
if (!Guardian::happy(1)) {
Shield::abort();
}
$shortcodes = Get::state_shortcode(null, array(), false);
$G = array('data' => $shortcodes);
Config::set(array('page_title' => $speak->shortcodes . $config->title_separator . $config->manager->title, 'cargo' => 'cargo.shortcode.php'));
if ($request = Request::post()) {
$request = Filter::apply('request:__shortcode', $request);
Guardian::checkToken($request['token']);
$data = array();
for ($i = 0, $keys = $request['key'], $count = count($keys); $i < $count; ++$i) {
if (trim($keys[$i]) !== "") {
$data[$keys[$i]] = $request['value'][$i];
}
}
$P = array('data' => $data);
File::serialize($data)->saveTo(STATE . DS . 'shortcode.txt', 0600);
Notify::success(Config::speak('notify_success_updated', $speak->shortcode));
Weapon::fire('on_shortcode_update', array($G, $P));
Guardian::kick($config->url_current);
}
Shield::lot(array('segment' => 'shortcode', 'files' => Mecha::O($shortcodes)))->attach('manager');
});
示例5: array
<time datetime="<?php
echo $page->date->W3C;
?>
"><?php
echo $page->date->FORMAT_3;
?>
</time>
</span>
</div>
<div class="page-body"><?php
echo $page->description;
?>
</div>
<div class="page-footer">
<?php
Weapon::fire('page_footer', array($page));
?>
</div>
</li>
<?php
}
?>
</ol>
<?php
include DECK . DS . 'workers' . DS . 'unit.pager.1.php';
} else {
?>
<p><?php
echo Config::speak('notify_empty', strtolower($speak->pages));
?>
</p>
示例6: foreach
$route_cache = $cache_config['path'][$config->url_path];
} else {
foreach ($cache_config['path'] as $path => $exp) {
if (Route::is($path)) {
$route_cache = $exp;
break;
}
}
}
if ($route_cache !== false) {
Weapon::add('shield_before', function () use($config, $route_cache) {
$q = !empty($config->url_query) ? '.' . md5($config->url_query) : "";
$cache = CACHE . DS . str_replace(array('/', ':'), '.', $config->url_path) . $q . '.cache';
$time = file_exists($cache) ? filemtime($cache) : false;
if ($time !== false && ($route_cache === true || time() - $route_cache * 60 * 60 < $time)) {
$content = file_get_contents($cache);
if (strpos($content, '<?xml ') === 0 || strpos($content, '</html>') !== false) {
$content .= '<!-- cached: ' . date('Y-m-d H:i:s', $time) . ' -->';
}
$content = Filter::apply('cache:input', $content);
$content = Filter::apply('cache:output', $content);
echo $content;
exit;
}
Weapon::add('shield_after', function ($G) use($cache) {
$G['data']['cache'] = $cache;
File::write($G['data']['content'])->saveTo($cache);
Weapon::fire('on_cache_construct', array($G, $G));
});
});
}
示例7: array
<?php
$custom_ = CUSTOM . DS . Date::format($task_connect_page->date->W3C, 'Y-m-d-H-i-s');
if (file_exists($custom_ . $extension_o)) {
Weapon::fire('on_custom_update', array($G, $P));
if (trim(File::open($custom_ . $extension_o)->read()) === "" || trim(File::open($custom_ . $extension_o)->read()) === SEPARATOR || empty($css) && empty($js) || $css === $task_connect_page_css && $js === $task_connect_page_js) {
// Always delete empty custom CSS and JavaScript file(s) ...
File::open($custom_ . $extension_o)->delete();
Weapon::fire('on_custom_destruct', array($G, $P));
} else {
Page::content($css)->content($js)->saveTo($custom_ . $extension_o);
File::open($custom_ . $extension_o)->renameTo(Date::format($date, 'Y-m-d-H-i-s') . $extension);
Weapon::fire('on_custom_repair', array($G, $P));
}
} else {
if (!empty($css) && $css !== $task_connect_page_css || !empty($js) && $js !== $task_connect_page_js) {
Page::content($css)->content($js)->saveTo(CUSTOM . DS . Date::format($date, 'Y-m-d-H-i-s') . $extension_o);
Weapon::fire('on_custom_update', array($G, $P));
Weapon::fire('on_custom_construct', array($G, $P));
}
}
示例8: array
<a href="<?php
echo $response->permalink;
?>
" title="<?php
echo $speak->permalink;
?>
" rel="nofollow" target="_blank">#</a>
</span>
</div>
<div class="page-body"><?php
echo $response->message;
?>
</div>
<div class="page-footer">
<?php
Weapon::fire('comment_footer', array($response, $article = false));
?>
</div>
</li>
<?php
}
?>
</ol>
<?php
include DECK . DS . 'workers' . DS . 'unit.pager.1.php';
} else {
?>
<p><?php
echo Config::speak('notify_empty', strtolower($speak->comments));
?>
</p>
示例9: foreach
<?php
// Deleting substance(s)
if (isset($task_connect->fields) && is_object($task_connect->fields)) {
foreach ($task_connect->fields as $field) {
$file = SUBSTANCE . DS . $field;
if (file_exists($file) && is_file($file)) {
File::open($file)->delete();
Weapon::fire('on_substance_update', array($G, $P));
Weapon::fire('on_substance_destruct', array($G, $P));
}
}
}
示例10: array
$field = Request::post('fields', array());
include DECK . DS . 'workers' . DS . 'task.field.1.php';
// Temporarily disallow image(s) in comment to prevent XSS
$message = strip_tags($message, '<br><img>' . ($parser === 'HTML' ? '<a><abbr><b><blockquote><code><del><dfn><em><i><ins><p><pre><span><strong><sub><sup><time><u><var>' : ""));
$message = preg_replace('#(\\!\\[.*?\\]\\(.*?\\))#', '`$1`', $message);
$message = preg_replace('#<img(\\s[^<>]*?)>#', '<img$1>', $message);
Page::header(array('Name' => $name, 'Email' => $email, 'URL' => $url, 'Status' => Guardian::happy() ? 'pilot' : 'passenger', 'Content Type' => $parser, 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false, 'UA' => Get::UA(), 'IP' => Get::IP()))->content($message)->saveTo(RESPONSE . DS . $post . '_' . Date::format($id, 'Y-m-d-H-i-s') . '_' . ($parent ? Date::format($parent, 'Y-m-d-H-i-s') : '0000-00-00-00-00-00') . $extension);
Notify::success(Config::speak('notify_success_submitted', $speak->comment));
if ($extension === '.hold') {
Notify::info($speak->notify_info_comment_moderation);
}
Weapon::fire('on_comment_update', array($P, $P));
Weapon::fire('on_comment_construct', array($P, $P));
if ($config->comment_notification_email) {
$mail = '<p>' . Config::speak('comment_notification', $article->url . '#' . sprintf($comment_id, Date::format($id, 'U'))) . '</p>';
$mail .= '<p><strong>' . $name . ':</strong></p>';
$mail .= $parser !== 'HTML' ? Text::parse($message, '->html') : $message;
$mail .= '<p>' . Date::format($id, 'Y/m/d H:i:s') . '</p>';
// Sending email notification ...
if (!Guardian::happy()) {
if (Notify::send($request['email'], $config->author_email, $speak->comment_notification_subject, $mail, 'comment:')) {
Weapon::fire('on_comment_notification_construct', array($request, $config->author_email, $speak->comment_notification_subject, $mail));
}
}
}
Guardian::kick($config->url_current . (!Guardian::happy() && $config->comment_moderation ? '#' . $comment_form_id : '#' . sprintf($comment_id, Date::format($id, 'U'))));
} else {
Guardian::kick($config->url_current . '#' . $comment_form_id);
}
}
});
示例11: function
<?php
/**
* Menu Manager
* ------------
*/
Route::accept($config->manager->slug . '/menu', function () use($config, $speak) {
if (Guardian::get('status') !== 'pilot') {
Shield::abort();
}
$menus = Get::state_menu();
Config::set(array('page_title' => $speak->menus . $config->title_separator . $config->manager->title, 'cargo' => DECK . DS . 'workers' . DS . 'cargo.menu.php'));
$G = array('data' => array('content' => $menus));
if ($request = Request::post()) {
Guardian::checkToken($request['token']);
// Check for invalid input
if (preg_match('#(^|\\n)(\\t| {1,3})(?:[^ ])#', $request['content'])) {
Notify::error($speak->notify_invalid_indent_character);
Guardian::memorize($request);
}
$P = array('data' => $request);
if (!Notify::errors()) {
File::write($request['content'])->saveTo(STATE . DS . 'menu.txt', 0600);
Notify::success(Config::speak('notify_success_updated', $speak->menu));
Weapon::fire('on_menu_update', array($G, $P));
Guardian::kick($config->url_current);
}
}
Shield::lot(array('segment' => 'menu', 'the_content' => $menus))->attach('manager', false);
});
示例12: array
</h3>
<?php
$destinations = array(Jot::icon('file-text') . ' ' . $speak->article => ARTICLE, Jot::icon('file') . ' ' . $speak->page => PAGE, Jot::icon('magnet') . ' ' . $speak->extend => EXTEND, Jot::icon('comments') . ' ' . $speak->comment => COMMENT, Jot::icon('cogs') . ' ' . $speak->config => STATE, Jot::icon('briefcase') . ' ' . $speak->asset => ASSET, Jot::icon('shield') . ' ' . $speak->shield => SHIELD, Jot::icon('plug') . ' ' . $speak->plugin => PLUGIN);
?>
<?php
foreach ($destinations as $title => $destination) {
?>
<div class="media no-capture">
<h4 class="media-title"><?php
echo $title;
?>
</h4>
<div class="media-content">
<p><code><?php
echo $destination;
?>
</code></p>
<?php
echo Jot::uploader($config->manager->slug . '/backup', 'zip', array('destination' => $destination, 'title' => trim(strip_tags($title))));
?>
</div>
</div>
<?php
}
?>
</div>
<?php
Weapon::fire('tab_content_after', $hooks);
?>
</div>
</div>
示例13: ceil
echo '<link>' . $config->url . '/</link>';
echo '<description>' . $config->description . '</description>';
echo '<lastBuildDate>' . Date::format(time(), 'r') . '</lastBuildDate>';
echo '<atom:link rel="self" href="' . $config->url_current . '"/>';
echo $config->offset > 1 ? '<atom:link rel="previous" href="' . Filter::colon('feed:url', $url_base . '/' . ($config->offset - 1)) . '"/>' : "";
echo $config->offset < ceil($config->total_articles / $rss_limit) ? '<atom:link rel="next" href="' . Filter::colon('feed:url', $url_base . '/' . ($config->offset + 1)) . '"/>' : "";
Weapon::fire('rss_meta');
if (!empty($bucket)) {
foreach ($bucket as $i => $item) {
$title = strip_tags($item->title);
$description = $item->description;
$kind = Mecha::A($item->kind);
echo '<item>';
echo '<title><![CDATA[' . $title . ']]></title>';
echo '<link>' . $item->url . '</link>';
echo '<description><![CDATA[' . $description . ']]></description>';
echo '<pubDate>' . Date::format($item->time, 'r') . '</pubDate>';
echo '<guid>' . $item->url . '</guid>';
if (!empty($kind)) {
foreach ($kind as $k) {
$tag = Get::articleTag($k);
echo '<category domain="' . Filter::colon('tag:url', $config->url . '/' . $config->tag->slug . '/' . $tag->slug) . '">' . $tag->name . '</category>';
}
}
echo '<source url="' . $item->url . '"><![CDATA[' . $config->title . ': ' . $title . ']]></source>';
Weapon::fire('rss_item', array($item, $i));
echo '</item>';
}
}
echo '</channel>';
echo '</rss>';
示例14: array
<?php
$bucket = array();
if ($config->total_pages > 0) {
foreach (Get::pages() as $page) {
list($time, $kind, $slug) = explode('_', File::N($page), 3);
$bucket[] = (object) array('url' => $config->url . '/' . $slug, 'date' => Date::format($time, 'c'), 'changefreq' => 'weekly', 'priority' => (string) '0.5');
}
}
if ($config->total_articles > 0) {
foreach (Get::articles() as $article) {
list($time, $kind, $slug) = explode('_', File::N($article), 3);
$bucket[] = (object) array('url' => $config->url . '/' . $config->index->slug . '/' . $slug, 'date' => Date::format($time, 'c'), 'changefreq' => 'weekly', 'priority' => (string) '1.0');
}
}
echo '<?xml version="1.0" encoding="UTF-8" ?>';
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
if (!empty($bucket)) {
foreach ($bucket as $i => $item) {
echo '<url>';
echo '<loc>' . $item->url . '</loc>';
echo '<lastmod>' . $item->date . '</lastmod>';
echo '<changefreq>' . $item->changefreq . '</changefreq>';
echo '<priority>' . $item->priority . '</priority>';
Weapon::fire('sitemap_item', array($item, $i));
echo '</url>';
}
}
echo '</urlset>';
示例15: chunk
/**
* ==========================================================
* RENDER A SHIELD CHUNK
* ==========================================================
*
* -- CODE: -------------------------------------------------
*
* Shield::chunk('header');
*
* ----------------------------------------------------------
*
* Shield::chunk('header', array('title' => 'Yo!'));
*
* ----------------------------------------------------------
*
*/
public static function chunk($name, $fallback = false, $buffer = true)
{
$path__ = File::path($name);
$G = array('data' => array('name' => $name));
if (is_array($fallback)) {
self::$lot = array_merge(self::$lot, $fallback);
$fallback = false;
}
$path__ = Filter::apply('chunk:path', self::path($path__, $fallback));
$G['data']['lot'] = self::$lot;
$G['data']['path'] = $path__;
$out = "";
if ($path__) {
// Begin chunk
Weapon::fire('chunk_lot_before', array($G, $G));
extract(Filter::apply('chunk:lot', self::$lot));
Weapon::fire('chunk_lot_after', array($G, $G));
Weapon::fire('chunk_before', array($G, $G));
if ($buffer) {
ob_start(function ($content) use($path__, &$out) {
$content = Filter::apply('chunk:input', $content, $path__);
$out = Filter::apply('chunk:output', $content, $path__);
return $out;
});
require $path__;
ob_end_flush();
} else {
require $path__;
}
$G['data']['content'] = $out;
// End chunk
Weapon::fire('chunk_after', array($G, $G));
}
}