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


PHP Events::call方法代码示例

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


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

示例1: run

 /**
  * Выполняет обработку запроса
  *
  * @param WS_Environment $env
  *
  * @return mixed
  */
 public function run(WS_Environment $env)
 {
     $config = Config::all();
     $env->assign_if(array('config' => $config));
     Events::call('ws.config', $config);
     return $this->application->run($env);
 }
开发者ID:techart,项目名称:tao,代码行数:14,代码来源:Config.php

示例2: auth_realm

 protected function auth_realm()
 {
     $realm = false;
     if (Core_Regexps::match('{^/admin/}', $_SERVER['REQUEST_URI'])) {
         $realm = 'admin';
     }
     /**
      * @event cms.fspages.realm
      * @arg $realm имя области
      * Отдельные статические страницы (CMS.FSPages) могут исполняться в рамках обособленной (чаще всего - закрытой паролем) области.
      * По умолчанию страницы, чьи адреса начинаются с '''/admin/''' исполняются в области '''admin''', остальные - без указания области (в области по умолчанию).
      * Однако, это можно исправить в обработчике данного события. Проверьте REQUEST_URI и установите нужный realm.
      */
     Events::call('cms.fspages.realm', $realm);
     return $realm;
 }
开发者ID:techart,项目名称:tao,代码行数:16,代码来源:FSPages.php

示例3: route

 public function route($request)
 {
     $uri = trim(strtolower($this->clean_url($request->uri)));
     if (CMS_FSPages::$with_htm_extension) {
         $uri = preg_replace('{\\.htm$}', '/', $uri);
     }
     $path = '';
     if ($uri == '/') {
         $path = '/';
     } elseif ($m = Core_Regexps::match_with_results('{^/(.+)/$}', $uri)) {
         foreach (explode('/', $m[1]) as $chunk) {
             if (Core_Regexps::match('{[a-z0-9_-]+}', $chunk)) {
                 $path .= "/{$chunk}";
             }
         }
     }
     if ($path != '') {
         $dirs = array(CMS::$taopath . '/views/pages', CMS::app_path('views/pages'));
         /**
          * @event cms.fspages.dirs
          * @arg $dirs Список каталогов
          * Событие генерируется механизмом статических страниц (CMS.FSPages) для уточнения списка каталогов, в которых ищутся шаблоны. При необходимости в список можно добавить свой каталог.
          */
         Events::call('cms.fspages.dirs', $dirs);
         if (count($dirs) > 0) {
             for ($i = count($dirs) - 1; $i >= 0; $i--) {
                 $dir = $dirs[$i];
                 $page = false;
                 $page_path = "{$dir}{$path}/index.phtml";
                 if (IO_FS::exists($page_path)) {
                     $page = $page_path;
                 } else {
                     $page_path = "{$dir}/{$path}.phtml";
                     if (IO_FS::exists($page_path)) {
                         $page = $page_path;
                     }
                 }
                 if ($page) {
                     return array('controller' => 'CMS.Controller.FSPages', 'action' => 'index', $page);
                 }
             }
         }
     }
     return false;
 }
开发者ID:techart,项目名称:tao,代码行数:45,代码来源:FSPages.php

示例4: read_item

 public function read_item($title, $item)
 {
     $title = CMS::lang($title);
     if (is_string($item)) {
         $item = array('url' => trim($item));
     }
     if (isset($item['title'])) {
         $title = trim($item['title']);
     }
     if (isset($item['navigation_id'])) {
         $item['id'] = trim($item['navigation_id']);
     }
     $url = $item['url'];
     $url1 = $item['url'];
     Events::call('cms.navigation.add', $title, $item, $url);
     if ($url1 != $url) {
         $item['url'] = $url;
     }
     return parent::read_item($title, $item);
 }
开发者ID:techart,项目名称:tao,代码行数:20,代码来源:Navigation3.php

示例5: auth

 protected function auth()
 {
     $enable = Core::if_null(Config::all()->apache_auth->enable, false);
     $enable_admin = Core::if_null(Config::all()->apache_auth->enable_admin, false);
     if (!$enable) {
         return true;
     }
     if (!empty(WS::env()->auth->user)) {
         return true;
     }
     $user = null;
     $login = $this->request->server('PHP_AUTH_USER');
     if (!$login) {
         $login = $this->request->server('REMOTE_USER');
     }
     if ($login) {
         $user = $this->auth_module->authenticate($login, null);
         if (!$user->isactive) {
             return false;
         }
     }
     if (!$user && !Core::is_cli()) {
         return false;
     } else {
         Events::call('ws.auth.apache.user', $user);
         WS::env()->auth->user = $user;
         WS::env()->auth->module = $this->auth_module;
         if ($enable_admin) {
             $admin_user = clone $user;
             $admin_user->password = $this->request->server('PHP_AUTH_PW');
             WS::env()->admin_auth->user = $admin_user;
         }
         $this->reset_default_auth();
         return true;
     }
 }
开发者ID:techart,项目名称:tao,代码行数:36,代码来源:Apache.php

示例6: receive

function receive($name = '')
{
    return Events::call($name);
}
开发者ID:biggtfish,项目名称:anchor-cms,代码行数:4,代码来源:helpers.php

示例7: action_save

 public function action_save($name, $data, $action, $item = false, $fields = array())
 {
     $files = json_decode($this->files_from_request(), true);
     if (!empty($files)) {
         $this->update_files_data($files, $name, $data, $item);
     }
     Events::call('admin.change');
     return 'ok';
 }
开发者ID:techart,项目名称:tao,代码行数:9,代码来源:Documents.php

示例8: postprocess

 public function postprocess(&$path, &$content)
 {
     Events::call('templates.join_file', $path, $content);
     foreach ($this->postprocessors as $p) {
         $p->postprocess($path, $content);
     }
     return $this;
 }
开发者ID:techart,项目名称:tao,代码行数:8,代码来源:Includes.php

示例9: flush

 /**
  * Инвалидирует кэш
  *
  */
 public function flush()
 {
     Events::call('cache.flush');
     Events::call('cache.delete', $s = '*');
     return $this->memcache->flush();
 }
开发者ID:techart,项目名称:tao,代码行数:10,代码来源:MemCache.php

示例10: flush

 /**
  * Инвалидирует кэш
  *
  */
 public function flush()
 {
     Events::call('cache.flush');
     Events::call('cache.delete', $s = '*');
     $rc = apcu_clear_cache('user');
     $rc = apcu_clear_cache('opcode') && $rc;
     return $rc;
 }
开发者ID:techart,项目名称:tao,代码行数:12,代码来源:APCU.php

示例11: recieve

function recieve($area = '')
{
    return Events::call($area);
}
开发者ID:rubenvincenten,项目名称:anchor-site,代码行数:4,代码来源:helpers.php

示例12: fallback

 protected function fallback($name, $parms, $args)
 {
     $name = trim($name, '/');
     $this->views_paths[] = '';
     $template = $this->search_fallback_template($name);
     if ($template) {
         $args = array('env' => WS::env(), 'request' => WS::env()->request, 'args' => $parms, 'args_array' => $args, 'insertion_name' => $name);
         Events::call("cms.insertions.template.{$name}", $template, $args);
         if (isset($this->args['layout'])) {
             return $this->args['layout']->root->partial($template, $args);
         }
         return Templates::HTML($template)->with($args)->render();
     }
     return null;
 }
开发者ID:techart,项目名称:tao,代码行数:15,代码来源:Insertions.php

示例13: callback

 /**
  * @param        $entity
  * @param string $name
  *
  * @return mixed
  */
 protected function callback($entity, $name)
 {
     $result = true;
     $rc = Events::call("orm.mapper.callback.{$this->__name()}.{$name}", $this, $entity);
     if (!is_null($rc)) {
         $result = $rc;
     }
     $rc = Events::call("orm.mapper.callback.{$name}", $this, $entity);
     if (!is_null($rc)) {
         $result = $rc && $result;
     }
     return is_object($entity) && method_exists($entity, $name) ? $entity->{$name}($result) && $result : $result;
 }
开发者ID:techart,项目名称:tao,代码行数:19,代码来源:ORM.php

示例14: action_left

 public function action_left($name, $data, $action, $item = false, $fields = array())
 {
     $filename = $this->dir_path($item, false, $name, $data) . '/' . $this->request('filename');
     $file = IO_FS::File($filename);
     if (!$file->exists()) {
         Net_HTTP::not_found();
     }
     Core::load('CMS.Images');
     $method = 'turn_' . $action;
     CMS_Images::Image($file->path)->{$method}()->save($file->path);
     $file->set_permission();
     Events::call('admin.change');
     return 'ok';
 }
开发者ID:techart,项目名称:tao,代码行数:14,代码来源:Gallery.php

示例15: action_install

 protected function action_install()
 {
     $item = $this->load_item($this->id);
     if (!$item) {
         return $this->page_not_found();
     }
     $error = false;
     foreach ($item->not_install_if_exists as $entry) {
         $entry = $this->validate_path($entry);
         if ($entry) {
             if (IO_FS::exists($entry)) {
                 $error = "<b>Файл (каталог) {$entry}</b> уже существует. Установка невозможна!";
             }
         }
     }
     if ($item['download'] == '-') {
         $error = 'Невозможно получить инсталляционный пакет!';
     }
     if ($this->env->request->method == 'post') {
         $files = $this->get_install_pack($item);
         if (is_string($files)) {
             $error = $files;
         } else {
             foreach ($files as $file => $data) {
                 $from = $data['path'];
                 $to = "../{$file}";
                 if ($m = Core_Regexps::match_with_results('{^(.+)/[^/]+$}', $to)) {
                     $dir = $m[1];
                     if (!IO_FS::exists($dir)) {
                         @CMS::mkdirs($dir);
                         if (!IO_FS::exists($dir)) {
                             $error = "Невозможно создать каталог {$dir}";
                             break;
                         }
                     }
                     copy($from, $to);
                     CMS::chmod_file($to);
                     $item->set_installed_hash($file, $data['hash']);
                 }
             }
             $item->save_info_file();
             CMS::rmdir($item->install_temp_dir());
             return $this->redirect_to($this->action_url('instok', $item));
         }
     }
     Events::call('cms.stockroom.after_install', $item, $error);
     return $this->render('install', array('item' => $item, 'error' => $error, 'list_url' => $this->action_url('list', $this->page), 'list_button_caption' => $this->button_list()));
 }
开发者ID:techart,项目名称:tao,代码行数:48,代码来源:Stockroom.php


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