2

I need to create the server part of my mobile application.

The server part consists of registering a user to the server by making a simple http post request (json) from device to server and saving the users credentials to database (mysql).

Some http post requests from the devices , stating to the server in which kind of events they want to be subscribed (my server keeps data of some events).

Send push notifications , to my devices from the server when a new event is generated (already have the php scripts for that).

For a kind of server likes this , do i need to use a php framework? In this page i found a list of different frameworks. I found this page while reading php tutorials and some of them suggested using a php framework.

But what are these frameworks for? Do i need to learn/use one? When are they needed. Are they for front-end sites?

Thank you for reading my post :)

2 Answers2

0

Frameworks are created to make your work easy.

Advantages of using framework

  1. There are a lot of functions that are already written
  2. There are some good programic patterns. You have good code and file organisation.
  3. There are a lot of libraries and plugins.
  4. There is MVC pattern already implemented.
  5. They give you advantage of faster develompent.
  6. There is community support
  7. They are mostly fast and secure.

Why use a framework with PHP?

Why do I need to use a popular framework?

Using framework in the begining may seem to be hard, but when you learn it, it makes coding a lot faster!

Disadvantages of using framework:

  1. You will learn a lot by writing your own.
  2. If you need it for small project like portfolio, there is no need for giving yourself more work to set the framework to work.
  3. There is a lot of things in framework that you don't need and they take its space on server.

https://softwareengineering.stackexchange.com/questions/49488/when-not-to-use-a-framework

It's not about frontend project, if you have big project you should use framework if it's little it's not worth. That is my opinion.

I'd suggest you Zend Framework or Symfony if you decide to use Framework.

Community
  • 1
  • 1
Robert
  • 19,800
  • 5
  • 55
  • 85
  • So when i use a framework , i use different commands? Will it be a different syntax or is php again? I cant see how more easily i could possible make a http post request using curl , creating a database with pdo etc . I mean i set up what i need with 30 lines of code. Framework can do that even easier better or more secure? I could imagine that a framework would be nice maybe to implement a google map easier in a web page , to add RSS , pdf support and stuff like that. Am i wrong here? –  Apr 30 '13 at 11:38
-1

I recently have the similar project requirement for a REST based application on PHP. We choose Zend Framework 2 which have REST supported architecture. I check out same support on Symfony 2. So One thing i get it that Framework gave you standrized way of code/architecture + set of tools. If I decided for core php application, then obviously I need to write a REST based API Server architecture. Which is already available in case of Frameworks.

kuldeep.kamboj
  • 2,566
  • 3
  • 26
  • 63
  • But its super easy to make http requests using curl for example. What more do you need for a REst application? –  Apr 30 '13 at 11:33
  • Actually REST is more than just curl requests. REST Based architecture should use Request Type (POST, GET, PUT, DELETE etc.) detection based action instead of just uri based action See [WIKI Representational_state_transfer](https://en.wikipedia.org/wiki/Representational_state_transfer#Vocabulary_re-use_vs._its_arbitrary_extension:_HTTP_and_SOAP). – kuldeep.kamboj Apr 30 '13 at 11:45
  • Also one more thing, I am not to support or refuse framework in general instances but in a REST based application, where i experienced the difference. – kuldeep.kamboj Apr 30 '13 at 11:48