本文整理汇总了PHP中Stack::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Stack::remove方法的具体用法?PHP Stack::remove怎么用?PHP Stack::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack::remove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove_template
public function remove_template()
{
Post::deactivate_post_type('poll');
$this->remove_template('widget', dirname(__FILE__) . '/widget.php');
Stack::remove('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery');
Stack::remove('template_stylesheet', array(URL::get_from_filesystem(__FILE__) . '/widget.css', 'screen'), 'pollwigitcss');
$this->remove_template('poll.single', dirname(__FILE__) . '/poll.single.php');
}
示例2: testALL
public function testALL()
{
$this->assertTrue($this->object->count() == 10);
$this->assertTrue($this->object->pop()->toNative() == 9);
$this->assertTrue($this->object->count() == 9);
$this->object->push(1);
$this->assertTrue($this->object->remove(1));
$this->object->push(78);
}
示例3: action_admin_header
public function action_admin_header($theme)
{
// This is such a hack it's not even funny
// But I am laughing inside. Laughing in a bad way.
Stack::remove('admin_stylesheet', 'admin');
$css = file_get_contents(Site::get_dir('admin_theme') . '/css/admin.css');
$css = preg_replace('@#page input\\[type=button\\], #page input\\[type=submit\\], #page button {([^}]+)}@', '', $css, 1);
$css = preg_replace('@#page input\\[type=button\\]:hover, #page input\\[type=submit\\]:hover, #page button:hover {([^}]+)}@', '', $css, 1);
Stack::add('admin_stylesheet', array(preg_replace('@../images/@', Site::get_url('admin_theme') . '/images/', $css), 'screen'), 'admin', 'jquery');
}
示例4: action_template_header
public function action_template_header()
{
$modified = Stack::get_sorted_stack('template_header_javascript');
foreach ($modified as $key => $value) {
Stack::remove('template_header_javascript', $key);
}
Stack::add('template_header_javascript', Site::get_url('user') . "/files/minified.js", 'Minified');
if (!Cache::has(self::$cache_name . '_js') || !Cache::has(self::$cache_name . '_css')) {
set_include_path(dirname(__FILE__) . '/min/lib' . PATH_SEPARATOR . get_include_path());
require_once 'Minify/Source.php';
require_once 'Minify/HTML.php';
require_once 'Minify/CSS.php';
require_once 'Minify/HTML.php';
require_once 'Minify.php';
require_once 'Minify/Cache/File.php';
}
if (!Cache::has(self::$cache_name . '_js')) {
$js_stack = array();
foreach ($modified as $js) {
$js_stack[] = Site::get_path('base') . str_replace(Site::get_url('habari') . '/', '', $js);
}
$options = array('files' => $js_stack, 'encodeOutput' => false, 'quiet' => true, 'maxAge' => 86400);
$result = Minify::serve('Files', $options);
file_put_contents(site::get_dir('user') . '/files/minified.js', $result['content']);
Cache::set(self::$cache_name . '_js', 'true');
}
/* CSS */
$modified = Stack::get_sorted_stack('template_stylesheet');
$tmp = array();
foreach ($modified as $key => $value) {
$tmp[] = $value[0];
Stack::remove('template_stylesheet', $key);
}
Stack::add('template_stylesheet', array(Site::get_url('user') . "/files/minified.css", 'screen'), 'style');
if (!Cache::has(self::$cache_name . '_css')) {
$css_stack = array();
foreach ($tmp as $css) {
$css_stack[] = Site::get_path('base') . str_replace(Site::get_url('habari') . '/', '', $css);
}
$options = array('files' => $css_stack, 'encodeOutput' => false, 'quiet' => true, 'maxAge' => 86400);
// handle request
$result = Minify::serve('Files', $options);
file_put_contents(site::get_dir('user') . '/files/minified.css', $result['content']);
Cache::set(self::$cache_name . '_css', 'true');
}
}
示例5: action_template_header
public function action_template_header()
{
//Cache::expire( self::$cache_name . '_js' );
//Cache::expire( self::$cache_name . '_css' );
// try to disable output_compression (may not have an effect)
ini_set('zlib.output_compression', '0');
$modified_js = Stack::get_sorted_stack('template_header_javascript');
foreach ($modified_js as $key => $value) {
Stack::remove('template_header_javascript', $key);
}
Stack::add('template_header_javascript', Site::get_url('user') . '/files/minified.js', 'Minified');
$modified_css = Stack::get_sorted_stack('template_stylesheet');
$css = array();
foreach ($modified_css as $key => $value) {
$css[] = $value[0];
Stack::remove('template_stylesheet', $key);
}
Stack::add('template_stylesheet', array(Site::get_url('user') . "/files/minified.css", 'screen'), 'style');
/*
* If we have the files or the cache havent expired don't create new files.
*/
if (!file_exists(site::get_dir('user') . '/files/minified.css') || !file_exists(site::get_dir('user') . '/files/minified.js') || (!Cache::has(self::$cache_name . '_js') || !Cache::has(self::$cache_name . '_css'))) {
/* Taken from min/index.php */
define('MINIFY_MIN_DIR', dirname(__FILE__) . '/min/');
// load config
require MINIFY_MIN_DIR . '/config.php';
// setup include path
set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
require 'Minify.php';
Minify::$uploaderHoursBehind = $min_uploaderHoursBehind;
Minify::setCache(isset($min_cachePath) ? $min_cachePath : '', $min_cacheFileLocking);
if ($min_documentRoot) {
$_SERVER['DOCUMENT_ROOT'] = $min_documentRoot;
} elseif (0 === stripos(PHP_OS, 'win')) {
Minify::setDocRoot();
// IIS may need help
}
$min_serveOptions['minifierOptions']['text/css']['symlinks'] = $min_symlinks;
// Using jsmin+ 1.3
$min_serveOptions['minifiers']['application/x-javascript'] = array('JSMinPlus', 'minify');
/* Javascript */
if (!Cache::has(self::$cache_name . '_js') || !file_exists(site::get_dir('user') . '/files/minified.js')) {
$js_stack = array();
foreach ($modified_js as $js) {
$js_stack[] = Site::get_path('base') . str_replace(Site::get_url('habari') . '/', '', $js);
}
$options = array('files' => $js_stack, 'encodeOutput' => false, 'quiet' => true);
$result = Minify::serve('Files', $options);
file_put_contents(site::get_dir('user') . '/files/minified.js', $result['content']);
Cache::set(self::$cache_name . '_js', 'true', Options::get('minification__expire'));
}
/* CSS */
if (!Cache::has(self::$cache_name . '_css') || !file_exists(site::get_dir('user') . '/files/minified.css')) {
$css_stack = array();
foreach ($css as $file) {
$css_stack[] = Site::get_path('base') . str_replace(Site::get_url('habari') . '/', '', $file);
}
$options = array('files' => $css_stack, 'encodeOutput' => false, 'quiet' => true);
// handle request
$result = Minify::serve('Files', $options);
file_put_contents(site::get_dir('user') . '/files/minified.css', $result['content']);
Cache::set(self::$cache_name . '_css', 'true', Options::get('minification__expire'));
}
}
}