Source for file install.class.inc.php
Documentation is available at install.class.inc.php
require_once(dirname(__FILE__
).
'/../../manager/includes/core.class.inc.php');
* Exits with error message
* @param string $msg Default: unspecified error
* @param string $query Default: Empty string
* @param boolean $is_error Default: true
* @param string $nr Default: Empty string
* @param string $file Default: Empty string
* @param string $source Default: Empty string
* @param string $text Default: Empty string
* @param string $line Default: Empty string
function messageQuit($msg=
'unspecified error', $query=
'', $is_error=
true, $nr=
'', $file=
'', $source=
'', $text=
'', $line=
'') {
exit("\n\n$msg\n\n$query");
* Parser function to set up tables and data from *.sql setup files
* transferred from sqlParser class
// check to make sure file exists
$this->mysqlErrors[] =
array("error" =>
"File '$filename' not found");
$fh =
fopen($filename, 'r');
$idata .=
fread($fh, 1024);
// check if in upgrade mode
if ($this->mode==
"upd") {
// remove non-upgradeable parts
$s =
strpos($idata,"non-upgrade-able[[");
$e =
strpos($idata,"]]non-upgrade-able")+
17;
if($s &&
$e) $idata =
str_replace(substr($idata,$s,$e-
$s)," Removed non upgradeable items",$idata);
$idata =
str_replace('{IMAGEPATH}', $this->imagePath, $idata);
$idata =
str_replace('{IMAGEURL}', $this->imageUrl, $idata);
$sql_array =
explode("\n\n", $idata);
// Don't exit on failed query
foreach($sql_array as $sql_entry) {
$sql_do =
trim($sql_entry, "\r\n; ");
$this->db->query($sql_do);
if ($this->db->getLastError()) {
// Ignore duplicate and drop errors - Raymond
if ($this->ignoreDuplicateErrors){
$errno =
$this->db->getLastError(true);
if ($errno ==
1060 ||
$errno ==
1061 ||
$errno ==
1091) continue;
$this->mysqlErrors[] =
array("error" =>
$this->db->getLastError(), "sql" =>
$sql_do);
* Select or create category for installation TPL file
* transferred from instprocessor.php
$table_prefix =
$this->prefix;
$category =
$this->db->escape($category);
$rs =
$this->db->select('id', "`{$table_prefix}categories`", "category='$category' ");
$row =
$this->db->getValue($rs);
$category_id =
$this->db->insert(array("`category`"=>
"$category"), "`{$table_prefix}categories`");
Documentation generated on Fri, 21 Jun 2013 12:37:07 +0100 by phpDocumentor 1.4.4