Skip to content

Commit

Permalink
Travis again
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Uhl committed Aug 10, 2016
1 parent 5e074a9 commit 12bad5d
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions administrator/components/com_admin/script.php
Expand Up @@ -1688,8 +1688,8 @@ public function flushSessions()
/**
* Converts the site's database tables to the new null Date of mySQL 5.7. Can also be used as reverter
*
* @param string $oldNull the old null date string
* @param string $newNull the new null date string
* @param string $newNull the old null date string
* @param string $oldNull the new null date string
*
* @return void
*
Expand All @@ -1699,38 +1699,44 @@ public function convertTablesToNewNullDate($newNull=null,$oldNull=null)
{
$db = JFactory::getDbo();

// Check done a lil bit sooner
// This is only required for MySQL databases
$serverType = $db->getServerType();

if ($serverType != 'mysql')
{
return;
}

if (!method_exists($db,'serverUsesNewNullTime'))
if (!method_exists($db, 'serverUsesNewNullTime'))
{
return;
}

// Possible Convert Back
if ($db->serverUsesNewNullTime())
{
if(is_null($newNull))
if (is_null($newNull))
{
$newNull='1000-01-01 00:00:00';

if(is_null($oldNull))
$oldNull='0000-00-00 00:00:00';
}

if (is_null($oldNull))
{
$oldNull = '0000-00-00 00:00:00';
}
}
else
{
if(is_null($oldNull))
$oldNull='1000-01-01 00:00:00';
if (is_null($oldNull))
{
$oldNull = '1000-01-01 00:00:00';
}

if(is_null($newNull))
$newNull='0000-00-00 00:00:00';
if (is_null($newNull))
{
$newNull = '0000-00-00 00:00:00';
}
}

// This is only required for MySQL databases
$serverType = $db->getServerType();


// Check conversion status in database
$db->setQuery('SELECT ' . $db->quoteName('converted')
Expand All @@ -1750,9 +1756,9 @@ public function convertTablesToNewNullDate($newNull=null,$oldNull=null)
return;
}

if($convertedDB == $newNull)
if ($convertedDB == $newNull)
{
//Already updated - nothing to do
// Already updated - nothing to do
return;
}

Expand Down

0 comments on commit 12bad5d

Please sign in to comment.