Example #1
0
 function _checkCollision()
 {
     jpimport('classes.core.utility.configuration');
     $lastLock = JoomlapackTables::ReadVar('CUBELock');
     // Expire CUBE lock after two minutes of inactivity
     if (is_null($lastLock)) {
         $noLock = true;
     } else {
         $now = time();
         $noLock = $now - $lastLock > 120;
     }
     if (!$noLock) {
         die(JoomlapackLangManager::_('FRONTEND_STATUS501'));
     }
 }
Example #2
0
 function deleteTempFiles()
 {
     $configuration =& JoomlapackConfiguration::getInstance();
     $tempFiles = JoomlapackTables::UnserializeVar('CUBETempFiles', array());
     foreach ($tempFiles as $fileName) {
         $file = $configuration->get('TempDirectory') . DS . $fileName;
         if (file_exists($file)) {
             @unlink($file);
         }
     }
     JoomlapackTables::DeleteVar('CUBETempFiles');
 }
Example #3
0
 /**
  * Writes a serialized copy of the $contentVariable to the database, under the packvar
  * variable name of $varName.
  *
  * @param string $varName The packvar to create
  * @param mixed $contentVariable Any variable to serialize (e.g. object, array, other variables, etc) 
  */
 function SerializeVar($varName, &$contentVariable)
 {
     $serialized = serialize($contentVariable);
     JoomlapackTables::WriteVar($varName, $serialized);
 }