Clickframes-PHP is most powerful when you integrate your local development webserver directly with your Clickframes project files. I’ve tried to be thorough for first-time users, but after you’ve done this once, it only takes a few minutes to setup each subsequent project.
See Starting a new Clickframes-PHP project for how to create a basic Clickframes-PHP project, then continue below.
If you’re here, you probably know how to do this already. For ease, I like to use Wampserver on Windows. If you’re going to use an SQLite database, no installation is necessary.
To use SQLite 3 with your Clickframes-PHP project, make sure the required extensions for PDO and SQLite are installed and enabled in php.ini
There are a few approaches to this, but here’s the quick and dirty way to get Apache to serve files directly from your development directory.
Open up Apache’s httpd.conf and set your document root to the src\main\php\webapp directory of your project.
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "d:/workspace/php-quickstart/src/main/php/webapp"
Further along in httpd.conf, configure the
<Directory "d:/workspace/php-quickstart/src/main/php/webapp">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
After you’ve run mvn clickframes:gen, the entities in your appspec will be translated into database schemas. Look in \src\main\sql for the SQL scripts that match your database (MySQL or SQLite 3).
If you’re using SQLite, it helps to have a graphical management tool; I’ve been using the free, open-source Sqliteman.
Download CodeIgniter 1.7.2 and copy the system directory somewhere convenient. I keep mine in d:\CodeIgniter_1.7.2\system.
To use SQLite 3, you must install a newer database driver. Download codeigniter_pdo_sqlite.zip and unzip into the system/database/drivers directory.
CodeIgniter’s main index.php file lives in your project at src/main/php/webapp/. Change the $system_folder variable to point to the location of your system folder as copied above.
Your application’s configuration files are found in src/main/php/webapp/application/config. To get started, you only need to change these:
config.php$config['base_url']
database.phpemail.php$config['smtp_host'] to use an SMTP server somewhere other than localhost.
Open a browser and visit http://localhost/. If all went well, you’ll be looking at the default page you defined in your appspec.
Try customizing your appspec and regenerating with mvn clickframes:gen — your changes will be immediately visible in your browser.
No comments yet.