Luracast Restler in CodeIgniter - php

I am trying to put in Restler as part of my CI Library. I wonder if this is possible with Restler because I'm getting Server Error. Should I just separate Restler folder to my CI folder (which works right now)?
I want to integrate it to my CI so I can access the models e.g for authentication, getting user data...etc. instead of creating another config file and model classes.
I have invested a lot of time trying to find some workaround to make Restler work with CI but no luck.
Thanks!

I don't think there's an easy way to integrate Restler into CI, you would have to totally rework the CI routing class.
I would recommend that you instead go with Phil Sturgeon's excellent REST server for CI, which is a pretty simple to put into your existing CI application.

Related

Using Codeigniter in Zf2

I have an project that is used by many users and it's written in Codeigniter. I'm very happy with my application but I'm getting lost with Codeigniter because of the functionality of the framework and my application is getting too big for Codeigniter (that is what I think).
I want to go from Codeigniter to Zend, but the application is too big to begin all over again because there is still more functionality to come.
I don't know if someone has experienced or tried it, but does anybody know if it is possible to integrate Codeigniter into Zend as an module and migrate in steps to the Zend Framework 2?
Sorry for my bad english by the way :-)
Having experience with small and medium-scale projects with both CodeIgniter (CI) and Zend Framework (ZF), I can tell you that using one framework over the other will not solve any problem you might be having.
If you are looking for the added functionality provided by the ZF components, such as a ready-made class for Date or the Form verification class, know that you can use ZF components in Code Igniter. You will need to create a special class in CI that will jumpstart the ZF class autoloader. From there you can simply include ZF classes and use them as if you were inside a ZF application.
See http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/ and http://fr.slideshare.net/samsonasik/codeigniter-using-third-party-components-zend-framework-components for more details.
"Integrate" means you want to put your app running on CodeIgniter withing ZendFramework. So basically you changed nothing and there's no much sense of doing so.
You perhaps could consider porting your app from CI to ZF, but that will require rewriting of your code. But I'd first try to find out what the bottleneck in your app really is and ensure that you will benefit from the switch

RESTful API and versioning in Zend Framework 2

I created a RESTful API in Zend Framework 2.1 but I still don't know what is the best approach to make versioning for this API. I also use the doctrine as a model part of my app. I'd like to have links like that:
api.name-of-my-project.com/v1/products
api.name-of-my-project.com/v1/products/123
where v1 describes the version of API.
So far I already created API without versioning and I also have some ideas about how to create versioning but first I'd like to know your opinions about this problem. What should I do to separate controllers and maybe other classes from different versions and how to manage the routing? By the way I think that I am not really interested about creating another module because I already have module like API.
The final app should be able to work with "many" versions of API. I'd like to also inherit some functionality from older version of API in my new one.
You can do this with zf2 routing array in your module config
Map routes with v1 to versiononecontroller and v2 to versiontwocontroller

Getting a list of REST resources from Slim

I'm using the PHP Slim Framework for my RESTful project.
I was wondering if its possible to get a list of all the callback registered with Slim somehow so as to have a list of all the REST resources that are available for the app?
I assume this will involve some sort of pre-compile but I'm not sure how to do it.
I haven't used the Slim Framework yet (looks quite exciting, thanks for the pointer), but my best guess would be using PHPDocumentor to generate documentation about your rest endpoints.
You can find it at the phpdocumentor website

Symfony project using CURL - building project with API

I have never used a PHP framework before and am considering using Symfony for my next one. However, I have already built an API which has all my main classes. I will therefore connect to this API using CURL. Can anyone advise on where to start with such a project. I am working through a Symfony tutorial but none of it seems to apply to what I need to do as I do not need to create database connections or classes as I will be building this project on my existing API.
If you don't need a lot of what you see in the Symfony tutorials you might be able to get away with Silex. Silex is a mini-framework with alot of the core aspects of Symfony, but without the extra stuff.
http://silex.sensiolabs.org/

Codeigniter use Codeigniter models from outside script

There was a great post that applied to CI 1.7.2 about using CI models outside CI. It worked like a charm.
http://codeigniter.com/wiki/Calling_CI_models_from_outside_script/
Then I upgraded to 2.0 and the code written in the above post was no longer applicable. I am having a hard time trying to get this to work in 2.0. The Config.php file is no longer in the libraries folder in addition to the Language.php and Model.php files.
Does anyone have an idea of how to port this to 2.0 ?
I only need the models. I was using them in an incoming email extension to our application and using the CI models that we had written saved a lot of time. Any help would be greatly appreciated. . .
I have no idea what this package does, or what issues you're having (forgot to say?), but in 2.0 you need to be looking in the "core" directory rather than the "codeigniter" directory.

Categories