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


PHP EventManager::RaiseEvent方法代码示例

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


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

示例1: execute

 public function execute()
 {
     EventManager::RaiseEvent("before_executing_task", array("task" => $this));
     $script = DataBase::Current()->EscapeString($this->script);
     DataBase::Current()->Execute("UPDATE {'dbprefix'}tasks SET lastExecution = NOW() WHERE script = '" . $script . "'");
     include Settings::getInstance()->get("root") . $this->script;
     EventManager::RaiseEvent("after_executing_task", array("task" => $this));
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:8,代码来源:task.php

示例2: createFolder

 /**
  *
  * @param string $base
  * @param string $name
  * @return mixed 
  */
 public static function createFolder($base, $name)
 {
     $res = false;
     if (!file_exists($base . "/" . $name)) {
         $res = mkdir($base . "/" . $name, 0777);
     }
     $args['name'] = $base . "/" . $name;
     if (isset($res) && $res) {
         EventManager::RaiseEvent("folder_created", $args);
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:18,代码来源:fileserver.php

示例3: deactivate

 /**
  *
  * @return boolean
  */
 public function deactivate()
 {
     $res = false;
     if ($this->isActivated()) {
         $path = DataBase::Current()->EscapeString($this->path);
         @(include Settings::getValue("root") . "system/plugins/" . $path . "/deactivate.php");
         foreach ($this->supportedLanguages as $language) {
             Language::DropLanguagePack("plugin_" . $path, $language);
         }
         $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}activated_plugins WHERE path = '" . $path . "'");
         EventManager::RaiseEvent("deactivated_plugin", array("plugininfo", $this));
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:18,代码来源:plugininfo.php

示例4: insert

 /**
  *
  * @param string $path
  * @param string $name
  * @param string $description
  * @return mixed 
  */
 public static function insert($path, $name, $description)
 {
     $path = DataBase::Current()->EscapeString($path);
     $name = DataBase::Current()->EscapeString($name);
     $description = DataBase::Current()->EscapeString($description);
     $res = DataBase::Current()->Execute("INSERT INTO {'dbprefix'}images (path,name,description) \n                                              VALUES ('" . $path . "','" . $name . "','" . $description . "')");
     if ($res) {
         $args['path'] = $path;
         $args['name'] = $name;
         $args['description'] = $description;
         EventManager::RaiseEvent("image_registered", $args);
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:21,代码来源:imageserver.php

示例5: includeHeader

 static function includeHeader()
 {
     echo "<title>" . htmlentities(Page::Current()->title) . Settings::getValue("title_extention") . "</title>";
     if (Cache::contains("htmlmeta", Page::Current()->id)) {
         echo Cache::getData("htmlmeta", Page::Current()->id);
     } else {
         $cache = "";
         $rows = DataBase::Current()->ReadRows("SELECT name, content\n                            FROM {'dbprefix'}meta_global\n                            UNION SELECT name, content\n                            FROM {'dbprefix'}meta_local\n                            WHERE page = '" . Page::Current()->id . "'");
         if ($rows) {
             foreach ($rows as $row) {
                 echo "<meta name=\"" . htmlentities($row->name) . "\" content=\"" . htmlentities($row->content) . "\" />";
                 $cache .= "<meta name=\"" . htmlentities($row->name) . "\" content=\"" . htmlentities($row->content) . "\" />";
             }
         }
         Cache::setData("htmlmeta", Page::Current()->id, $cache);
     }
     echo Page::Current()->getHeader();
     EventManager::RaiseEvent("header_included", null);
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:19,代码来源:sys.php

示例6: delete

 /**
  *
  * @return boolean
  */
 function delete()
 {
     $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}pages WHERE alias = '" . $this->alias . "'");
     if ($res) {
         MenuEntry::DeleteByPage($this);
         $args['alias'] = $this->alias;
         EventManager::RaiseEvent("page_deleted", $args);
     }
     Cache::clear("breadcrumb");
     Cache::clear("page");
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:16,代码来源:page.php

示例7: update

 /**
  *
  * @return boolean
  */
 private function update()
 {
     $id = DataBase::Current()->EscapeString($this->id);
     $menu = DataBase::Current()->EscapeString($this->menu);
     $title = DataBase::Current()->EscapeString($this->title);
     $href = DataBase::Current()->EscapeString($this->href);
     $type = DataBase::Current()->EscapeString($this->type);
     $res = DataBase::Current()->Execute("UPDATE {'dbprefix'}menu SET \n                                       href = '" . $href . "', \n                                         title = '" . $title . "', \n                                         type = '" . $type . "' \n                                       WHERE id = '" . $id . "' \n                                       AND menuID = '" . $menu . "'");
     if ($res) {
         $args['menu'] = $menu;
         $args['title'] = $title;
         $args['href'] = $href;
         $args['id'] = $id;
         EventManager::RaiseEvent("menu_entry_edit", $args);
     }
     Cache::clear("menu");
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:22,代码来源:menuentry.php

示例8: delete

 /**
  *
  * @param int $id
  * @return string 
  */
 static function delete($id)
 {
     $id = DataBase::Current()->EscapeString($id);
     $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}menu_names WHERE id = '" . $id . "'");
     if ($res) {
         $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}menu WHERE menuID = '" . $id . "'");
         if ($res) {
             $args['id'] = $id;
             EventManager::RaiseEvent("menu_deleted", $args);
         }
     }
     Cache::clear();
     SessionCache::clear();
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:20,代码来源:menu.php

示例9: displayCurrent

 public static function displayCurrent()
 {
     EventManager::RaiseEvent("BEFORE_DISPLAYSKIN", array());
     $skin = self::getCurrentSkinName();
     if (file_exists(Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/index.php")) {
         include Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/index.php";
         EventManager::RaiseEvent("AFTER_DISPLAYSKIN", array());
     } else {
         if (file_exists(Settings::getInstance()->get("root") . "/system/skins/default/index.php")) {
             if (DEVELOPMENT) {
                 die("Skin " . $skin . " cannot be found!");
             }
             include Settings::getInstance()->get("root") . "/system/skins/" . $skin . "/index.php";
         } else {
             die("Skin " . $skin . " cannot be found!");
         }
     }
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:18,代码来源:skincontroller.php

示例10: delete

 /**
  *
  * @return boolean
  */
 public function delete()
 {
     $res = false;
     if (!$this->equals(User::Current())) {
         $id = DataBase::Current()->EscapeString(strtolower(trim($this->id)));
         $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}user WHERE id = '" . $id . "'");
         Cache::clear("tables", "userlist");
         $args = array();
         $args["user"] = $this;
         EventManager::RaiseEvent("user_deleted", $args);
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:17,代码来源:user.php

示例11: getCode

 /**
  *
  * @param boolean $escape
  * @return string
  */
 public function getCode($escape = false)
 {
     $this->replaceGetParams();
     EventManager::RaiseEvent("PARSE_CONTENT", array("template" => $this));
     $this->template = $this->removeHiddenIfBlocks($this->template);
     foreach ($this->loops as $key => $array) {
         $loop_template = implode("\n", $array);
         $this->template = str_ireplace('<!--LOOP(' . strtoupper($key) . ')-->', $loop_template, $this->template);
     }
     $this->replaceLanguageTokens();
     $this->replaceIcons();
     $this->replaceForms();
     if (!$escape) {
         $this->unescape();
     }
     return $this->template;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:22,代码来源:template.php

示例12: Delete

 /**
  * Deletes the form.
  */
 public function Delete()
 {
     $id = DataBase::Current()->EscapeString($this->id);
     DataBase::Current()->Execute("DELETE FROM {'dbprefix'}forms WHERE id = '" . $id . "'");
     DataBase::Current()->Execute("DELETE FROM {'dbprefix'}form_fields WHERE id = '" . $id . "'");
     #
     $args = array();
     $args['form'] = $this;
     EventManager::RaiseEvent("FORM_DELETED", $args);
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:13,代码来源:form.php

示例13: error_reporting

<?php

include 'const.php';
include 'autoload.php';
if (!DEVELOPMENT) {
    error_reporting(0);
    ini_set('display_errors', 0);
} else {
    error_reporting(-1);
    ini_set('display_errors', 1);
}
session_start();
sys::parseGetParams();
//Unescape backslashes in $_POST
array_walk_recursive($_POST, create_function('&$val', '$val = stripslashes($val);'));
if (!isset($_GET['include'])) {
    $_GET['include'] = '';
}
Page::Current()->ExecuteHttpHeader();
EventManager::RaiseEvent("pre_page_load", null);
if (file_exists(Settings::getInstance()->get("root") . $_GET['include'] . ".htm")) {
    include Settings::getInstance()->get("root") . $_GET['include'] . ".htm";
} else {
    SkinController::displayCurrent();
}
Scheduler::runTasks();
开发者ID:srueegger,项目名称:1zu12bB,代码行数:26,代码来源:index.php

示例14: delete

 /**
  *
  * @return boolean
  */
 public function delete()
 {
     $res = false;
     if ($this->ID > 3) {
         $id = DataBase::Current()->EscapeString($this->ID);
         $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}roles WHERE id = '" . $id . "'");
         if ($res) {
             $res = DataBase::Current()->Execute("DELETE FROM {'dbprefix'}role_rights WHERE role = '" . $id . "'");
         }
         if ($res) {
             $res = DataBase::Current()->Execute("UPDATE {'dbprefix'}user SET role = '1' WHERE role = '" . $id . "'");
         }
         Cache::clear("roles");
         Cache::clear("tables", "rolelist");
         EventManager::RaiseEvent("role_deleted", array("name" => $this->name, "obj" => $this));
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:22,代码来源:role.php


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