Cheetah
Functions | Variables
index.php File Reference

Go to the source code of this file.

Functions

if($sInstallPageContent) isSecure ()
 
 InstallPageContent (&$sError)
 
 performInstallLanguages ()
 
 walkThroughLanguage ($aLanguage, $aLangInfo)
 
 genInstallationProcessPage ($sErrorMessage='')
 
 isAdmin ()
 
 checkPostInstallPermissions (&$sError)
 
 genPostInstallPermissionTable ($sErrorMessage='')
 
 genSiteGeneralConfig ($sErrorMessage='')
 
 checkConfigArray ($aCheckedArray, &$sError)
 
 genDatabaseConfig ($sErrorMessage='')
 
 genPathCheckingConfig ($sErrorMessage='')
 
 checkPreInstallPermission (&$sError)
 
 genPreInstallPermissionTable ($sErrorMessage='')
 
 StartInstall ()
 
 genMainCheetahPage ()
 
 PageHeader ($sAction='', $sError='')
 
 PageFooter ($sAction)
 
 printInstallError ($sText)
 
 createTable ($arr)
 
 rewriteFile ($sCode, $sReplace, $sFile)
 
 RunSQL ($sAdminName, $sAdminPassword)
 
 CheckSQLParams ()
 

Variables

 $aPhpExtensions
 
 $iMemoryLimitBytes = ini_get('memory_limit')
 
 $last = strtolower($iMemoryLimitBytes{strlen($iMemoryLimitBytes) - 1})
 
switch($last) $aErrors = array()
 
 $aErrors [] = (ini_get('register_globals') == 0) ? '' : '<font color="red">register_globals is On (warning, you should have this param in the Off state, or your site will be unsafe)</font>'
 
 $aConf = array()
 
 $aConf ['iVersion'] = $site['ver']
 
 $aConf ['iPatch'] = $site['build']
 
 $aConf ['dolFile'] = '../inc/header.inc.php'
 
 $aConf ['confDir'] = '../inc/'
 
 $aConf ['headerTempl'] =
 
 $aConf ['periodicTempl'] =
 
 $confFirst = array()
 
 $confFirst ['site_url']
 
 $confFirst ['dir_root']
 
 $sPleskPath = '/opt/plesk/php/' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '/bin/php'
 
 $confFirst ['dir_php']
 
 $aDbConf = array()
 
 $aDbConf ['sql_file']
 
 $aDbConf ['db_host']
 
 $aDbConf ['db_port']
 
 $aDbConf ['db_sock']
 
 $aDbConf ['db_name']
 
 $aDbConf ['db_user']
 
 $aDbConf ['db_password']
 
 $aGeneral = array()
 
 $aGeneral ['site_title']
 
 $aGeneral ['site_desc']
 
 $aGeneral ['site_email']
 
 $aGeneral ['notify_email']
 
 $aGeneral ['bug_report_email']
 
 $aGeneral ['admin_username']
 
 $aGeneral ['admin_password']
 
 $aNonDeletableModules
 
 $aTemporalityWritableFolders
 
 $sAction = $_REQUEST['action']
 
 $sError = ''
 
const CH_SKIP_INSTALL_CHECK true
 
 if ( $sAction=='step6'||$sAction=='step7'||$sAction=='compile_languages')
 
 $sInstallPageContent = InstallPageContent($sError)
 

Function Documentation

◆ checkConfigArray()

checkConfigArray (   $aCheckedArray,
$sError 
)

Definition at line 847 of file index.php.

◆ checkPostInstallPermissions()

checkPostInstallPermissions ( $sError)

Definition at line 655 of file index.php.

◆ checkPreInstallPermission()

checkPreInstallPermission ( $sError)

Definition at line 971 of file index.php.

◆ CheckSQLParams()

CheckSQLParams ( )

Definition at line 1439 of file index.php.

◆ createTable()

createTable (   $arr)

Definition at line 1227 of file index.php.

◆ genDatabaseConfig()

genDatabaseConfig (   $sErrorMessage = '')

Definition at line 875 of file index.php.

◆ genInstallationProcessPage()

genInstallationProcessPage (   $sErrorMessage = '')

Definition at line 566 of file index.php.

◆ genMainCheetahPage()

genMainCheetahPage ( )

Definition at line 1105 of file index.php.

◆ genPathCheckingConfig()

genPathCheckingConfig (   $sErrorMessage = '')

Definition at line 924 of file index.php.

◆ genPostInstallPermissionTable()

genPostInstallPermissionTable (   $sErrorMessage = '')

Definition at line 690 of file index.php.

◆ genPreInstallPermissionTable()

genPreInstallPermissionTable (   $sErrorMessage = '')

Definition at line 1038 of file index.php.

◆ genSiteGeneralConfig()

genSiteGeneralConfig (   $sErrorMessage = '')

Definition at line 801 of file index.php.

◆ InstallPageContent()

InstallPageContent ( $sError)

Definition at line 454 of file index.php.

◆ isAdmin()

isAdmin ( )

Definition at line 649 of file index.php.

◆ isSecure()

if ( $sInstallPageContent) isSecure ( )

Definition at line 448 of file index.php.

◆ PageFooter()

PageFooter (   $sAction)

Definition at line 1208 of file index.php.

◆ PageHeader()

PageHeader (   $sAction = '',
  $sError = '' 
)

Definition at line 1128 of file index.php.

◆ performInstallLanguages()

performInstallLanguages ( )

Definition at line 516 of file index.php.

◆ printInstallError()

printInstallError (   $sText)

Definition at line 1220 of file index.php.

◆ rewriteFile()

rewriteFile (   $sCode,
  $sReplace,
  $sFile 
)

Definition at line 1267 of file index.php.

◆ RunSQL()

RunSQL (   $sAdminName,
  $sAdminPassword 
)

Definition at line 1294 of file index.php.

◆ StartInstall()

StartInstall ( )

Definition at line 1082 of file index.php.

◆ walkThroughLanguage()

walkThroughLanguage (   $aLanguage,
  $aLangInfo 
)

Definition at line 537 of file index.php.

Variable Documentation

◆ $aConf [1/7]

$aConf = array()

Definition at line 76 of file index.php.

◆ $aConf [2/7]

$aConf[ 'confDir'] = '../inc/'

Definition at line 80 of file index.php.

◆ $aConf [3/7]

$aConf[ 'dolFile'] = '../inc/header.inc.php'

Definition at line 79 of file index.php.

◆ $aConf [4/7]

$aConf[ 'headerTempl'] =

Definition at line 81 of file index.php.

◆ $aConf [5/7]

$aConf[ 'iPatch'] = $site['build']

Definition at line 78 of file index.php.

◆ $aConf [6/7]

$aConf[ 'iVersion'] = $site['ver']

Definition at line 77 of file index.php.

◆ $aConf [7/7]

$aConf[ 'periodicTempl'] =

Definition at line 255 of file index.php.

◆ $aDbConf [1/8]

$aDbConf = array()

Definition at line 309 of file index.php.

◆ $aDbConf [2/8]

$aDbConf[ 'db_host']
Initial value:
= array(
'name' => "Database host name",
'ex' => "localhost",
'desc' => "MySQL database host name",
'def' => "localhost",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 328 of file index.php.

◆ $aDbConf [3/8]

$aDbConf[ 'db_name']
Initial value:
= array(
'name' => "Database name",
'ex' => "user_cheetah",
'desc' => "MySQL database name",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 349 of file index.php.

◆ $aDbConf [4/8]

$aDbConf[ 'db_password']
Initial value:
= array(
'name' => "Database password",
'ex' => "MySuperSecretWord",
'desc' => "MySQL database password",
'check' => function ($arg0) { return strlen($arg0) >= 0 ? true : false; }
)

Definition at line 361 of file index.php.

◆ $aDbConf [5/8]

$aDbConf[ 'db_port']
Initial value:
= array(
'name' => "Database host port number",
'ex' => "5506",
'desc' => "Leave blank for default value or specify MySQL database host port number",
'def' => "",
'check' => ''
)

Definition at line 335 of file index.php.

◆ $aDbConf [6/8]

$aDbConf[ 'db_sock']
Initial value:
= array(
'name' => "Database socket path",
'ex' => "/tmp/mysql50.sock",
'desc' => "Leave blank for default value or specify MySQL database socket path",
'def' => "",
'check' => ''
)

Definition at line 342 of file index.php.

◆ $aDbConf [7/8]

$aDbConf[ 'db_user']
Initial value:
= array(
'name' => "Database user",
'ex' => "YourName",
'desc' => "MySQL database user name with read/write access",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 355 of file index.php.

◆ $aDbConf [8/8]

$aDbConf[ 'sql_file']
Initial value:
= array(
'name' => "SQL file",
'ex' => "/home/cheetah/public_html/install/sql/vXX.sql",
'desc' => "SQL file location",
'def' => "./sql/vXX.sql",
'def_exp' => function () {
if ( !( $dir = opendir( "sql/" ) ) )
return "";
while (false !== ($file = readdir($dir))) {
if ( substr($file,-3) != 'sql' ) continue;
closedir( $dir );
return "./sql/$file";
}
closedir( $dir );
return "";
},
'check' => function ($arg0) { return strlen($arg0) >= 4 ? true : false; }
)

Definition at line 310 of file index.php.

◆ $aErrors [1/2]

foreach ( $aPhpExtensions as $sExtension) $aErrors = array()

Definition at line 39 of file index.php.

◆ $aErrors [2/2]

$aErrors[] = (ini_get('register_globals') == 0) ? '' : '<font color="red">register_globals is On (warning, you should have this param in the Off state, or your site will be unsafe)</font>'

Definition at line 40 of file index.php.

◆ $aGeneral [1/8]

$aGeneral = array()

Definition at line 368 of file index.php.

◆ $aGeneral [2/8]

$aGeneral[ 'admin_password']
Initial value:
= array(
'name' => "Admin Password",
'ex' => "MySuperSecretWord",
'desc' => "Secure admin password",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 405 of file index.php.

◆ $aGeneral [3/8]

$aGeneral[ 'admin_username']
Initial value:
= array(
'name' => "Admin Username",
'ex' => "admin",
'desc' => "Username to login to the administration area of the site",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 399 of file index.php.

◆ $aGeneral [4/8]

$aGeneral[ 'bug_report_email']
Initial value:
= array(
'name' => "Bug report email",
'ex' => "admin@your.site",
'desc' => "Email for receiving bug reports",
'check' => function ($arg0) { return strlen($arg0) > 0 AND strstr($arg0,"@") ? true : false; }
)

Definition at line 393 of file index.php.

◆ $aGeneral [5/8]

$aGeneral[ 'notify_email']
Initial value:
= array(
'name' => "Notify e-mail",
'ex' => "no-reply@your.site",
'desc' => "Email to send site notifications from",
'check' => function ($arg0) { return strlen($arg0) > 0 AND strstr($arg0,"@") ? true : false; }
)

Definition at line 387 of file index.php.

◆ $aGeneral [6/8]

$aGeneral[ 'site_desc']
Initial value:
= array(
'name' => "Site Description",
'ex' => "The place to find new friends, communicate and have fun.",
'desc' => "Meta description of your site",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 375 of file index.php.

◆ $aGeneral [7/8]

$aGeneral[ 'site_email']
Initial value:
= array(
'name' => "Site e-mail",
'ex' => "admin@your.site",
'desc' => "Site e-mail",
'check' => function ($arg0) { return strlen($arg0) > 0 AND strstr($arg0,"@") ? true : false; }
)

Definition at line 381 of file index.php.

◆ $aGeneral [8/8]

$aGeneral[ 'site_title']
Initial value:
= array(
'name' => "Site Title",
'ex' => "The Best Community",
'desc' => "The name of your site",
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 369 of file index.php.

◆ $aNonDeletableModules

$aNonDeletableModules
Initial value:
= array(
'cheetah/shared_photo/',
)

Definition at line 412 of file index.php.

◆ $aPhpExtensions

$aPhpExtensions
Initial value:
= array(
'curl',
'gd',
'mbstring',
'xsl',
'json',
'fileinfo',
'openssl',
'zip',
'ftp',
'calendar',
'exif',
'pdo',
'pdo_mysql'
)

This work, "Cheetah - https://www.cheetahwsb.com", is a derivative of "Dolphin Pro V7.4.2" by BoonEx Pty Limited - https://www.boonex.com/, used under CC-BY. "Cheetah" is licensed under CC-BY by Dean J. Bassett Jr. CC-BY License - http://creativecommons.org/licenses/by/3.0/

Definition at line 8 of file index.php.

◆ $aTemporalityWritableFolders

$aTemporalityWritableFolders
Initial value:
= array(
'inc',
)

Definition at line 416 of file index.php.

◆ $confFirst [1/4]

$confFirst = array()

Definition at line 260 of file index.php.

◆ $confFirst [2/4]

$confFirst[ 'dir_php']
Initial value:
= array(
'name' => "Path to php binary",
'ex' => "/usr/local/bin/php",
'desc' => "Full path to your PHP interpreter",
'def' => "/usr/local/bin/php",
'def_exp' => function () {
if ( file_exists("/usr/local/bin/php") ) return "/usr/local/bin/php";
if ( file_exists("/usr/bin/php") ) return "/usr/bin/php";
if ( file_exists($sPleskPath) ) return $sPleskPath;
$fp = popen ( "whereis php", "r");
if ( $fp ) {
$s = fgets($fp);
$s = sscanf($s, "php: %s");
if ( file_exists("$s[0]") ) return "$s[0]";
}
return '';
},
'check' => function ($arg0) { return strlen($arg0) >= 7 ? true : false; }
)

Definition at line 290 of file index.php.

◆ $confFirst [3/4]

$confFirst[ 'dir_root']
Initial value:
= array(
'name' => "Directory root",
'ex' => "/path/to/your/script/files/",
'desc' => "Path to the directory where your Cheetah files are located (slash at the end is required)",
'def_exp' => function () {
$str = rtrim($_SERVER['DOCUMENT_ROOT'], '/') . $_SERVER['PHP_SELF'];
return preg_replace("/install\/(index\.php$)/", "", $str);
},
'check' => function ($arg0) { return strlen($arg0) >= 1 ? true : false; }
)

Definition at line 277 of file index.php.

◆ $confFirst [4/4]

$confFirst[ 'site_url']
Initial value:
= array(
'name' => "Site URL",
'ex' => "http://www.mydomain.com/path/",
'desc' => "Your site URL (slash at the end is required)",
'def' => "http://",
'def_exp' => function () {
if(isSecure()) {
$sProtocol = "https://";
} else {
$sProtocol = "http://";
}
$str = $sProtocol . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
return preg_replace("/install\/(index\.php$)/", "", $str);
},
'check' => function ($arg0) { return strlen($arg0) >= 10 ? true : false; }
)

Definition at line 261 of file index.php.

◆ $iMemoryLimitBytes

$iMemoryLimitBytes = ini_get('memory_limit')

Definition at line 24 of file index.php.

◆ $last

$last = strtolower($iMemoryLimitBytes{strlen($iMemoryLimitBytes) - 1})

Definition at line 25 of file index.php.

◆ $sAction

$sAction = $_REQUEST['action']

Definition at line 424 of file index.php.

◆ $sError

$sError = ''

Definition at line 425 of file index.php.

◆ $sInstallPageContent

$sInstallPageContent = InstallPageContent($sError)

Definition at line 438 of file index.php.

◆ $sPleskPath

$sPleskPath = '/opt/plesk/php/' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '/bin/php'

Definition at line 288 of file index.php.

◆ CH_SKIP_INSTALL_CHECK

const CH_SKIP_INSTALL_CHECK true

Definition at line 427 of file index.php.

◆ if

if($sAction=='step6'|| $sAction=='step7'|| $sAction=='compile_languages')

Definition at line 429 of file index.php.

$sPleskPath
$sPleskPath
Definition: index.php:288
true
if(!defined("TRUE_VAL")) define("TRUE_VAL" true
Definition: constants.inc.php:8
isSecure
if($sInstallPageContent) isSecure()
Definition: index.php:448
$s
$s
Definition: index.php:29
$dir
$dir
Definition: config.php:10