Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would suggest making your testing deployment strategy a production-ready install-script -- since you're going to need one of those anyway eventually.</p> <p>A few tips that may seem obvious to some, but are worth pointing out:</p> <ul> <li>Your config file saved in your VCS should be a template, and should be named differently from the file that will eventually contain the actual settings. E.g. <code>config-dist.php</code> or <code>config-sample.conf</code> or <code>sample/config-mysql.php</code> or something along those lines. Otherwise you will end up accidentally checking in a server-specific configuration file over your template.</li> <li>For PHP deployment, anticipate that some users will not be able to run server-side scripts through any mechanism other than the web server itself. A PHP-based installer is almost non-negotiable.</li> <li>You should include a consumer-friendly update mechanism, and for that, wordpress is a great example of a project to emulate. A PHP script can (a) download the latest build, (b) use the <a href="http://php.net/manual/en/book.ftp.php" rel="nofollow noreferrer">ftp</a> functions to update your application's files, and (c) execute an update script which makes the appropriate changes to the database, etc.</li> <li>For heaven's sake don't do like [<em>redacted</em>] and make your users download and install separate patches for each point release. Have them download the latest (final) release which contains all the updates to date, and applies the correct <code>ALTER TABLE</code> functions in sequence.</li> </ul> <p>Whether the files are deployed via SVN or through FTP, the install/update mechanism should be the same: get the latest files, run the update script. The updater uses the version listed in the PHP script and the version listed in the DB, and uses that knowledge to apply the appropriate DB patches in order. As for how to generate those patches, there are <a href="https://stackoverflow.com/questions/218499/mysql-diff-tool">other questions</a> here that you can refer to for more info.</p> <p>As for the "Maintenance" page, just use the version trick mentioned above to trigger it (compare the version in the DB against the version in the PHP code). It's also useful to be able to mark a site as "down" to the public but make it visible to admins (like Joomla does), which you can trigger through database or filesystem flags. </p> <p>As for automatically pulling code from SVN, I'd say you're better off with either a cron script or with commit triggers than working that into your application, since it wouldn't be relevant to end users.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload