fix variables on update
[Pman.Core] / UpdateDatabase.php
index c762a48..64b2bcc 100644 (file)
@@ -249,18 +249,20 @@ class Pman_Core_UpdateDatabase extends Pman
         
         // this will trigger errors about freetext indexes - we will have to remove them manually.?
         // otherwise we need to do an sql query to find them, then remove them (not really worth it as it only affects really old code..)
-        
+        echo "Run extensions\n";
+
         $this->runExtensions(); 
 
         
         if (empty($opts['data-only'])) {
+            echo "Import SQL\n";
             $this->importSQL();
         }
         if (!empty($opts['only-module-sql'])) {
             return;
         }
         
-        
+        echo "run Update Modules Data\n";
 
         $this->runUpdateModulesData();
         
@@ -496,6 +498,7 @@ class Pman_Core_UpdateDatabase extends Pman
            
         $mysql_cmd = $mysql .
             ' -h ' . $dburl['host'] .
+            (empty($dburl['port']) ? '' : " -P{$dburl['port']} ") .
             ' -u' . escapeshellarg($dburl['user']) .
             (!empty($dburl['pass']) ? ' -p' . escapeshellarg($dburl['pass'])  :  '') .
             ' ' . basename($dburl['path']);
@@ -918,10 +921,8 @@ class Pman_Core_UpdateDatabase extends Pman
         }
         foreach ($this->emailTemplates as $k => $mail) {
             
-            $mail_dir = "{$this->rootDir}{$mail['template_dir']}";
-
             $this->initEmails(
-                $mail_dir,
+                !empty($mail['template_dir']) ? "{$this->rootDir}{$mail['template_dir']}" : '',
                 array($k => $mail),
                 false
             );
@@ -1021,9 +1022,14 @@ class Pman_Core_UpdateDatabase extends Pman
             
             $opts = array(
                 'update' => 1,
-                'file' => $templateDir. $name .'.html'
             );
-            
+            if (!empty($templateDir)) {
+                $opts['file'] = $templateDir. $name .'.html';
+            }
+            if (!empty($data['raw_content'])) {
+                $opts['raw_content'] = $data['raw_content'];
+                $opts['name'] = $name;
+            }
             if (!empty($data['master'])) {
                 $opts['master'] = $templateDir . $master .'.html';
             }
@@ -1226,6 +1232,7 @@ class Pman_Core_UpdateDatabase extends Pman
             if (!file_exists(__DIR__.'/UpdateDatabase/'. $scls .'.php')) {
                 return;
             }
+            echo "Running : {$fn}\n";
             require_once $fn;
             $c = new $cls();
             
@@ -1251,17 +1258,16 @@ class Pman_Core_UpdateDatabase extends Pman
             'gifsicle', // used for gif conversions
         );
          
-         
-         
+          
         // these are prefered - but may have complicated depenacies
         $pref = $pref !== false ? $pref :  array(
             'abiword',
-            'faad',
+            //'faad',
             'ffmpeg',
             'html2text', // not availabe in debian squeeze
             'pdftocairo',  //poppler-utils - not available in debian squeeze.
 
-            'lame',
+            //'lame',
             'ssconvert',
             'unoconv',
             'wkhtmltopdf',