RESTful Web服务与PHP的Silex:好的选择吗? [英] RESTful webservice with Silex PHP : good choice?

查看:179
本文介绍了RESTful Web服务与PHP的Silex:好的选择吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个移动应用程序REST API,我真的不知道如何开始的。
我读到一般的REST一些文章和教程,但我没有找到PHP编写的配合物的API的例子。

I have to create a REST API for a mobile application and I don't really know how to begin it. I read some articles and tutorial about REST in general, but I didn't find a complexe API example written in PHP.

那么多的研究之后,我选择使用微架构(而不是从头开始)。喜欢的Symfony2或Zend的一个完整的框架,提供一些我不需要的方法,我认为他们是太大了。
因为我已经和Silex的PHP的工作,我选择了它。

So after more researches I choose to use a micro-framework (rather than start from scratch). A full framework like Symfony2 or Zend provide some methods that I will not need, and I think they are too big for. Because I already worked with Silex PHP, I choose it.

但有一个问题留在我的脑海里:捷希凯是一个不错的选择创建(未来)大API

But one question stay in my mind : is Silex a good choice to create a (future) big API ?

的API将演变,并可能越来越多配合物(了解更多的URI将在以后的avalaible,因为我们的目标是从SOAP迁移到REST)。

The API will evolve and could be more and more complexe (understand more URI will be avalaible in future, because we have goal to migrate from SOAP to REST).

由于PHP的Silex使用一个单一的文件惯例,我有点害怕使用它(因为文件将被越来越多的大,和我一起表演应该下降)。
此外,我想缓存在服务器上的结果(另外,对于HTTP缓存)必要时,减少查询数据库(MySQL的)。

Since Silex PHP uses a single file convention, I'm a little scared to use it (because file will be more and more larger, and I supposed with performances falling). Also I would like to cache on server results (additionally with HTTP caching) when necessary, to reduce queries to database (MySQL).

你觉得和你有什么建议? :)

What do you think and what do you advise ? :)

推荐答案

Silex的意思是在小项目中使用的microframework。它适用于小型网站的低流量。这也是自我介绍到像依赖注入一些概念,没有引入太多的抽象层的好方法。
他们最近推出了目标在他们的网站上为单文件的应用程序,给你一个位在目标范围为框架。

Silex is a microframework meant to be used in small projects. It's suitable for small websites with low traffic. It is also a good way to introduce yourself into some concepts like dependency injection, without introducing too many abstraction layers. They've recently introduced the target in their website as "single-file apps", giving you a bit of the target scope for the framework.

我想应该是相当公认的事实Silex的不适合任何大。
Silex的不会表现不好,如果你的项目工程,但它不会是最好的使用,一旦你开始增加,因为它不会帮助你太多的工作。 Symfony的使用概念,你会看到Silex的是,你可以使用有很多包,插件和一个大的社区有更大的应用程序的全栈框架来帮助你。

I think it should be fairly accepted fact that Silex is not suitable for anything big. Silex will not perform badly if your project works, but it will not be the nicest to work with once you start growing, as it will not help you too much. Symfony uses concepts you'll see in Silex and is a full stack framework you can use for bigger applications with lots of bundles, plugins and a big community there to help you.

编辑:

请注意我无法删除的答案,因为它已被接受。我已经很多年没有使用PHP现在,从那时起,Silex的改变从microframework他们的做法,以作为刚刚好像库。无论是哪种情况,下投票,我相信一定是来自参与项目的人,大概有心烦的东西产生,因为他们可能希望它没有起飞。

Note I cannot delete the answer as it has been accepted. I haven't used PHP in years now, since then, Silex has changed their approach from "microframework" to being just a library it seems. Whatever the case, the down-voting I believe must come from people involved with the project, probably upset of having created something which didn't take off as they may have hoped.

只是阅读产品文档,这是它被赋予并接受意见的请求。我不认为这个问题是属于无论如何计算器。

Just read the product docs, this was a request for an opinion which was given and accepted. I don't think this question belongs to stackoverflow anyway.

这篇关于RESTful Web服务与PHP的Silex:好的选择吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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