1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 18:14:26 +02:00

install packaging now working

This commit is contained in:
CaMer0n
2009-09-05 23:02:23 +00:00
parent e2aa59c25e
commit 2cdae5662c
4 changed files with 148 additions and 62 deletions

View File

@@ -9,8 +9,8 @@
* mySQL Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
* $Revision: 1.46 $
* $Date: 2009-09-05 18:58:56 $
* $Revision: 1.47 $
* $Date: 2009-09-05 23:02:23 $
* $Author: e107coders $
*/
@@ -61,7 +61,7 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s
* MySQL Abstraction class
*
* @package e107
* @version $Revision: 1.46 $
* @version $Revision: 1.47 $
* @author $Author: e107coders $
*/
class db {
@@ -838,8 +838,10 @@ class db {
function db_Select_gen($query, $debug = FALSE, $log_type = '', $log_remark = '')
{
$this->tabset = FALSE;
$query .= " "; // temp fix for failing regex below, when there is no space after the table name;
if(strpos($query,'`#') !== FALSE)
{
{
$query = preg_replace_callback("/\s`#([\w]*?)`\W/", array($this, 'ml_check'), $query);
}
elseif(strpos($query,'#') !== FALSE)
@@ -865,7 +867,7 @@ class db {
}
function ml_check($matches)
{
{
$table = $this->db_IsLang($matches[1]);
if($this->tabset == false)
{

View File

@@ -9,8 +9,8 @@
* Simple XML Parser
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/xml_class.php,v $
* $Revision: 1.21 $
* $Date: 2009-09-03 22:27:32 $
* $Revision: 1.22 $
* $Date: 2009-09-05 23:02:23 $
* $Author: e107coders $
*/
@@ -27,6 +27,7 @@ if (!defined('e107_INIT')) { exit; }
*/
class xmlClass
{
/**
* Loaded XML string
*
@@ -65,6 +66,19 @@ class xmlClass
*/
public $stripComments = true;
/**
* Log of all paths replaced.
* @var
*/
public $fileConvertLog = array();
public $convertFilePaths = FALSE;
public $filePathDestination = FALSE;
public $convertFileTypes = array("jpg","gif","png","jpeg");
/**
* Add root element to the result array
* Exmple:
@@ -121,6 +135,10 @@ class xmlClass
*/
protected $_optValueKey = '@value';
/**
* Constructor - set defaults
*
@@ -526,9 +544,26 @@ class xmlClass
return false;
}
function replaceFilePaths($text)
{
$fullpath = e107::getParser()->replaceConstants($text[1]);
$this->fileConvertLog[] = $fullpath;
$file = basename($fullpath);
return $this->filePathDestination.$file;
}
private function e107ExportValue($val)
{
if($this->convertFilePaths)
{
$types = implode("|",$this->convertFileTypes);
$val = preg_replace_callback("#({e_.*?\.(".$types."))#i", array($this,'replaceFilePaths'), $val);
}
if(is_array($val))
{
return "<![CDATA[".e107::getArrayStorage()->WriteArray($val,FALSE)."]]>";
@@ -604,17 +639,33 @@ class xmlClass
if($debug==TRUE)
{
echo "<pre>".htmlentities($text)."</pre>";
echo "<pre>".htmlentities($text)."</pre>";
return TRUE;
}
else
{
if(!$text)
{
return FALSE;
}
$path = e107::getParser()->replaceConstants($this->filePathDestination);
if($path)
{
file_put_contents($path."install.xml",$text,FILE_TEXT);
return true;
}
header('Content-type: application/xml', TRUE);
header("Content-disposition: attachment; filename= e107Export_" . date("Y-m-d").".xml");
header("Cache-Control: max-age=30");
header("Pragma: public");
echo $text;
exit;
exit;
}
}
/**