Restler API framework installation - php

I want to start using Restler to develop a Rest api but, I couldn't find any detail information on how to install it, besides, it seems to run on a nginx server.
Is there a way to run this framework on apache? Are there other alternatives for building high quality APIS? Is there a detail documentation about installing this framework?
I must be able to run this framework on apache and using php5.3
Thanks

you have to enable apache mod_rewrite

I'm running restler (somewhat modified) for an API (api.hostingxs.nl). It works fine on apache with PHP 5.3. Just clone the repository from github (git clone https://github.com/Luracast/Restler.git <yourdirectory>) and start including classes that use it (read the manual).
If you need more directions I can post some sample code, but the basic functionality is really easy if you understand Object Oriented PHP.
First off, redirect all requests to your restler domain, folder to the index.php and create that file with something like this:
require_once( "restler.php" ); # or whatever you need to link to
$r = new Restler;
$r -> handle();
# above is the basic functionality without any of your own things
Click on the classes in the following link to read more about setting up your own classes; help.luracast.com/restler/examples/_002_minimal/readme.html

If you're wanting to create a RESTful API, then I created a lightweight framework for exactly that: https://github.com/martinbean/api-framework

Related

Add Behat\Symfony2Extension support to my behat suite

I have a central Behat test suite codebase I use all throughout my companies projects. There is a ApiContext available which does curl calls using the curl lib from PHP itself but I really want to start supporting the Behat\Symfony2Extension in our Symfony projects as well so I don't have to setup nginx to listen to create a vhost to call those curl calls to.
I am a Symfony n00b and I'm not sure how to do this. I've setup the extension but the problem here (I think) is the use of curl in this case.
Maybe someone of you could help me get an idea of what I can do to fix this. I still want to support this lib with external calls as it is used in other projects too.

How to check Zend_Http_Client is available on server

Sorry I'm not familiar with php and I have to send something via Zend_Http_Client. How I can check that feature is available on server, because at the moment I've only got error 500.
You need to check if ZF is available in your project libraries.
For Ubuntu, ZF should be in one of those:
/usr/share/zend/
/usr/share/php/
/usr/local/zend/
or in your project directory.
In ZF "Zend_Http_Client", means that in your library directory you should have this folder structure: (...)/Zend/Http/Client/
Zend_Http_Client is not a "feature", but a class from the Zend Framework library. In short is a set of classes that you can use as a whole or in parts to help you speed the development of your project. It offers solutions in a lot of common scenarios, and Zend_Http_Client is actually part of an interface that will help you work with HTTP requests.
Check the requirements for it here and how to install it here. The most common way is to add the library to the PHP include_path or to add it via composer to your project.

Is it possible to use Zend Framework on a platform other than ZendServer/Cloud

Title says it all really. The only thing I'd like to add is to say that after initial look at the paid versions of Zend Server, it looks like in terms of cost, I would be losing the advantages of not developing a web/cloud application on Microsoft's expensive Azure platform if I did choose to go with Zend. I like the look of the Zend Framework though and am considering using it on an open source LAMP stack. Or should I go with Symfony / CakePHP on LAMP to keep costs down?
The answer to your (actual, answerable) question is: Yes.
The framework is just a bunch of libraries (just like all frameworks); and you do the following:
Go to the download page.
Register (its free), and then download "Zend Framework Full Package".
Make sure the files are available to your application, by placing them in a directory to which the user that will execute your scripts (it is normally the same user that run the webserver, for example www-data).
Follow the get starting guide.
If you like build tools, you can also use composer to automatically download ZF2 for you, by following the instructions on this page.

Creating a Yii application setup / installation page

I am creating an application and will be deployed to production soon.
For the ease of convenience, I would like to create a custom setup and installation page which will allow users to input variable values to be used in config/main.php as well as to execute the RBAC setup and create necessary tables.
For most web application, there is an 'install' folder which users point their browsers to and begin the app installation. How do I implement something similar in Yii?
I think a great start were the app manager extension which provides much of what you need. It doesn't do anything with the RBAC setup, though. Perhaps you want the auth extension as well?
Yii does not have an installation folder, you just download and extract it and put in your server like Wamp/Xampp or etc. and then you can install a new Yii application through command prompt.
C:\wamp\bin\php\php5.4.16> "c:\wamp\www\yii\framework\yiic.bat" webapp "c:\wamp\
www\newyii"
When you run above command, then you will see the following command.
Create a web application under 'c:\wamp\www\newyii'? [no]:
You write Y. and then create your new application.
For more understanding. you should follow the below link.
http://www.yiiframework.com/doc/guide/1.1/en/quickstart.installation
Thanks.

Install lithium php framework

I'm a long time codeigniter framework user, and I love how you can just download it, extract and upload to your server via ftp and that's it, ready to go.
Now, I'm curious to try lithium framework, but oh my, command prompts, shell access, github...
That's out of my scope, plus I dont have shell access to my host.
Do I really need all that? Can I not just download it, extract and upload via ftp?
Thanks in advance!
Not sure what you mean, the lithium framework has a direct link to their download: http://sourceforge.net/projects/li3/files/
Or you can go to github and click on ZIP : https://github.com/UnionOfRAD/lithium
#Wyck and #Tomen have it right, shell access helps as does git(hub)...but it's optional.
Here's a quick tutorial to get lithium up and running without shell access or command prompts:
Read the docs! Seriously, just browse the quickstart to get a feel for lithium
Create a directory in your web root (/var/www/newsite, c:\inetpub\wwwroot\newsite, whatever applies to your situation)
Download the sample lithium app. This is really just an empty boilerplate app
Extract the sample lithium app into your new website root. Your website root should look like this:
Download the lithium framework and extract it into /libraries/lithium/. Example:
The rest is up to you. You'll have to configure your database connections, bootstrap, etc.. on your own.
There is no official comment on this. Usually it is expected that you have shell access. But from a short look on my docs i can say the following:
You will not need shell access if:
You have FTP access
The basic setup of your web server corresponds to that expected by lithium. For example: Apache 2 + mod_rewrite enabled + PHP 5.3
This should give you the basic functionality of Lithium. If you want to use data sources like MongoDB or CouchDB, thats a different story and you would have to check if your server already supports these. If not, you would need shell access to install and configure them appropriately.

Categories