当前位置: 首页>>代码示例>>PHP>>正文


PHP Trigger::instance方法代码示例

本文整理汇总了PHP中Trigger::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Trigger::instance方法的具体用法?PHP Trigger::instance怎么用?PHP Trigger::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Trigger的用法示例。


在下文中一共展示了Trigger::instance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

<?php

/**
 * @package		HybridAuth
 * @category	modules
 * @author		HybridAuth authors
 * @author		Nazar Mokrynskyi <nazar@mokrynskyi.com> (integration with CleverStyle CMS)
 * @copyright	HybridAuth authors
 * @license		MIT License, see license.txt
 */
namespace cs;

Trigger::instance()->register('System/Config/pre_routing_replace', function () {
    switch (Config::instance()->components['modules']['HybridAuth']['active']) {
        case 1:
            require __DIR__ . '/trigger/enabled.php';
    }
});
Trigger::instance()->register('System/Index/construct', function () {
    if (!ADMIN) {
        return;
    }
    switch (Config::instance()->components['modules']['HybridAuth']['active']) {
        case -1:
            require __DIR__ . '/trigger/uninstalled.php';
            break;
    }
});
开发者ID:hypnomez,项目名称:opir.org,代码行数:28,代码来源:trigger.php

示例2: clean_pcache

             $a->save();
         }
     }
     break;
 case 'enable':
     $module_data['active'] = 1;
     $a->save();
     clean_pcache();
     Trigger::instance()->run('admin/System/components/modules/enable', ['name' => $module_name]);
     unset($Cache->functionality, $Cache->languages);
     break;
 case 'disable':
     $module_data['active'] = 0;
     $a->save();
     clean_pcache();
     Trigger::instance()->run('admin/System/components/modules/disable', ['name' => $module_name]);
     unset($Cache->functionality, $Cache->languages);
     break;
 case 'remove':
     if ($module_name == 'System' || $module_data['active'] != '-1') {
         break;
     }
     $ok = true;
     get_files_list(MODULES . "/{$module_name}", false, 'fd', true, true, false, false, true, function ($item) use(&$ok) {
         if (is_writable($item)) {
             is_dir($item) ? @rmdir($item) : @unlink($item);
         } else {
             $ok = false;
         }
     });
     if ($ok && @rmdir(MODULES . "/{$module_name}")) {
开发者ID:hypnomez,项目名称:opir.org,代码行数:31,代码来源:save.modules.php

示例3: function

<?php

/**
 * @package		Plupload
 * @category	modules
 * @author		Moxiecode Systems AB
 * @author		Nazar Mokrynskyi <nazar@mokrynskyi.com> (integration with CleverStyle CMS)
 * @copyright	Moxiecode Systems AB
 * @license		GNU GPL v2, see license.txt
 */
namespace cs;

Trigger::instance()->register('admin/System/components/modules/install/process', function ($data) {
    if ($data['name'] == 'Plupload') {
        $Config = Config::instance();
        $Config->module('Plupload')->max_file_size = '5mb';
        $Config->module('Plupload')->confirmation_time = '900';
    }
});
开发者ID:hypnomez,项目名称:opir.org,代码行数:19,代码来源:uninstalled.php

示例4: function

<?php

/**
 * @package        Metrics
 * @category       plugins
 * @author         Nazar Mokrynskyi <nazar@mokrynskyi.com>
 * @copyright      Copyright (c) 2011-2013, Nazar Mokrynskyi
 * @license        MIT License, see license.txt
 */
namespace cs;

Trigger::instance()->register('System/Page/pre_display', function () {
    if (User::instance()->user() || !in_array('Metrics', Config::instance()->components['plugins'])) {
        return;
    }
    //Yandex
    Page::instance()->post_Body .= '<!-- Yandex.Metrika counter --><script type="text/javascript">(function (d, w, c) { (w[c] = w[c] || []).push(function() { try { w.yaCounter24106597 = new Ya.Metrika({id:24106597, ut:"noindex"}); } catch(e) { } }); var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () { n.parentNode.insertBefore(s, n); }; s.type = "text/javascript"; s.async = true; s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js"; if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); } })(document, window, "yandex_metrika_callbacks");</script><noscript><div><img src="//mc.yandex.ru/watch/24106597?ut=noindex" style="position:absolute; left:-9999px;" alt="" /></div></noscript><!-- /Yandex.Metrika counter -->';
});
开发者ID:hypnomez,项目名称:opir.org,代码行数:18,代码来源:trigger.php

示例5: _include

                  */
                 _include("{$plugin_dir}/meta/update/{$version}.php", true, false);
             }
         }
         unset($old_version);
     }
     unlink("{$plugin_dir}/fs_old.json");
     unlink("{$plugin_dir}/meta_old.json");
     /**
      * Restore previous plugin state
      */
     if ($active) {
         $Config->components['plugins'][] = $plugin;
         $Config->save();
         clean_pcache();
         Trigger::instance()->run('admin/System/components/plugins/enable', ['name' => $plugin]);
     }
     $Index->save();
     unset($Cache->functionality);
     break;
 case 'remove':
     if (in_array($plugin, $Config->components['plugins'])) {
         break;
     }
     $ok = true;
     get_files_list(PLUGINS . "/{$plugin}", false, 'fd', true, true, false, false, true, function ($item) use(&$ok) {
         if (is_writable($item)) {
             is_dir($item) ? @rmdir($item) : @unlink($item);
         } else {
             $ok = false;
         }
开发者ID:hypnomez,项目名称:opir.org,代码行数:31,代码来源:save.plugins.php

示例6: interface_off

<?php

/**
 * @package		CleverStyle CMS
 * @subpackage	System module
 * @category	modules
 * @author		Nazar Mokrynskyi <nazar@mokrynskyi.com>
 * @copyright	Copyright (c) 2011-2014, Nazar Mokrynskyi
 * @license		MIT License, see license.txt
 */
/**
 * Provides next triggers:<br>
 *  System/robots.txt<br>
 *  ['text'	=> <i>&$text</i>]<br>
 */
namespace cs;

Index::instance()->stop = true;
interface_off();
$text = file_get_contents(MFOLDER . '/robots.txt');
Trigger::instance()->run('System/robots.txt', ['text' => &$text]);
$text .= 'Host: ' . explode('/', explode('//', Config::instance()->core_url(), 2)[1], 2)[0];
Page::instance()->Content = $text;
开发者ID:hypnomez,项目名称:opir.org,代码行数:23,代码来源:robots.txt.php


注:本文中的Trigger::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。