Feeds

Get your PHP on the right Trax

Framework flattery

Providing a secure and efficient Helpdesk

A database.ini database configuration file gets created in the config directory. Modify the database.ini file for the MySQL database. We shall be using the development mode as follows:

[development]
    phptype = mysql
    database = test
    hostspec = localhost
    username = root
    password = 
  persistent = true

Modify the config/environment.php directory to set the PHP directory, the trax root directory, and the trax environment mode. Define variables PHP_LIB_ROOT, TRAX_ROOT, and TRAX_ENV.

define("PHP_LIB_ROOT",    "C:/PHP/PEAR");
define("TRAX_ROOT",       "C:/Apache/htdocs/catalog");
define("TRAX_ENV",    "development");

The public/.htaccess file specifies configuration directives for the Apache HTTP server. The configuration directives in the .htaccess file apply to the directory in which the .htaccess file is placed and the sub-directories of the directory. Modify the public/.htaccess file. Replace the following line with the subsequent line:

php_value include_path .:C:\Apache\htdocs\catalog/config
php_value include_path .;C:\Apache\htdocs\catalog/config

The include_path directive specifies a list of directories and is used to locate files. Access the Trax application console with the URL http://localhost/catalog/public.

Modify the C:\Apache\conf\httpd.conf file so the directives in the .htaccess file may override earlier access information. Activate the mod_rewrite module by removing the '#' before the following line:

LoadModule rewrite_module modules/mod_rewrite.so

The mod_rewrite module provides a rules-based rewriting engine to rewrite requested URLs. Also set all the AllowOverride directives to All.

AllowOverride All

The AllowOverride directive specifies which directives in the .htaccess may override earlier access information. Modify the DocumentRoot directive and <Directory> setting in httpd.conf to the following:

DocumentRoot "C:/Apache/htdocs/catalog/public"
<Directory "C:/Apache/htdocs/catalog/public">

Reboot time

Restart the Apache server. We shall generate a model class and the scaffolding for the model class, which models a database table, with the scaffold generator. Create a scaffold.bat file in the C:\Apache\htdocs\catalog directory. Copy the following code to the scaffold.bat file:

php ./script/generate.php scaffold  %1 %2

Before creating the scaffolding, build a database table catalogs in the MySQL database with the SQL script catalog.sql. The primary key field should be "id" and of type INT. Create a scaffolding for the "catalogs" table with the following command:

C:\Apache\htdocs\catalog>scaffold catalog catalog

A model class catalog.php gets generated in the models directory.

<?php
class Catalog extends ActiveRecord {      
}
?>

Choosing a cloud hosting partner with confidence

More from The Register

next story
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
SMASH the Bash bug! Apple and Red Hat scramble for patch batches
'Applying multiple security updates is extremely difficult'
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
'Google is NOT the gatekeeper to the web, as some claim'
Plus: 'Pretty sure iOS 8.0.2 will just turn the iPhone into a fax machine'
prev story

Whitepapers

A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.