Subversion Repositories SvarDOS

Rev

Rev 923 | Rev 926 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 923 Rev 925
Line 129... Line 129...
129
    $subver[0] = ord(substr($verstr, -1));
129
    $subver[0] = ord(substr($verstr, -1));
130
    $verstr = substr_replace($verstr, '', -1); // remove last character from string
130
    $verstr = substr_replace($verstr, '', -1); // remove last character from string
131
  }
131
  }
132
 
132
 
133
  // convert "30-jan-99" and "30-jan-1999" versions to "30jan99" and "30jan1999"
133
  // convert "30-jan-99" and "30-jan-1999" versions to "30jan99" and "30jan1999"
134
  if (preg_match('/^[0-3][0-9]-(jan|feb|mar|apr|jun|jul|aug|sep|oct|nov|dec)-([0-9][0-9]){1,2}$/', $verstr)) {
134
  if (preg_match('/^[0-3][0-9].(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec).([0-9][0-9]){1,2}$/', $verstr)) {
135
    $dy = substr($verstr, 0, 2);
135
    $dy = substr($verstr, 0, 2);
136
    $mo = substr($verstr, 3, 3);
136
    $mo = substr($verstr, 3, 3);
137
    $ye = substr($verstr, 7);
137
    $ye = substr($verstr, 7);
138
    $verstr = "{$ye}{$mo}{$dy}";
138
    $verstr = "{$dy}{$mo}{$ye}";
139
  }
139
  }
140
 
140
 
141
  // convert "30jan99" versions to 99.1.30 and "30jan1999" to 1999.1.30
141
  // convert "30jan99" versions to 99.1.30 and "30jan1999" to 1999.1.30
142
  if (preg_match('/^[0-3][0-9](jan|feb|mar|apr|jun|jul|aug|sep|oct|nov|dec)([0-9][0-9]){1,2}$/', $verstr)) {
142
  if (preg_match('/^[0-3][0-9](jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)([0-9][0-9]){1,2}$/', $verstr)) {
143
    $months = array('jan' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'may' => 5, 'jun' => 6, 'jul' => 7, 'aug' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12);
143
    $months = array('jan' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'may' => 5, 'jun' => 6, 'jul' => 7, 'aug' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12);
144
    $dy = substr($verstr, 0, 2);
144
    $dy = substr($verstr, 0, 2);
145
    $mo = $months[substr($verstr, 2, 3)];
145
    $mo = $months[substr($verstr, 2, 3)];
146
    $ye = substr($verstr, 5);
146
    $ye = substr($verstr, 5);
147
    $verstr = "{$ye}.{$mo}.{$dy}";
147
    $verstr = "{$ye}.{$mo}.{$dy}";