草庐IT

codeigniter-helpers

全部标签

php - 如何使用 codeigniter-predis 库在 redis 中订阅?

我必须发布“测试”channel并收听“mytesting()”,但发布已成功完成。但在订阅mytesting()时未执行。publicfunctiontest(){$this->redis_connection();$this->redis->publish('testing',"hi");try{$success=$this->redis->subscribe('testing','mytesting');print_r($success);}catch(Exception$e){print_r($e->getMessage());}}publicfunctionmytesting

php - 如何在 heroku 上使用 redis 云进行 codeigniter session

我是heroku的新手。我只是在heroku上安装了rediscloud。我正在使用codeigniter开发我的应用程序,我想了解如何处理我在Google上搜索的redis服务器上的session,所以最后我得到了这个链接ACodeIgniterlibrarytointeractwithRedis这是否足以处理redis上的session或我必须做更多的事情请帮助我。如果这个github库很有用,那么我如何使用这个库进行session管理谢谢 最佳答案 伙计们这ACodeIgniterlibrarytointeractwithRe

ruby-on-rails - Redis模型缓存,什么时候调用items_helper中的fetch_items?

我正在尝试将Redis用作我的应用程序和PostgreSQL数据库之间的缓存层。请看下面,我的路线,items_controller,items_helper文件。我对应该如何调用items_helper中的#fetch_items感到困惑。目前,我正在从我所有的Controller操作中渲染jbuilder模板。我需要保留此功能。路线Rails.application.routes.drawdoresources:usersresources:itemsget'users/:id/sold_items'=>'users#sold_items'get'categories/:id/av

php - 使用 predis 包将缓存超时设置为 Codeigniter 中的一个键

在Codeigniter中,我使用Composer安装了predis包。我可以使用这个包设置和获取缓存中的值。我的要求是我需要使用Redis将值保存在缓存中1分钟。我通过Redis终端看到了不同的选项设置。但是我需要在Controller本身中设置时间限制。任何想法? 最佳答案 只需通过predis使用EXPIRE即可:$client=newPredis\Client();$client->set('foo','bar');$client->expire('foo',60); 关于php

php - 无法将 Redis 与 Codeigniter 集成

我正在使用codigniter-redis在codeigniter框架内使用redis的库。我放了Redis.php(库文件)在applications/library和redis.php(配置文件)在applications/config这是我的代码classTestextendsController{function__construct(){log_msg('info',"loadingredis");$this->load->library('redis',array('connection_group'=>'default'),'redis_default');}functi

使用PHP在Codeigniter中使用PHP到JSON的数组

我有一个如下的数组:Array([0]=>Array([SI]=>1[name]=>Nick[location]=>Russia[year]=>2011)[1]=>Array([SI]=>8[name]=>Mike[location]=>Russia[year]=>2011)[2]=>Array([SI]=>2[name]=>Tom[location]=>Russia[year]=>2010)[3]=>Array([SI]=>6[name]=>Duke[location]=>Russia[year]=>2010))当前的JSON格式:{"name":"Amalians","img":"http

php - 带有 MongoDB 子数组的 Codeigniter

我在mongodb中有以下类型的集合:Array([_id]=>4fcf383a5990581c0b000015[user_id]=>1[username]=>admin[password]=>21232f297a57a5a743894a0e4a801fc3[first_name]=>admin[last_name]=>admin[address]=>[address_2]=>[deshboard_report]=>Array([0]=>Array([report_ids]=>1[rpt_color]=>color-red[rpt_status]=>max[report_title]=

mongodb - 使用 Meteor 从 Mongodb 集合调用 handlebars helper 时没有这样的模板错误

我有一个HTML模板,我想在其中使用handlebars助手显示存储在mongo对象中的值。HTML-我想将answer1显示为存储在mongo中“Question1”下的字符串HereareyourpreferencesAnswertoquestion1{{>answer1}}Answertoquestion2{{>answer2}}这是我的.js助手。(为什么它不在此处将answer1存储为可由我的HTML文档中的{{answer1}}调用的模板?)Template.preferencesView.helpers=({answer1:function(){returnPrefere

php - 尚未安装或启用MongoDB PECL扩展 php7.0 codeigniter cimongo library ubuntu16.04

我正在尝试将CIMongo库用于codeigniter以使用php和mongo但我收到错误消息:尚未安装或启用MongoDBPECL扩展但我正确安装了一切-pecl安装mongodbapt-get安装php-mongodb将不胜感激任何帮助提前致谢 最佳答案 对于在谷歌搜索“尚未安装或启用MongoDBPECL扩展”后最终出现在这里的Windows用户。(可能有同样问题的其他操作系统用户也可以从这里获取一些线索):首先感谢simon他的回答here以前的codeigniter版本使用php_mongo.dll(mongopecl),

php - 无法将数据插入多个数据库 Codeigniter(MongoDB 和 MySQL)

我正在引用https://github.com/chriskacerguis/codeigniter-restserver开发一个restapi服务器.我正在使用Mongo和Mysql来保存api响应。我的Controller保存webhooks端点响应。我可以将数据保存到Mongo,但MYSQL不工作。请指教。我的Controller-Hooks.phppublicfunctionopened_post(){//$_POST=$this->request->body;//Getthemessageidif(!$mid=$this->input->post('message-id'))