PHP session handling to save to database [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Learning PHP, the most frustrating hurdle for me seems to be weeding through outdated tutorials, blog and forum posts to find relevant, modern guides.
I want to understand how to implement saving sessions data to databases the right way. However, most of the instructions I can find regard custom session handlers, and seem to be many years old, and this concerns me. I don't want to waste my time learning outdated procedures. Are custom handlers still the way to accomplish this? Are there better/newer modes of storing sessions to db's? I would greatly appreciate anyone taking the time to point me in the right direction. Many thanks!

To confirm what #rickdenhaan was saying in comments, custom handlers is the right way to go.
PHP doesn't provide a lot of different session handles. Maybe because Zend (which supports PHP) provide Zend Session tools.
To avoid reinventing the wheel you have to options :
Use a framework
That will handle all of this kind of stuff for you : session, MVC, ORM, config files etc
Most of the time this is the right choice for a new project, and Symfony and Laravel are great projects to start.
Use external modules
If you want a more modular approach, you can import externals modules with composer and create something that suits your particular needs.
This can be a great approach to refactor an existing project (either based on an old framework, or on legacy code)
And in this case, you still don't reinvent the wheel, you can use Zend Tools to handle your session :
https://github.com/zendframework/zend-session
Install it with composer and start working with it. Use it with built-in php tools session_set_save_handler()
I hope this answer your question in a broader way.

Related

Create a website with or without a framework like TYPO3? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I hope my question fits in stackoverflow, let me explain my problem:
I am using to program websites in Java, Javascript, HTML, CSS and SQL in Eclipse for about 2 years. Now I want to create (alone) a pretty big community website in PHP (this program language is pretty new for me). In this context, I found the framework TYPO3 and try to learn it. After all I must say, that it seems very complicated to me and I can´t find the advantage over programming files strict in an normal editor without TYPO3. I'm in an inner conflict about whether this would be good or bad for my intention to create the website. I can´t find the benefits, but I often read, that they exist. Is Typo3 (or another framework for PHP) worth learning when you already have programming experience?
Note: Your question doesn't meet StackOverflow's requirements as it can produce many equally valid answers, here's my opinion from point of view of long term TYPO3 developer:
TYPO3 is great, well known, stable tool (btw. it's a CMS, not a framework) used for building thousand of sites of different size - from small product pages to big corporate portals. It brings lot of useful techniques and technologies just out-of-the-box, login forms, contact forms, user permissions, ready to use galleries, extensions, etc, etc... so you don't need to touch every single aspect of the web-programming as you get it just right after installing the system. It does matter especially when you are gonna to work alone - when you physically won't be able to concentrate on every aspect in any sensible time. For sure you'll get benefits using it instead writing it yourself - especially with your relatively short overall experience.
But is it best choice for your needs? I don't know, nobody can know it without analyzing your concept. TYPO3 may be to heavy for the task, it's the price for its flexibility, maybe you will need to use some faster framework, i.e. (TYPO3) Flow Framework (PHP, Framework for TYPO3's originally intended successor Neos CMS), Symfony (PHP) or Play Framework (Java) which also gives you great starting point, but requires more work on every element, maybe...
The only way to determine the valid path is to compare solutions yourself or order such a comparison from a qualified agency.
Laravel 5 is my favorite PHP framework. When you do understand this framework, it's so easy to manipulate routing (url), mysql logic, security, etc. I use it for every project with PHP. Try it, there's ton of tutorial out there!

Event-Driven PHP Framework? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm wondering if there are any completely event-drive frameworks out there for PHP which are based around dependency injection for decoupling. I know there are some frameworks that make use of these patterns - but in the end the entire life-cycle of the application is still pre-defined and linear in style.
For example, most frameworks are built to receive, process, and return results from HTTP requests. An event drive framework would have handlers for that, but also be able to be used for new purposes like background processing, command line interaction, or other non-standard use cases.
It sounds to me like the Photon framework fits closest to your description - the key point is that you can't have event-driven code without php running in a daemon-like process. Your choice of webserver in fact dictates whether what you ask is possible or not - photon is dependent on mongrel2.
I have never used it for a project personally, but I believe that Prado covers what you are asking. It is componentised, but I cannot be sure about the dependency injection aspect.
From their site:
PRADOTM is a component-based and event-driven programming framework for developing Web applications in PHP 5. PRADO stands for
PHP Rapid Application Development Object-oriented.
I know of it because one of my university class mates designed the logo and website for the project.
Not used it, but I believe in addition to Prado, which Treffynnon has mentioned, Qcodo is a pure event-driven framework.
I was looking what is around as well and i came across p4e which is based on zend framework,and nette, hope it can help!
Off the bat there are these 2 as well:
Zend Framework 2 (still in beta)
symfony 2
Both have all the things you are looking for I believe.
Symfony2. Simple as that.
http://symfony.com/
Yii ,It is a component based and event-driven framework, Pure OOP and MVC. It is very clean and neat. Check it out.
http://www.yiiframework.com
The Qbix Platform is heavily event-driven in PHP, although it does not use dependency injection.
Reactphp is what you are looking for.

Where can I find a sample PHP MVC application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've been attempting to understand how MVC applications are structured and have spent time with frameworks like CodeIgniter and Zend making small test websites to play around with. However I'm still unsure if I completely understand how to separate the logic properly since it still seems like it's taking more time than it's saving.
I learn best from looking at well-written code and I have a feeling there are a few talented programmers on SO.
Are there any good "Real World" examples of a PHP MVC application that I could look over? I've made the mistake of not asking about best practices and instead pick up poor coding practices in the past and I want to avoid making such a mistake moving forward.
Thanks SO!
I found this PHP tutorial to be useful when I first wanted to improve my understanding.
I'm writing an open source bugtracker, you might want to have a look. The code may not be 100% neat and clean, but it's mostly better than worse ;). http://code.google.com/p/bugraid/
A pretty good basic Zend example is http://akrabat.com/zend-framework-tutorial/
Or you could just use ZFtool to create a project a very basic program and understand how it is brought together
>zf create project <path> from within the bin directory in your zend download

PHP Framework / Library Suggestions for a Backend [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 months ago.
Improve this question
I am about to start to developing backend site of a php project. Companies and site admins will login to this site and manage their data on the project.
My previous admin panel experiences were full of agony and pain. So I want to make sure that I choose correct tools for my purpose.
By the way, please note, I'm not looking for scaffolding. There won't be much tables in my database. Instead, there will be complex logic between entities.
I want clear seperation of markup and logic code and easy-to-use and standardized user-interface.
Thank you.
Edit:
I understand this is very subjective. This is why I call it suggestion. I want to try a few of chunks of code before going along with one of them.
There is no perfect answer for this, it depends a lot of your (and your team) programming experience and your project's requirements.
As it talks about PHP and backoffice, I suggest you look at symfony framework. It's a RAD framework with great admin features and tons of plugins easing backpanel developement.
I understand you don't want scaffolding, in symfony you can choose to use a very customizable admin generator or build your own forms/listings (or mix between both, using generated as a good code base and extending it).
It comes with a great separation of concerns as it uses MVC paradigm, but aside from MVC it has form management sub-framework which can help a lot developing backoffice.
Be careful if you're not familiar with PHP5 OOP and MVC it could be little complex to learn and understand, but if your planning could allow you to have time to learn symfony programming, it's an experience I would recommand to every PHP developer.
This framework is very well documented, and as an introduction tutorial they offer a class around a website example with its backend application.
Of course, this is subjective and others would perhaps recommend you other choices.
Only recently went through a couple of frameworks about a month ago for a site I was working on and found CodeIgniter was easiest to get up and running and had the best documentation and tutorials.
http://codeigniter.com/
Alternatives are symphony, cakePHP and Kohona

What are some flexible, free CMS's for written in PHP for large websites? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a content management system (CMS) written in PHP for a large and diverse website. Here's what I'm looking for:
Design flexibility -- The look and feel needs to be completely customizable. Specific pages may need to have design elements
Modular design -- I want to be able to add features myself if they're needed.
Production ready
Advanced user permissions
MySQL or Oracle
What I can sacrifice:
Steep learning curve -- I am experienced PHP and RoR developer. I'm alright with needing to take a few days/weeks to learn it.
Performance -- we don't get much traffic.
SEO -- This is on a local intranet, no need for SEO. Pretty URLs are nice, but not required.
If there isn't a CMS that meets these needs, my last option would be to build one from scratch using Kohana 3.0, which I'm already using on a daily basis.
Background: At my place of work we're looking to redesign/develop our existing website hosted on a local network. This site consists of somewhere between 600-1,000 static HTML pages, many of which contain varying design elements (like jQuery tabs). Though the site is pretty big, we probably only get around 100 hits per day. There will be customers (no coding experience) and fellow web-developers modifying the content on these pages.
http://modxcms.com/ -> modx modx modx an etomite fork
Modx's REVO release is OOP, but might not be release ready, but the EVO release is tested and true :)
it's great for modular design, design flexibility and above all extensibility.
Especially given that you are willing to go through a bit of a steeper learning curve, with some php knowledge you'll be able to get a lot out of modx. Using the "usual suspects" can be limiting in the areas of extensibility, where though it is possible, but everything can feel like a hack.
I would say the usual suspects Joomla and Drupal. Added benefit of huge communities.
I have had good experience with Etomite
It allows you to plug-in PHP code easily, it has nice template structure as well as static (Chunks) and dynamic (Snippets) modules that can easily be added to any page or template. I also found it had a good security structure. It probably does not have such a large community but the support forums are sufficiently active.
Using Joomla and TomatoCMS is so good, MVC structure

Categories