1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Comments on download_setup.php and plugin_class

This commit is contained in:
CaMer0n
2012-11-07 03:40:07 +00:00
parent 3479203f6a
commit 47b19c677d
2 changed files with 13 additions and 11 deletions

View File

@@ -1231,13 +1231,13 @@ class e107plugin
}
/*
* FIXME - sql upgrade draft - we need better 'parse sql' support, INSERTs, ALTERs, etc
* NEW upgrade SQL
* higher priority -> from-to version upgrade sql queries - e.g. upgrade/sql_1.0-1.1.php (v1.0 to v1.1 only)
* when above not present -> generic version upgrade XML - e.g. upgrade/sql_1.1.php (all prior versions to v1.1)
* XXX - sql upgrade draft - we need better 'parse sql' support, INSERTs, ALTERs, etc
* NEW upgrade SQL - ALREADY EXISTS - use upgrade_pre($var) OR upgrade_post() methods in the {plugin}_setup.php file.
* All upgrade sql scripts are optional, if not found system is using the auto detection mode (diff against main sql file)
* ONLY NEW tables should be created here
* ONLY table CONTENT should be changed with this.
*/
/*
$doSql = true;
if($canContinue && $function === 'upgrade')
{
@@ -1256,6 +1256,8 @@ class e107plugin
}
}
}
*/
if ($canContinue && $doSql && count($sql_list)) // TODO - move to it's own function.
@@ -1920,6 +1922,7 @@ class e107plugin
if (class_exists($class_name))
{
$obj = new $class_name;
$obj->version_from = $this;
if (method_exists($obj, $method_name))
{
$mes->add("Executing setup function <b>".$method_name."()</b>", E_MESSAGE_DEBUG);

View File

@@ -48,9 +48,13 @@ class download_setup
*/
function upgrade_post($needed)
{
/*
* Currently Installed version (prior to upgrade): $needed->current_plug['plugin_version'];
*/
$sql = e107::getDb();
$mes = e107::getMessage();
$qry = "SELECT * FROM #download WHERE download_image !='' AND SUBSTRING(download_image, 1, 3) != '{e_' LIMIT 2";
$qry = "SELECT * FROM #download WHERE download_image !='' AND SUBSTRING(download_image, 1, 3) != '{e_' ";
if($sql->db_Select_gen($qry))
{
@@ -93,10 +97,5 @@ class download_setup
if($needed == TRUE){ return FALSE; }
//if(version_compare($var['current_plug']['plugin_version'], "1.2", "<"))
//{
// $qry = "ALTER TABLE #download ADD download_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;";
// $sql->db_Select_gen($qry);
//}
}
}