Skip to content
rmasters edited this page Sep 13, 2010 · 1 revision

Usage requirements

This page outlines the minimum system requirements

PHP

php-mvc relies strongly on PHP 5.3’s newly introduced language features. These include namespaces and closures amongst other patches. For this reason you need at least PHP 5.3.0 (downloads, Windows downloads). php-mvc hasn’t been tested yet on the suhosin security patch for PHP.

Configuration

For ease of use when writing view scripts you are recommended to enable short_open_tags in your php.ini. If you’re developing an app that aims to be distributed to platforms that may not have access to this setting you may wish to use the longer <?php syntax in your view scripts. It may help you to know of the alternative syntax for PHP control statements when writing view scripts.

Databases

Database support is limited to MySQL at the moment (using the mysqli interface). If you want to use php-mvc with a database (which is optional) you can use the Mysql database adapter like so:

$config = array(
    'host' => 'localhost',
    'user' => 'username',
    'password' => 'password',
    'name' => 'database'
);
$db = \MVC\Db::create('MySQLi', $config);

This will automatically set this database connection as the default adapter – which means it will be automatically available to models and other Db-related classes. In DbTable models (see Models) this can be accessed by the protected property $this->adapter. Furthermore MySQL database support is limited to initialising a prepared statement and accessing the last error message and code.

Clone this wiki locally