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


PHP Messages::getInstance方法代码示例

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


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

示例1: parse_uri

 /**
  *	\brief Lê a URLs (em modo re-write) e transforma em variáveis $_GET
  *
  *	\note Este método não retorna valor
  */
 public static function parse_uri($UriString = NULL)
 {
     // $_GET['_rw_'] é definida no .htaccess e contém a url em modo ReWrite
     if (NULL === $UriString) {
         $UriString = !empty($_GET['_rw_']) ? $_GET['_rw_'] : '';
         //unset($_GET['_rw_']);
     }
     // [pt-br] Processa a URI
     $Segments = array();
     self::$segments = array();
     //foreach(explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $UriString)) as $val) {
     preg_match('/^([A-Za-z0-9_.\\-\\/]+)*[&]?/', $UriString, $UriString);
     if (isset($UriString[1])) {
         $UriString = $UriString[1];
         foreach (explode('/', $UriString) as $val) {
             $val = trim($val);
             if ($val != '') {
                 self::$segments[] = $val;
             }
         }
     }
     if (empty(self::$segments)) {
         self::$segments[] = 'index';
     }
     //Se suspeita de Big int > 8, Index
     foreach (self::$segments as $teste => $value) {
         if (is_numeric($value)) {
             $value = strlen($value);
             $valueLTRIM = strlen(ltrim($value, '0'));
             if ($value > 14 or $valueLTRIM > 16) {
                 Messages::getInstance()->error('URL inválida.');
                 URI::redirect(URI::build_url(array('.')));
             }
         }
     }
     // [pt-br] Guarda os parâmetros passados por GET na URL
     foreach ($_GET as $key => $value) {
         if ($key == '_rw_') {
             continue;
         }
         self::$get_params[$key] = $value;
         unset($_GET[$key]);
     }
     //Se suspeita de Big int > 8 , Index
     foreach (self::$get_params as $teste => $value) {
         if (is_numeric($value)) {
             $value = strlen($value);
             $valueLTRIM = strlen(ltrim($value, '0'));
             if ($value > 16 or $valueLTRIM > 16) {
                 Messages::getInstance()->error('Parâmetro inválido.');
                 URI::redirect(URI::build_url(array('.')));
             }
         }
     }
 }
开发者ID:sostenesgomes,项目名称:middleware-vtex,代码行数:60,代码来源:URI.php

示例2: Delete

 public function Delete()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     try {
         $this->db->delete("ge_ads", $this->input->getInt("id"));
         Messages::getInstance()->logSuccess('تبلیغ مورد نظر  با موفقیت حذف شد');
     } catch (Exception $ex) {
         Messages::getInstance()->logError('هیچ تبلیغی حذف شد');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/ads/show");
 }
开发者ID:redknight,项目名称:frot,代码行数:11,代码来源:AdminAdsService.php

示例3: saveStatus

 public function saveStatus()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     fb($this->input->getInt('RequestID'));
     if ($this->input->getInt('RequestID') != 0) {
         $data->id = $this->input->getInt('RequestID');
         $data->status = $this->input->getString('status');
         try {
             $this->db->StoreObject("sh_requests", $data);
             Messages::getInstance()->logSuccess('تغییر مورد نظر با موفقیت انجام شد');
         } catch (Exception $ex) {
             Messages::getInstance()->logError('در انجام عملیات خطایی رخ داده است');
         }
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopRequest/showrequest");
 }
开发者ID:redknight,项目名称:frot,代码行数:16,代码来源:AdminShopRequestService.php

示例4: saveCode

 public function saveCode()
 {
     Factory::getUser()->authorise("template", ResponseRegistery::getInstance()->site_id);
     $db = Factory::getDBO();
     $data->main = $this->input->getString('main');
     $data->id = $this->getWebLogTemplateId();
     $db->StoreObject("ge_templates", $data);
     //Messages::getInstance()->logSuccess('قالب با موفقیت ذخیره و اعمال شد');
     $msg = Messages::getInstance();
     $msg->logSuccess('قالب با موفقیت ذخیره شد');
     if ($this->compile($data->main, $data->id)) {
         $msg->logSuccess('قالب با موفقیت اعمال شد');
     } else {
         $msg->logError('در ساختار قالب خطا وجود دارد لطفا قبل از نمایش وبلاگ این خطاها را بررسی کنید');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/template/show");
 }
开发者ID:redknight,项目名称:frot,代码行数:17,代码来源:DashboardTemplateService.php

示例5: save

 function save()
 {
     if (Session::getInstance()->Captcha && Session::getInstance()->Captcha == $_POST["captcha"]) {
         Session::getInstance()->Captcha = null;
         $ob->article_id = $this->input->getInt('article_id');
         $ob->name = $this->input->getString('name');
         $ob->email = $this->input->getString('email');
         $ob->website = "http://" + $this->input->getString('website');
         $ob->content = nl2br($this->input->getString('content'));
         $ob->private = $this->input->getInt('private');
         $ob->ip = $_SERVER['REMOTE_ADDR'];
         $this->db->StoreObject("wb_comment", $ob);
         Messages::getInstance()->logSuccess('نظر شما ذخیره شد');
         fb($ob);
     } else {
         Messages::getInstance()->logError('عکس امنیتی اشتباه است');
     }
     $this->show();
 }
开发者ID:redknight,项目名称:frot,代码行数:19,代码来源:CommentService.php

示例6: deleteSubgroup

 public function deleteSubgroup()
 {
     Factory::getUser()->authorise("group", ResponseRegistery::getInstance()->site_id);
     try {
         $this->db->delete("sh_subgroups", $this->input->getInt('id'));
         Messages::getInstance()->logSuccess("زیر گروه مورد نظر با موفقیت حذف شد");
     } catch (Exception $e) {
         Messages::getInstance()->logError("هیچ زیر گروهی حذف نشد");
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopGroup/showGroups");
 }
开发者ID:redknight,项目名称:frot,代码行数:11,代码来源:DashboardShopGroupService.php

示例7: savePassword

 public function savePassword()
 {
     $user = Factory::getUser();
     $user->authorise('edituser', Session::getInstance()->weblog_id);
     $message = Messages::getInstance();
     if ($this->input->getString('newpass') == $this->input->getString('newpass2') && $this->input->getString('newpass')) {
         if ($user->changePassword($this->input->getString('oldpass'), $this->input->getString('newpass'))) {
             $message->logSuccess('پسورد با موفقیت عوض شد');
         } else {
             $message->logWarning('کلمه عبور قدیمی اشتباه است');
         }
     } else {
         $message->logWarning('کلمه عبور و تکرار آن برابر نیست');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . '/user/changePassword');
 }
开发者ID:redknight,项目名称:frot,代码行数:16,代码来源:UserService.php

示例8: delete

 public function delete()
 {
     Factory::getUser()->authorise("item", ResponseRegistery::getInstance()->site_id);
     try {
         $item_id = $this->input->getInt('id');
         $query = "DELETE FROM sh_subgroups_items WHERE item_id = {$item_id}";
         $this->db->execute($query);
         $query = "DELETE FROM sh_images WHERE item_id = {$item_id}";
         $this->db->execute($query);
         $query = "DELETE FROM sh_items WHERE id = {$item_id}";
         $this->db->execute($query);
         // [FIXIT] images file not delete
         Messages::getInstance()->logSuccess("کالای مورد نظر با موفقیت حذف شد");
     } catch (Exception $e) {
         Messages::getInstance()->logError("هیچ کالایی حذف نشد");
         Messages::getInstance()->logError($e);
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/shopItem/showItem");
 }
开发者ID:redknight,项目名称:frot,代码行数:19,代码来源:AdminShopItemService.php

示例9: disban

 public function disban()
 {
     Factory::getUser()->authorise("admin", ResponseRegistery::getInstance()->site_id);
     $site_id = $this->input->getInt('id');
     $tmp->id = $site_id;
     $tmp->active = 1;
     Factory::getDBO()->StoreObject("ge_sites", $tmp);
     Messages::getInstance()->logSuccess('سایت مورد نظر با موفقیت فعال شد');
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/admin/blog/show");
 }
开发者ID:redknight,项目名称:frot,代码行数:10,代码来源:AdminBlogService.php

示例10: commentDelete

 public function commentDelete()
 {
     Factory::getUser()->authorise("comment", ResponseRegistery::getInstance()->site_id);
     try {
         $sql = 'DELETE FROM  wb_comment WHERE id=' . $this->input->getInt('id');
         //FIXME. ' and weblog_id=' . Session::getInstance()->weblog_id;
         $this->db->execute($sql);
     } catch (MySQLException $e) {
         if ($e->getCode() == 1451) {
             fb($e);
             Messages::getInstance()->logWarning('یک یا چند پست با این موضع وجود دارد ابتدا انها را ویرایش کنید');
         } else {
             throw $e;
         }
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/post/comment");
 }
开发者ID:redknight,项目名称:frot,代码行数:17,代码来源:DashboardPostService.php

示例11: staticDelete

 public function staticDelete()
 {
     $query = 'DELETE FROM wb_links WHERE weblog_id=' . Session::getInstance()->weblog_id . ' AND id=' . $this->input->getInt("id");
     fb($query);
     try {
         $this->db->execute($query);
         Messages::getInstance()->logSuccess('لینک مورد نطر با موفقیت حذف شد');
     } catch (Exception $ex) {
         Messages::getInstance()->logError('هیچ لینکی حذف نشد');
     }
     $this->reponse->redirect(ResponseRegistery::getInstance()->baseURL . "/dashboard/link/staticLinks");
 }
开发者ID:redknight,项目名称:frot,代码行数:12,代码来源:DashboardLinkService.php

示例12: __construct

 public function __construct($messageSystem, $databaseSystem)
 {
     $this->messageSystem = Messages::getInstance();
     $this->databaseSystem = Database::getInstance();
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:5,代码来源:Users.php


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