- PHP 的file() 或file_get_contents()方式
Part 1 – Creating a RESTful API
Step 1: Setting up the Demo
Firstly you need to download the codeigniter-restserver code from GitHub and extract it and move the code to your server.
When you open the folder, you will see an entire CodeIgniter install, which is there to power the demo. This allows people to have a play with the REST demo before integrating with your existing application.
Open up “application/config/config.php” and set the base_url to get links working. This base_url will be different for everyone and depends entirely on where you uploaded your files.
Step 2: The URLs
With the files extracted and the base_url set, we are ready to load up our RESTful CodeIgniter installation, and have a look at the demo supplied with it. Browse the base URL, which by default is: 继续阅读“Working with RESTful Services in CodeIgniter”
Native Session makes good use of PHP’s native session handling abilities, but it does not allow the use of a database for session storage. KNDB Session (which stands for Kirilisa’s Native Database session) is a hybrid which is based upon Native Session (with some notable changes) but allows use of databases via PHP’s ability to store sessions in a DB. 继续阅读“KNDB Session For CodeIgniter”
For last 8 months, I have been working on a web application. We are developing the application based onCodeIgniter framework. In our project there are normal web version and mobile view version. Some days ago we noticed that, some people can’t login their account via mobile version though there username & password are correct. After debugging and digging the problem we found that in iPod Touch 2G/3GS Safari browser, this problem is happening.
We are using CodeIgniter’s built in session library and that is different than normal PHP’s session. We found that for each visit of the user, the server can’t track the session and regenerating new session id each time. Very weird situation for us. As we coded all over based on CodeIginter’s session library’s function so its not optimal solution for us to remove the codes and use PHP’s native session. Because in that case there is high possibility to generate new bugs. After lots of searching in the net at last we found a wrapper class for CodeIgniter. 继续阅读“Replacing CodeIgniter’s session by PHP’s Native Session”