Filed under: notes/Programming
PHP is preinstalled on MacOS X Leopard, so just go to system configuration, go sharing panel and activate web sharing. PHP is not initially enabled, so edit /private/etc/apache2/httpd.conf and uncomment this line:
LoadModule php5_module
MySQL is not preinstalled, so go to MySQL.org, download and install MySQL for Mac OS X. Start it, and then do the following:
/usr/local/mysql/bin/mysqladmin -u root password ’passwordhere’
Then edit /private/etc/php.ini (if there is no php.ini, then copy php.ini.default to php.ini) by adding the sockets for MySQL as follows:
mysql.default_socket = /private/tmp/mysql.sock
mysqli.default_socket = /private/tmp/mysql.sock
Now you are ready to access MySQL via PHP, using localhost as hostname and the password you set above as password.
Then download Facebook libraries for PHP, and try the Footprints application as explained in the doc. You’ll have a jsonwrapper related error. Leopard comes standard with PHP 5.2, and jsonwrapper does not need to be included, so just comment out the following line in Facebook library:
include_once ‘jsonwrapper/jsonwrapper.php’;
That’s it, have fun.
Filed under: notes/Programming
In Symbian, to port console app to UIQ here are some of the things to know:
1. The scheduler (CActiveScheduler) is already built-in in UIQ, so app can just use it without creating its instance. In console app, it must first create an instance of it before using it.
2. RTest, which besides testing also provides the console, is only for console app, it cannot be used on UIQ.
Filed under: notes/Programming
The following illustrates application classes based on the UIQ framework:
Filed under: notes/Programming
Create a download handler:
/files/download.php
This file streams a document given certain parameters.
/files/download.php?id=e45fg6f7a7c7b776d4cc4e56&fileid=4001
The id could be an MD5 of the SessionID for that user
and the download handler just checks the session ID with the one passed in
The 4001 could be a db lookup giving information about the file.
(path to file, MIME type, etc)
Then, just stream the file back to the user with the appropriate Headers
Content-type: application/zip
Content-disposition: attachment; filename=file4001.zip



