Author: ornicar2
Date: 2010-02-10 20:40:13 +0100 (Wed, 10 Feb 2010)
New Revision: 27839

Modified:
   
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
Log:
[Diem]
- better strings in record loremization

Modified: 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
===================================================================
--- 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
  2010-02-10 19:39:31 UTC (rev 27838)
+++ 
plugins/diemPlugin/trunk/dmCorePlugin/lib/doctrine/loremizer/dmRecordLoremizer.php
  2010-02-10 19:40:13 UTC (rev 27839)
@@ -183,13 +183,21 @@
       return $this->getRandomLink();
     }
 
-    $nbCarac = mt_rand(min(4, $column['length']), max(40, $column['length']));
+    if($column['length'] < 40)
+    {
+      $nbCarac = mt_rand(1, $column['length']);
+    }
+    else
+    {
+      $maxLen = $column['length'] > 80 ? $column['length'] / 2 : 
$column['length'];
+      $nbCarac = mt_rand(min(4, $column['length']), max(40, $maxLen));
+    }
+
     $val = trim(dmLorem::getLittleLorem($nbCarac));
 
     if (dmArray::get($column, 'unique'))
     {
-      $rlen = mt_rand(4, 10);
-      $val = substr($val.dmString::random($rlen), 0, $column['length']);
+      $val = substr(dmString::random(4).' '.$val, 0, $column['length']);
     }
 
     if (dmArray::get($column, 'nospace'))

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to