Laravel 4 Beta 5会话扩展/替换 [英] Laravel 4 Beta 5 Session Extend/Replace

查看:45
本文介绍了Laravel 4 Beta 5会话扩展/替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对会话驱动程序有非常特殊的需求,因为我将使用pingbacks(API规范)实现基于API的登录,并且我需要会话驱动程序的非常自定义行为.同时包括数据库/内存缓存的交互.该项目是xD的一种不要问不说"的方法,但是无论如何,任何帮助将不胜感激.

I have very specific needs to the session driver because I'll be implementing an API based login with pingbacks (API specification) and I need very custom behavior of the session driver. Including database/memcached interaction at the same time. The project is "don't ask don't tell" kind of a thing xD but anyhow, any help would be deeply appreciated.

我知道laravel 4支持这种事情.他们支持自定义创建者,但是关于该操作的文档只有0个. global.php中不再使用"Session :: extend"方法:/

I know that laravel 4 support this kind of thing. They support custom creators but there is exactly 0 documentation on how to do that. There is no longer "Session::extend" method to use in global.php :/

推荐答案

基本上,您可以扩展/替换任何Laravel类,只需创建自己的类,然后将其替换为app/config/app.php.

Basically you can extend/replace any Laravel class by just creating your own and then replacing it in app/config/app.php.

从Dayle:在Laravel 4中,通过使用ProviderInterfaces加载组件(核心类),这些组件在应用程序配置中列出.如果将提供者更改为自己的自定义提供者(对于扩展类),则不仅代码使用了新模块,但是Laravel核心也将利用这些更改."

From Dayle: "In Laravel 4, components(core classes) are loaded by using ProviderInterfaces, these are listed within the application configs. If you change a provider to your own custom provider (for an extended class) not only will your code use the new module, but the Laravel core will also make use of these changes."

http://laravel.uservoice.com/forums/175973-laravel-4/suggestions/3150953-more-simple-way-to-extends-core-class

这篇关于Laravel 4 Beta 5会话扩展/替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆