Changeset 29893 for websites/trajoin

Show
Ignore:
Timestamp:
02/11/09 09:16:50 (4 years ago)
Author:
brtriver
Message:

change varchar to blob in original column type, and fix commit to repo

Location:
websites/trajoin/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • websites/trajoin/trunk/apps/frontend/config/module.yml

    r29849 r29893  
    55      1.2/jobeet/en: jobbet directory 
    66      1.2/cookbook/en: test 
     7      1.2/forms_book/en: form 
    78      jobeet: Learn symfony step by step 24 days, 1 hour a day 
    89      1.2/book: The Definitive Guide to symtony 
  • websites/trajoin/trunk/apps/frontend/modules/translation/actions/actions.class.php

    r29888 r29893  
    7777          $newTranslation = $this->form->save(); 
    7878          HistoryPeer::save($this->form->getObject(), $request->getParameter('translation[note]'), date('Y-m-d H:i:s')); 
     79          HistoryPeer::commit2repo($this->Parser->getFilePath(), $request->getParameter('translation[note]')); 
    7980          // svn commit if on production server 
    80           if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { 
    81             $Filesystem = new sfFilesystem(); 
    82             $svnPath = "../data/contents/markdown/1.2/"; 
    83             $this->logMessage($Filesystem->sh(sprintf('../symfony trajoin:markdown %s', $this->Parser->getFilePath()))); 
    84             $cmd= sprintf('svn status --config-dir /home/svn/.subversion %s* |grep ^? |cut -d \' \' -f 7 | xargs --no-run-if-empty svn add --config-dir /home/svn/.subversion ', $svnPath); 
    85             $this->logMessage($Filesystem->sh($cmd)); 
    86             $cmd= sprintf('svn commit --config-dir /home/svn/.subversion -m "%s" %s --username trajoin', escapeshellcmd($request->getParameter('translation[note]')), $svnPath); 
    87             $this->logMessage($Filesystem->sh($cmd)); 
    88           } 
     81          //          if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { 
     82          //  $Filesystem = new sfFilesystem(); 
     83          //  $svnPath = "../data/contents/markdown/1.2/"; 
     84          //  $this->logMessage($Filesystem->sh(sprintf('../symfony trajoin:markdown %s', $this->Parser->getFilePath()))); 
     85          //  $cmd= sprintf('svn status --config-dir /home/svn/.subversion %s* |grep ^? |cut -d \' \' -f 7 | xargs --no-run-if-empty svn add --config-dir /home/svn/.subversion ', $svnPath); 
     86          //  $this->logMessage($Filesystem->sh($cmd)); 
     87          //  $cmd= sprintf('svn commit --config-dir /home/svn/.subversion -m "%s" %s --username trajoin', escapeshellcmd($request->getParameter('translation[note]')), $svnPath); 
     88          //  $this->logMessage($Filesystem->sh($cmd)); 
     89          //} 
    8990        } else { 
    9091          $this->form->updateObject($this->form->getValues()); 
  • websites/trajoin/trunk/apps/frontend/modules/translation/templates/showTranslatedSuccess.php

    r29840 r29893  
    77  <a href="<?php echo url_for('@original') . "/" . $filePath ?>"><?php echo basename($filePath) ?></a> 
    88</p> 
    9  
    109<?php foreach($Parser->getChunks(ESC_RAW) as $id => $chunk): ?> 
    1110    <?php if (trim($chunk) == "") continue ?> 
  • websites/trajoin/trunk/config/schema.yml

    r29840 r29893  
    77    id: { type: INTEGER, primaryKey: true, required: true, autoincrement: true } 
    88    file_path: { type: VARCHAR, size: '255', required: true, index: true } 
    9     original: { type: LONGVARCHAR, required: false } 
     9    original: { type: VARBINARY, required: false } 
    1010  translation_i18n: 
    1111    _attributes: { phpName: TranslationI18n } 
     
    2929    translation_id: { type: INTEGER, required: true, foreignTable: translation, foreignReference: id } 
    3030    culture: { type: VARCHAR, size: '7', required: true } 
    31     original: { type: LONGVARCHAR, required: false } 
     31    original: { type: VARBINARY, required: false } 
    3232    translated: { type: LONGVARCHAR, required: true } 
    3333    note: { type: LONGVARCHAR, required: false } 
  • websites/trajoin/trunk/lib/model/HistoryPeer.php

    r29840 r29893  
    113113    $translation->getCurrentTranslationI18n()->setUserId($history->getUserId()); 
    114114    $translation->save(); 
     115    // commit to repo 
     116    self::commit2repo($translation->getFilePath(), $history->getNote()); 
    115117    // clear histories by same user and same chunk 
    116118    $sameHistories = self::retrieveByTranslationId($history->getTranslationId(), $history->getCulture()); 
     
    126128    } 
    127129  } 
     130  static public function commit2repo($filePath, $message="") 
     131  { 
     132    // svn commit if on production server 
     133    if (in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) return; 
     134    $Filesystem = new sfFilesystem(); 
     135    $svnPath = "../data/contents/markdown/1.2/"; 
     136    $cmd= sprintf('svn update --config-dir /home/svn/.subversion %s', $svnPath); 
     137    //$cmd= sprintf('svn update  %s', $svnPath); 
     138    self::logMessage($Filesystem->sh($cmd)); 
     139    self::logMessage($Filesystem->sh(sprintf('../symfony trajoin:markdown %s', $filePath))); 
     140    $cmd= sprintf('svn status --config-dir /home/svn/.subversion %s* |grep ^? |cut -d \' \' -f 7 | xargs --no-run-if-empty svn add --config-dir /home/svn/.subversion ', $svnPath); 
     141    //$cmd= sprintf('svn status  %s* |grep ^? |cut -d \' \' -f 7 | xargs svn add ', $svnPath); 
     142    self::logMessage($Filesystem->sh($cmd)); 
     143    $cmd= sprintf('svn commit --config-dir /home/svn/.subversion -m "%s" %s --username trajoin', escapeshellcmd($message), $svnPath); 
     144    //$cmd= sprintf('svn commit -m "%s" %s --username trajoin', escapeshellcmd($message), $svnPath); 
     145    self::logMessage($Filesystem->sh($cmd)); 
     146  } 
     147  static private function logMessage($message) 
     148  { 
     149  if (sfConfig::get('sf_logging_enabled')) { 
     150      sfContext::getInstance()->getLogger()->info($message); 
     151    } 
     152  } 
    128153}