Back to the main site

Automatic installation API

The automatic installation possibility is for advanced users - primarily for those who want to integrate the program into their installer or hosting package. Noah's Classifieds contains two files that one can use to install the program automatically - without the usual web wizard:

  • autoinstall.php: the install script itself,
  • noah.ini.php: an ini file the install script can use to read data from

Usage instructions:

The autoinstall.php script attempts to perform an automatic Noah's Classifieds installation. The administrator account of the installation will be:

user: 'admin', password: 'admin'

There will also be a test user created:

user: 'john', password: 'a'
  • It can be called either from command line or from the browser.
  • In the former case, it can take parameters either from an ini file, or from the command line, or from both.
  • In the latter case, it can take parameters either from an ini file, or from the query string, or from both.
  • The parameters in the command line/query string always override those read from the ini file.
  • The default ini file is called noah.ini.php.
  • Per default, Noah's will be installed in the same directory where this script resides. This can be overridden by the noahDir parameter.

Examples of calling the script from the command line:

This installs with parameters taken solely from noah.ini.php:

php autoinstall.php

This installs with parameters taken solely from an other ini file:

php autoinstall.php --iniFile=/some/path/other.ini.php

This installs with parameters mostly read from noah.ini.php and some of them are overridden by the command line:

php autoinstall.php --dbName=noah --dbUser=noahuser --dbUserPw=noahpass

Examples of calling the script from the browser:

This installs with parameters taken solely from noah.ini.php:

http://path/to/noahs/installation/autoinstall.php

This installs with parameters taken solely from an other ini file:

http://path/to/noahs/installation/autoinstall.php?iniFile=/some/path/other.ini.php

This installs with parameters mostly read from noah.ini.php and some of them are overridden by the command line:

http://path/to/noahs/installation/autoinstall.php?dbName=noah&dbUser=noahuser&dbUserPw=noahpass

This installs the program somewhere else:

http://some/path/autoinstall.php?noahDir=/path/to/noahs/installation/

You can suppress any output messages but the fatal errors with specifying the silent parameter either in the command line, or in the query string. E.g.:

http://path/to/noahs/installation/autoinstall.php?silent=1
php autoinstall.php -silent

Parameters and their default values:

This is practically the content of the noah.ini.php file:

// Database host name:
"hostName"=>"localhost",
 
// Database user name:
"dbUser"=>"root",
 
// Database password:
"dbUserPw"=>"",
 
// Classifieds database name:
"dbName"=>"classifieds_test1",
 
// Table prefix. If the classifieds database is happened to be shared with other programs,
// this can be handy to avoid name collisions between table names. If the database is used by Noah's only, however,
// simply leave this blank.
"dbPrefix"=>"",
 
// Database port: if you leave this blank, the default will be used:
"dbPort"=>"",
 
// Database socket: if you leave this blank, the default will be used:
"dbSocket"=>"",
 
// Noah's install directory. By default, it will be installed in the same directory where the autoinstall.php script is called from.
// A caution for those who call autoinstall.php from the command line: the directory where the script is called from is
// not necessarily the same as it resides in!
"noahDir"=>".",
 
// The following parameters can be also set later through the admin interface of the program:
 
// This will appear as the address in the 'From:' field of emails the program sends.
// If you leave this blank, the program may not be able send out email notifications!
"adminEmail"=>"",
 
// This will appear as the name in the 'From:' field of email notifications the program sends out:
"adminFromName"=>"",
 
// Use the following parameters if you want that the program sends out the notification emails through an SMTP server.
// Otherwise, the native Php mail function will be used.
 
// SMTP server name:
"smtpServer"=>"",
 
// SMTP user name:
"smtpUser"=>"",
 
// SMTP password
"smtpPass"=>"",
 
// Fall back on native mail if SMTP fails
"fallBackNative"=>FALSE,
 
autoinstall.txt · Last modified: 2008/07/24 03:54 by admin
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki