I've been developing in PHP for about 8 years as a hobby. In 2009, I picked up codeigniter and since then I've not managed to get a single project developed.
I find it slows me down trying to work out how to modify it to work the way I want, when if I was working in pure PHP, I'd know, or I'd be able to quickly find a snippet for.
I've tried CodeIgniter, Kohana and Symfony. I love the ease of use (and I've also started using doctrine as an ORM which massively sped up my database work), but I find projects are taking me 3-4 times the amount of time it took in pure PHP. I get bored and frustrated when I can't find a solution to a problem I've previously solved in pure PHP.
Has anyone gone back from using frameworks to a no-framework approach. Is there anything like a basic security framework (prevent XSS, filter posted data, provide a cleaning function for use with databases)? I think something like that would benefit me much more than a full scale framework. I think learning to work with frameworks has taught me a lot, but I'd be happier working with my own code.
So, can you build rich web apps without using frameworks? The short answer is yes. There are plenty of websites out there that are built without using a framework; GitHub and YouTube are probably the most popular ones. The long answer might be a little more complicated than you think.
Creating the Web Server We'll be using Express for our web server, so lets start by installing the dependencies and creating our directory structure. Next, we can create a server. js file and include the following. Navigating to http://localhost:3000 should now display your HTML file.
Yes, it is entirely possible to write any web application without framework. Keep in mind that frameworks are also written in their respective programming languages - therefore, you can achieve same results without one, but it will be more time-consuming and will need more work to "reinvent the wheel".
Frameworks are useful because IT processes can be large and complex. Without a consistent set of operating principles, records and governance practices, service delivery can become haphazard and inconsistent.
Current versions of PHP5 include much of the security framework you're looking for as part of the standard library.
httponly
attribute to session_set_cookie_params() (Protects against scripts reading the session cookie in compatible browsers)httponly
attribute with setcookie().If you're accepting HTML as input, I recommend grabbing HTML Purifier and calling it via a FILTER_CALLBACK line in your filter_input_array setup. Its whitelist-based approach to input security makes a great (and very powerful) first line of defense against XSS.
As far as I can tell, PHP doesn't come with a mechanism for protecting against cross-site request forgery, but I'm sure Google can help you with that one. The OWASP Security Cheatsheets include a section on it if you want to implement your own protection.
Out of curiosity, I decided to also start looking at standalone components and here's what I've found so far:
Templating:
Stuff I still haven't looked into properly:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With