Never used it before so I'm going to mess up probably.
I'll post some code as I go so I can get some feedback.
A few questions to start with before I begin.
1. If I don't like classes is that ok?(Most custom session tutorials I found use classes. I prefer first class objects so I'm not really keen on using classes. Just my opinion. Not that I couldn't do it. Functional programming is my fun and that works well with first class objects. That said, I hope the creators of php implement them in cooler ways in the future.)
2. Is there a way to make a general custom session handler that will just accept parameters and use that to create a session of any size of variables?
3. Can sessions be made to use an array that's unserialized from a database.
4. When using sessions as arrays should the array be serialized before its placed in the session or should the custom session handler do that?
5. Would it be extreme to use runkit_function_add(), runkit_function_redefine(), runkit_function_copy(), runkit_function_rename(), runkit_function_remove() to dynamically create functions that can be used to create new custom session handlers that can be used to make any sort of session.
6. Can lambdas and anonymous functions call or generate session variables.(I just haven't tried yet.)
7. Can a function factory be created using lambdas and anonymous functions or maybe use the stuff from question 5 to do that with lambdas.
I think that's it for now.
I'm hoping to abstract away the session interface so it's easier to use. Abstraction without classes is a not as easy, but I'd like to try. Just gonna use functions.
I'm mostly a hobby programmer right now so you won't have to worry about me cheating at school.(I don't go. Web searches, books from the book store, and forums like this are my school right now.)
I mostly learn by copying letter by letter(looking at a tutorial and just writing it out), but I'm having trouble finding information about the specific topics of db sessions and most of the other topics in my questions. I'm pretty good at functional programming so I'd like to use that method to handle php sessions. There is hardly much for reference on the topic of using lambdas with sessions.
Aside the lack of knowledge about the topics at hand I've noticed that each time I find a new element in a language the more complex the mechanism is the more likely there will be unpublished parts of the theory.
I understand there are limits to what can be published because of time and complexity, and that's why I'm here asking questions about this. I'll be coding this stuff whether or not some one helps me. If there are any very knowledgeable people on these subjects I could use some help so my head doesn't explode with testing code while I also learn it.
I might split this topic into other topics if my questions become more specific.
P.S. Don't point me to a link like the PHP docs or some other tutorial. Hell, even if it's not the PHP docs I've probably been there. I search google like I'm a horse and google is my grazing field. If you're too busy to answer every thing or most of it feel free to answer just a few things if you can. Time is precious.
This post has been edited by hiddenghost: 13 December 2011 - 07:03 PM

New Topic/Question
Reply




MultiQuote




|