¿Qué se necesita para implementar REST con PHP?..

1,049 views
Skip to first unread message

Analyzer

unread,
Sep 5, 2013, 11:52:22 AM9/5/13
to PHP Latinoamérica
Leo que se mencionan muchas cosas para poder implementar lo de los servicios tipo REST con PHP.

1.podemos utilizar Tonic en conjunto con PDO, Smarty, JSON, etc. 

2. Servidor Rest

3. Etc. Etc.


http://www.imaginanet.com/blog/servidor-rest-con-php-y-peticiones-mediante-jquery-y-ajax.html

¿Cuál sería la configuración que habría que implementar para lograr correr lo de los servicios REST con PHP?..

Saludos!

Analyzer

unread,
Sep 5, 2013, 11:57:37 AM9/5/13
to PHP Latinoamérica
Aquí menciona algo sobre "Crear una API RESTful


Veo que es como clases.. 

Qué mas haría falta?..


Saludos!

Analyzer

unread,
Sep 5, 2013, 12:09:55 PM9/5/13
to PHP Latinoamérica
El enlace menciona varias cosas para eso de la API REST:


1. Database
Sample database users table columns user_id, user_fullname, user_email, user_password and user_status.

2. Rest API Class: api.php
Contains simple PHP code, here you have to modify database configuration details like database name, username and password.

3. Login POST
Displaying users records from the users table Rest API URL http://localhost/rest/login/. This Restful API login status works with status codes if status code 200 login success else status code 204 shows fail message. For more status code information check Rest.inc.php in download script.

4. Users GET
Displaying users records from the users table Rest API URLhttp://localhost/rest/users/

5. DeleteUser
Delete user function based on the user_id value deleting the particular record from the users table Rest API URL http://localhost/rest/deleteUser/

6. Chrome Extention
A Extention for testing PHP restful API response download here Advanced REST client Application

7. .htaccess code
Rewriting code for friendly URLs. In the download code you just modifyhtaccess.txt to .htaccess


¿Alguna idea de todos estos puntos?..

Me pierdo en comprender los puntos 3, 4 y 7.

Saludos!

Alvaro Lizama

unread,
Sep 5, 2013, 12:27:01 PM9/5/13
to phplatin...@googlegroups.com
Primero entiende que es REST y como trabaja sin tener en cuenta PHP y la lógica de la app.

http://restcookbook.com/

--
Alvaro Lizama
http://alvarolizama.net


El jueves, 5 de septiembre de 2013 a las 11:09, Analyzer escribió:

> El enlace menciona varias cosas para eso de la API REST:
>
> http://www.9lessons.info/2012/05/create-restful-services-api-in-php.html
>
> 1. Database
> Sample database users table columns user_id, user_fullname, user_email, user_password and user_status.
>
> 2. Rest API Class: api.php
> Contains simple PHP code, here you have to modify database configuration details like database name, username and password.
>
> 3. Login POST
> Displaying users records from the users table Rest API URL http://localhost/rest/login/. This Restful API login status works with status codes if status code 200 login success else status code 204 shows fail message. For more status code information check Rest.inc.php in download script.
>
> 4. Users GET
> Displaying users records from the users table Rest API URLhttp://localhost/rest/users/
>
> 5. DeleteUser
> Delete user function based on the user_id value deleting the particular record from the users table Rest API URL http://localhost/rest/deleteUser/
>
> 6. Chrome Extention
> A Extention for testing PHP restful API response download here Advanced REST client Application (https://chrome.google.com/webstore/detail/hgmloofddffdnphfgcellkdfbfbjeloo)
>
> 7. .htaccess code
> Rewriting code for friendly URLs. In the download code you just modifyhtaccess.txt to .htaccess
>
>
> ¿Alguna idea de todos estos puntos?..
>
> Me pierdo en comprender los puntos 3, 4 y 7.
>
> Saludos!
>
> El 5 de septiembre de 2013 10:57, Analyzer <thenewin...@gmail.com (mailto:thenewin...@gmail.com)> escribió:
> > Aquí menciona algo sobre "Crear una API RESTful
> >
> > http://www.9lessons.info/2012/05/create-restful-services-api-in-php.html
> >
> > Veo que es como clases..
> >
> > Qué mas haría falta?..
> >
> >
> > Saludos!
> >
> > El 5 de septiembre de 2013 10:52, Analyzer <thenewin...@gmail.com (mailto:thenewin...@gmail.com)> escribió:
> >
> > > Leo que se mencionan muchas cosas para poder implementar lo de los servicios tipo REST con PHP.
> > >
> > > 1.podemos utilizar Tonic en conjunto con PDO, Smarty, JSON, etc.
> > >
> > > 2. Servidor Rest
> > >
> > > 3. Etc. Etc.
> > >
> > > http://pensandoencodigo.blogspot.mx/2012/01/un-framework-rest-elegante-y-liviano.html
> > >
> > > http://www.imaginanet.com/blog/servidor-rest-con-php-y-peticiones-mediante-jquery-y-ajax.html
> > >
> > > ¿Cuál sería la configuración que habría que implementar para lograr correr lo de los servicios REST con PHP?..
> > >
> > > Saludos!
>
> --
> Has recibido este mensaje porque estás suscrito al grupo "PHP Latinoamérica" de Grupos de Google.
> Visita este grupo en http://groups.google.com/group/phplatinoamerica.



Analyzer

unread,
Sep 5, 2013, 1:18:59 PM9/5/13
to PHP Latinoamérica
Pues está muy bien el enlace..

A veces pienso que debí empezar por acá.. :)



Saludos!


2013/9/5 Alvaro Lizama <nek...@gmail.com>

Analyzer

unread,
Sep 5, 2013, 4:07:56 PM9/5/13
to PHP Latinoamérica
Muy bien.. Pero y si no quiero usar Laravel para hacer un servicio REST?..


Ese tutorial está muy bueno, pero para los que usen Laravel..

Saludos!


2013/9/5 Alvaro Lizama <nek...@gmail.com>
Primero entiende que es REST y como trabaja sin tener en cuenta PHP y la lógica de la app.

Paulo Antonio McNally Zambrana

unread,
Sep 5, 2013, 5:15:01 PM9/5/13
to phplatin...@googlegroups.com
Con Slim es muy fácil.http://www.slimframework.com eso si. Requiere PHP 5.3 >

Analyzer

unread,
Sep 6, 2013, 9:39:23 AM9/6/13
to PHP Latinoamérica
Gracias Paulo Antonio,

Bienvenido. Gracias por aceptar la invitación al grupo..

Sobre lo que comentas de Slim, ya empecé a conseguir pistas..



Saludos!


El 5 de septiembre de 2013 16:15, Paulo Antonio McNally Zambrana <paulom...@gmail.com> escribió:
Con Slim es muy fácil.http://www.slimframework.com eso si. Requiere PHP 5.3 >

Analyzer

unread,
Sep 6, 2013, 9:43:50 AM9/6/13
to PHP Latinoamérica

Analyzer

unread,
Sep 6, 2013, 9:49:16 AM9/6/13
to PHP Latinoamérica

Analyzer

unread,
Sep 6, 2013, 10:00:43 AM9/6/13
to PHP Latinoamérica
Una más con JSON, Slim, PDO y NotORM.


¿Qué es NotORM?.. No sé.. Pero que quede aquí "para la historia"..jeje

Saludos!
Reply all
Reply to author
Forward
0 new messages