<br><div class="gmail_quote">On Sat, Mar 24, 2012 at 6:20 PM, Alex Marin <span dir="ltr"><<a href="mailto:alex.ukf@gmail.com">alex.ukf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>Hello, <br></div></div> <br>I find these refactoring guidelines useful for everyone, so I'll have a go:<br><br> $start = 0;<br> if ( strlen( $type ) > $GLOBALS['cfg']['LimitChars'] ) {<br>
$start = 13; // strlen( '<abbr title="' );<br><div class="im"> $type = '<abbr title="' . $type . '">'<br></div> . substr( $type, 0, $GLOBALS['cfg']['LimitChars'] )<br>
<div class="im">
. '</abbr>';<br> }<br><br> unset( $field_charset );<br></div> $matches_type = ( substr($type, $start, 4) == 'char'<br><div class="im"> || substr($type, $start, 7) == 'varchar'<br>
|| substr($type, $start, 4) == 'text'<br> || substr($type, $start, 8) == 'tinytext'<br> || substr($type, $start, 10) == 'mediumtext'<br>
|| substr($type, $start, 8) == 'longtext'<br> || substr($type, $start, 3) == 'set'<br> || substr($type, $start, 4) == 'enum'<br>
</div>
);<br> $field_charset = '';<br> if ( $matches_type && ! $extracted_fieldspec['binary'] ) {<br> if ( strpos( $type, ' character set ' ) ) {<br> $type = substr( $type, 0, strpos( $type, ' character set ' ) );<br>
}<br> if ( ! empty( $row['Collation'] ) ) {<br> $field_charset = $row['Collation'];<br> }<br> }<br><br><br>These are some refactoring modifications I would see fit, but I am sure<br>
there are others, so I would like to see different approaches.<br><br>--<br>Alex<br>
</blockquote></div><br>Without the 3 unnecessary newlines of course ( that were inserted <br>before my copy-pasted sections).<br>
<br>
--<br>
Alex<br>