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


PHP system::stop方法代码示例

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


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

示例1: init

 private static function init()
 {
     if (self::$pdo == null) {
         try {
             self::$pdo = new PDO(DB_DSN, DB_USER, DB_PASS);
             self::$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
             if ('mysql' == substr(DB_DSN, 0, 5)) {
                 self::$driver = 'mysql';
                 self::$pdo->exec("SET NAMES 'utf8' COLLATE 'utf8_general_ci'");
             }
         } catch (PDOException $e) {
             $msg = '<h3>Невозможно установить соединение с базой данных!</h3><br/>';
             if ($e->getCode() == 2001) {
                 $msg .= 'Невозможно создать socket-соединение из за ограничений сервера! ';
             } else {
                 if ($e->getCode() == 2002) {
                     $msg .= 'Превышено время ожидания сервера БД! Скорей всего сервер либо временно не доступен, либо не существует. Проверьте настройки подключения к БД.';
                 } else {
                     if ($e->getCode() == 1049) {
                         $msg .= 'Указанная БД не существует! Перепроверьте настройки подключения к базе данных.';
                     } else {
                         $msg .= 'Запрещен доступ для указанного логина и пароля. Перепроверьте настройки подключения к базе данных.';
                     }
                 }
             }
             //$msg .= '<br/><br/><a href="">'.substr($e->getMessage(), 0, 22).'</a>';
             $msg .= '<br/><br/>' . substr($e->getMessage(), 0, 22) . '';
             page::globalVar('title', 'Bagira.CMS');
             page::globalVar('content', $msg);
             page::parseIt(TEMPL_DIR . '/offline.tpl', true, true);
             system::stop();
         }
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:34,代码来源:db.php

示例2: restore

 public function restore()
 {
     if (system::issetUrl(2) && is_numeric(system::url(2))) {
         // Одиночное востановление
         $obj = new ormObject(system::url(2));
         if ($obj->isInheritor('section')) {
             $obj = new ormPage(system::url(2));
         }
         $obj->restore();
         echo 'delete';
     } else {
         if (isset($_POST['objects'])) {
             // Множественное востановление
             while (list($id, $val) = each($_POST['objects'])) {
                 if (is_numeric($id)) {
                     $obj = new ormObject($id);
                     if ($obj->isInheritor('section')) {
                         $obj = new ormPage($id);
                     }
                     $obj->restore();
                 }
             }
             echo 'delete';
         }
     }
     ormPages::clearCache();
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:28,代码来源:__object.php

示例3: proc_upd

 public function proc_upd()
 {
     if (system::issetUrl(2)) {
         $obj = new ormField();
         $obj->setGroupId(system::url(2));
     } else {
         if (system::action() == "proc_upd") {
             $obj = new ormField($_POST['obj_id']);
         } else {
             if (system::action() == "proc_add") {
                 $obj = new ormField();
                 $obj->setGroupId($_POST['obj_id']);
             }
         }
     }
     if (!empty($_POST['fname'])) {
         $obj->setName($_POST['fname']);
     }
     if (!empty($_POST['max_size'])) {
         $obj->setMaxSize($_POST['max_size']);
     } else {
         $obj->setMaxSize(0);
     }
     $obj->setType(0);
     $obj->setInherit(1);
     $obj_id = $obj->save();
     if ($obj_id === false) {
         echo json_encode(array('error' => 1, 'data' => $obj->getErrorListText(' ')));
     } else {
         $tree = new ormFieldsTree();
         $forUpd = system::action() == "proc_add" ? 0 : 1;
         echo json_encode(array('error' => 0, 'data' => $tree->getFieldHTML($obj, $forUpd)));
     }
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:35,代码来源:__separator.php

示例4: defAction

 public function defAction()
 {
     $file = @fopen(ROOT_DIR . "/revue.log", "w");
     @fclose($file);
     db::q('DELETE FROM <<revue>>');
     echo 'delete';
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:8,代码来源:__delete.php

示例5: viewAction

 public function viewAction()
 {
     if (system::issetUrl(2)) {
         $_SESSION['voting_' . system::url(2)] = 1;
         echo page::macros('voting')->objView(system::url(2));
     }
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:8,代码来源:controller.php

示例6: proc_edit

 public function proc_edit()
 {
     $text = system::checkVar(system::POST('minitext'), isText);
     $id = system::checkVar(system::POST('minitext_id'), isInt);
     $key = ormPages::getPrefix() . '/minitext/' . $id;
     if ($text && $id && reg::existKey($key)) {
         if (reg::setKey($key, $text)) {
             system::json(array('error' => 0));
             system::stop();
         }
     }
     system::json(array('error' => 1, 'errorInfo' => lang::get('STRUCTURE_MINITEXT_ERROR')));
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:14,代码来源:__minitext.php

示例7: change_rateAction

 public function change_rateAction()
 {
     if (!isset($_SESSION['comments_rate'][system::url(2)])) {
         if ($comment = comments::get(system::url(2))) {
             if (system::url(3) == 'up') {
                 $comment->rateUp();
             } else {
                 $comment->rateDown();
             }
             $_SESSION['comments_rate'][$comment->id()] = 1;
             $comment->save();
         }
     }
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:15,代码来源:controller.php

示例8: proc

 public function proc()
 {
     if (system::isAjax() && system::issetUrl(2)) {
         if (system::url(2) == 'start') {
             searchIndex::clear();
             reg::setKey(ormPages::getPrefix('search') . '/index_date', date('d.m.Y'));
             $sel = new ormSelect();
             $sel->fields('name');
             $sel->findInPages();
             $sel->where('active', '=', 1);
             $sel->where('in_search', '=', 1);
             echo $sel->getCount();
         } else {
             if (system::url(2) == 'info') {
                 $data = reg::getKey(ormPages::getPrefix('search') . '/index_date');
                 if (empty($data)) {
                     $data = '-';
                 }
                 system::json(array('pages' => searchIndex::getCountPages(), 'words' => searchIndex::getCountWords(), 'data' => $data));
             } else {
                 $sel = new ormSelect();
                 $sel->findInPages();
                 $sel->where('active', '=', 1);
                 $sel->where('in_search', '=', 1);
                 $sel->limit(system::url(2), 1);
                 searchIndex::indexPage($sel->getObject());
                 echo 'ok';
             }
         }
         system::stop();
     }
     if (system::POST('parram') == 'clear') {
         searchIndex::clear();
     }
     system::redirect('/search/index');
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:36,代码来源:__index.php

示例9: send_messageAction


//.........这里部分代码省略.........
             $obj->in_search = 1;
             $obj->in_index = 1;
             $obj->is_home_page = 0;
             if ($obj->name != '') {
                 $obj->h1 = $obj->name;
                 $obj->title = $obj->name;
             }
             $obj->pseudo_url = rand(1000, 9999);
             $obj->template_id = ($sect = ormPages::get($form_obj->section)) ? $sect->template_id : 1;
             $obj->form_id = $form_obj->id;
             $obj->setRightForAll(2);
             $obj_id = $obj->save();
             if ($obj_id) {
                 $obj->pseudo_url = $obj_id;
                 $obj->save();
                 $obj = new ormPage($obj_id);
             } else {
                 $issetErrors = true;
                 $f = $obj->getErrorFields();
                 $answer = array('field' => $f['focus'], 'msg' => $obj->getErrorListText(' '));
             }
         }
         if (!$issetErrors) {
             // Отправка нужных писем
             page::assign('site_name', domains::curDomain()->getSiteName());
             page::assign('site_url', domains::curDomain()->getName());
             page::assign('base_email', domains::curDomain()->getEmail());
             while (list($key, $val) = each($_POST)) {
                 page::assign($key, system::checkVar($val, isText));
             }
             if (isset($obj)) {
                 $fields = $obj->getClass()->loadFields();
                 foreach ($fields as $field) {
                     if (in_array($field['f_type'], array(70, 75, 80, 85))) {
                         $fsname = $field['f_sname'];
                         $fvalue = $obj->{$fsname};
                         if ($fvalue != '') {
                             page::assign($fsname, $fvalue);
                         }
                     }
                 }
             }
             // Если указан список адресатов, отправляем письма
             if ($form_obj->mailing_list != '') {
                 $mail = new phpmailer();
                 $mail->From = $this->parse($form_obj->admin_sender_address);
                 $mail->FromName = $this->parse($form_obj->admin_sender_name);
                 /*
                                   if (!empty($this->files))
                 for($i = 0; $i < count($this->files); $i++)
                    $mail->AddAttachment($this->files[$i][0], $this->files[$i][1]);
                 */
                 $mail->AddAddress($form_obj->mailing_list);
                 $mail->WordWrap = 50;
                 $mail->IsHTML(true);
                 $mail->Subject = $this->parse($form_obj->admin_subject);
                 $mail->Body = $this->parse($form_obj->admin_template);
                 $mail->Send();
             }
             // Если нужно, отправляем уведомление пользователю
             if ($form_obj->send_notice && !$issetErrors) {
                 $mail = new phpmailer();
                 $mail->From = $this->parse($form_obj->notice_sender_address);
                 $mail->FromName = $this->parse($form_obj->notice_sender_name);
                 $mail->AddAddress(system::POST('email'));
                 $mail->WordWrap = 50;
                 $mail->IsHTML(true);
                 $mail->Subject = $this->parse($form_obj->notice_subject);
                 $mail->Body = $this->parse($form_obj->notice_template);
                 $mail->Send();
             }
             // Показываем результат
             if (system::isAjax()) {
                 if ($form_obj->msg != '') {
                     $text = $form_obj->msg;
                 } else {
                     $text = lang::get('FEEDBACK_MSG_1');
                 }
                 system::json(array('field' => 0, 'msg' => strip_tags($text)));
             } else {
                 system::redirect('/feedback/ok/' . $form_obj->id);
             }
         } else {
             // Произошли ошибки
             if (system::isAjax()) {
                 system::json($answer);
             } else {
                 system::savePostToSession();
                 system::saveErrorToSession('feedback', $answer);
                 if (empty($_POST['back_url'])) {
                     $_POST['back_url'] = '/structure/map';
                 }
                 system::redirect($_POST['back_url'], true);
             }
         }
         system::stop();
     } else {
         system::stop();
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:101,代码来源:controller.php

示例10: getHTML

 function getHTML($templ_name = 'table')
 {
     $templ_name = $templ_name . '_' . $this->style;
     if (file_exists(MODUL_DIR . '/mpanel/template/' . $templ_name . '.tpl')) {
         include MODUL_DIR . '/mpanel/template/' . $templ_name . '.tpl';
         // Устанавливаем настройки по умолчанию
         $this->prefix = md5(system::url(0) . system::url(1) . (system::url(2) != '' ? system::url(2) : ''));
         if (!isset($_SESSION['table_' . $this->prefix])) {
             $_SESSION['table_' . $this->prefix]['max_count'] = 20;
             $_SESSION['table_' . $this->prefix]['page_num'] = 1;
             $_SESSION['table_' . $this->prefix]['table_search'] = '';
             $_SESSION['table_' . $this->prefix]['page_num_temp'] = 1;
         }
         // Смотрим пришедшие данные из POST
         if (!isset($_POST['filter'])) {
             // Сортировка по столбцу
             if (isset($_POST['field']) && isset($_POST['parram'])) {
                 $_SESSION['table_' . $this->prefix]['order_field'] = system::POST('field');
                 $_SESSION['table_' . $this->prefix]['order_parram'] = system::POST('parram');
             }
             // Количество строк в таблице
             if (isset($_POST['max_count'])) {
                 $_SESSION['table_' . $this->prefix]['max_count'] = $_POST['max_count'];
                 $_SESSION['table_' . $this->prefix]['page_num'] = 1;
             }
             // Выбор нужной страницы
             if (isset($_POST['page_num'])) {
                 $_SESSION['table_' . $this->prefix]['page_num'] = $_POST['page_num'];
             }
             // Поиск по таблице
             if (isset($_POST['table_search'])) {
                 $_SESSION['table_' . $this->prefix]['page_num_temp'] = $_SESSION['table_' . $this->prefix]['page_num'];
                 $_SESSION['table_' . $this->prefix]['page_num'] = 1;
                 if ($_POST['table_search'] == '') {
                     $_SESSION['table_' . $this->prefix]['page_num'] = $_SESSION['table_' . $this->prefix]['page_num_temp'];
                 }
                 $_SESSION['table_' . $this->prefix]['table_search'] = $_POST['table_search'];
             }
             // Очистка результатов поиска
             if (isset($_POST['clear_search'])) {
                 $_SESSION['table_' . $this->prefix]['page_num'] = $_SESSION['table_' . $this->prefix]['page_num_temp'];
                 $_SESSION['table_' . $this->prefix]['table_search'] = '';
                 if ($this->isSelection) {
                     $this->filter->clear();
                 }
                 //$_SESSION['table_'.$this->prefix]['max_count'] = 3;
             }
             // Нажали ссылку "обычный поиск" (скрыть / показать фильтры)
             if ($this->isSelection && isset($_POST['showfilter'])) {
                 if ($_POST['showfilter'] == 0) {
                     $_SESSION['table_' . $this->prefix]['filters'] = '';
                 }
                 $_SESSION['table_' . $this->prefix]['showfilter'] = $_POST['showfilter'];
                 system::stop();
             }
         }
         // Сортировка по столбцу
         if ($this->isSelection && isset($_SESSION['table_' . $this->prefix]['order_field'])) {
             $this->select->orderBy($_SESSION['table_' . $this->prefix]['order_field'], $_SESSION['table_' . $this->prefix]['order_parram']);
         }
         $up_line = '';
         // Устанавливаем список полей для выборки
         if ($this->isSelection && !$this->select->fieldsIsDefined()) {
             /*
                             $class_name = $this->select->getObjectsClass();
                             if (!empty($class_name))
                             	$select = (ormClasses::get($class_name)->issetField('active')) ? 'active' : '';
                             else    */
             $select = 'active';
             while (list($key, $column) = each($this->columns)) {
                 $zpt = !empty($select) ? ', ' : '';
                 if (strpos($column['field'], ' ')) {
                     $vals = explode(' ', $column['field']);
                     while (list($k, $val) = each($vals)) {
                         $select .= $zpt . $val;
                     }
                 } else {
                     $select .= $zpt . $column['field'];
                 }
             }
             $this->select->fields($select);
         }
         // Вывод формы ПОИСКа и установка параметров
         if ($this->show_search) {
             if ($this->isSelection && !empty($_SESSION['table_' . $this->prefix]['table_search'])) {
                 $query = $_SESSION['table_' . $this->prefix]['table_search'];
                 $this->inSearch = true;
                 $where = array();
                 reset($this->columns);
                 while (list($key, $column) = each($this->columns)) {
                     if ($column['field'] != 'children' && $column['field'] != 'parent') {
                         if (strpos($column['field'], ' ')) {
                             $vals = explode(' ', $column['field']);
                             while (list($k, $val) = each($vals)) {
                                 $where[] = $this->select->val($val, 'LIKE', '%' . $query . '%');
                             }
                         } else {
                             $where[] = $this->select->val($column['field'], 'LIKE', '%' . $query . '%');
                         }
                     }
//.........这里部分代码省略.........
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:101,代码来源:uiTable.php

示例11: del

 public function del()
 {
     $class = new ormClass(system::url(2));
     if ($class->delete()) {
         echo "ok";
     } else {
         echo "error";
     }
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:10,代码来源:__class.php

示例12: del

 public function del()
 {
     if (system::issetUrl(2) && is_numeric(system::url(2))) {
         // Одиночное удаление
         $obj = ormObjects::get(system::url(2));
         if ($obj->isInheritor('user') && $obj->id != user::get('id')) {
             $this->sendMailDel($obj);
             cache::delete('user' . $obj->id);
             $obj->toTrash();
             echo 'delete';
         }
     } else {
         if (isset($_POST['objects'])) {
             // Множественное удаление
             while (list($id, $val) = each($_POST['objects'])) {
                 if (is_numeric($id)) {
                     $obj = ormObjects::get($id);
                     if ($obj->isInheritor('user') && $obj->id != user::get('id')) {
                         $this->sendMailDel($obj);
                         cache::delete('user' . $obj->id);
                         $obj->toTrash();
                     }
                 }
             }
             echo 'delete';
         }
     }
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:29,代码来源:__user.php

示例13: socialAuthConfirm

 static function socialAuthConfirm()
 {
     if (user::isGuest() && isset($_SESSION['SOCIAL_AUTH_USER_INFO'])) {
         $confirm = system::POST('confirm', isBool);
         $email = system::POST('email', isEmail);
         $validate = true;
         if (empty($_SESSION['SOCIAL_AUTH_USER_INFO']['email'])) {
             if (reg::getKey('/users/ask_email') && empty($email)) {
                 $validate = false;
             } else {
                 if (!empty($email)) {
                     $_SESSION['SOCIAL_AUTH_USER_INFO']['email'] = $email;
                 }
             }
         }
         if (reg::getKey('/users/confirm') && !$confirm) {
             $validate = false;
         }
         if ($validate) {
             $user = self::createUserForSocial($_SESSION['SOCIAL_AUTH_USER_INFO']);
             if ($user && !$user->issetErrors()) {
                 user::authHim($user);
                 self::closeWindowAndOpen('/');
             } else {
                 echo $user->getErrorListText();
             }
             system::stop();
         }
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:30,代码来源:user.php

示例14: moveto

 public function moveto()
 {
     $obj = new ormFieldsGroup(system::url(2));
     $obj->setPosition(system::url(3));
     if ($obj->save()) {
         echo "ok";
     } else {
         echo "error";
     }
     system::stop();
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:11,代码来源:__fgroup.php

示例15: rssAction

 public function rssAction()
 {
     if (!system::issetUrl(2)) {
         page::globalVar('h1', lang::get('RSS_TITLE'));
         page::globalVar('title', lang::get('RSS_TITLE'));
         return page::macros('structure')->rssList();
     } else {
         header("content-type: text/xml; charset=UTF-8");
         echo page::macros('structure')->rss(system::url(2));
         system::stop();
     }
 }
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:12,代码来源:controller.php


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