Development

Changeset 7594

You must first sign up to be able to contribute.

Changeset 7594

Show
Ignore:
Timestamp:
02/24/08 00:38:36 (2 years ago)
Author:
dwhittle
Message:

dwhittle: merged changes to branch (r7593)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dwhittle/1.0/lib/cache/sfProcessCache.class.php

    r6598 r7594  
    7979   * @param string The key name 
    8080   * @param string The content to put in cache 
    81    * @param int The life time to keep the content in the cache 
     81   * @param int The life time to keep the content in the cache in seconds 
    8282   * 
    8383   * @return boolean true if ok 
  • branches/dwhittle/1.0/lib/debug/sfWebDebug.class.php

    r7490 r7594  
    224224 
    225225        ++$line_nb; 
    226         $logs .= sprintf("<tr class='sfWebDebugLogLine sfWebDebug%s %s'><td class=\"sfWebDebugLogNumber\">%s</td><td class=\"sfWebDebugLogType\">%s&nbsp;%s</td><td>%s%s</td></tr>\n",  
     226        $logs .= sprintf("<tr class='sfWebDebugLogLine sfWebDebug%s %s'><td class=\"sfWebDebugLogNumber\">%s</td><td class=\"sfWebDebugLogType\">%s&nbsp;%s</td><td>%s%s</td></tr>\n", 
    227227          ucfirst($priority), 
    228228          $logEntry['type'], 
     
    432432      <div id="main_'.$id.'" class="sfWebDebugActionCache" style="border: 1px solid #f00"> 
    433433      <div id="sub_main_'.$id.'" class="sfWebDebugCache" style="background-color: '.$bg_color.'; border-right: 1px solid #f00; border-bottom: 1px solid #f00;"> 
    434       <div style="height: 16px; padding: 2px"><a href="#" onclick="sfWebDebugToggle(\''.$id.'\'); return false;"><strong>cache information</strong></a>&nbsp;<a href="#" onclick="sfWebDebugToggle(\'sub_main_'.$id.'\'); document.getElementById(\'main_'.$id.'\').style.border = \'none\'; return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/close.png').'</a>&nbsp;</div> 
    435         <div style="padding: 2px; display: none" id="'.$id.'"> 
    436         [uri]&nbsp;'.$internalUri.'<br /> 
     434      <div style="height: 16px; padding: 2px"><a href="#" onclick="sfWebDebugToggle(\'sub_main_info_'.$id.'\'); return false;"><strong>cache information</strong></a>&nbsp;<a href="#" onclick="sfWebDebugToggle(\'sub_main_'.$id.'\'); document.getElementById(\'main_'.$id.'\').style.border = \'none\'; return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/close.png').'</a>&nbsp;</div> 
     435        <div style="padding: 2px; display: none" id="sub_main_info_'.$id.'"> 
     436        [uri]&nbsp;'.htmlentities($internalUri, ENT_QUOTES, sfConfig::get('sf_charset')).'<br /> 
    437437        [life&nbsp;time]&nbsp;'.$cache->getLifeTime($internalUri).'&nbsp;seconds<br /> 
    438438        [last&nbsp;modified]&nbsp;'.(time() - $last_modified).'&nbsp;seconds<br /> 
  • branches/dwhittle/1.0/lib/validator/sfNumberValidator.class.php

    r6598 r7594  
    4646  public function execute(&$value, &$error) 
    4747  { 
    48     if (!is_numeric($value)) 
     48    if (!preg_match('/^\d+(\.\d+)?$/', $value)) 
    4949    { 
    5050      // it's NaN, what nerve! 
  • branches/dwhittle/1.0/test/unit/validator/sfNumberValidatorTest.php

    r6598 r7594  
    1313require_once($_test_dir.'/unit/sfValidatorTestHelper.class.php'); 
    1414 
    15 $t = new lime_test(49, new lime_output_color()); 
     15$t = new lime_test(51, new lime_output_color()); 
    1616 
    1717$context = new sfContext(); 
     
    2525$t->ok($v->execute($number, $error), '->execute() returns true if you don\'t define any parameter'); 
    2626 
    27 $number = 'not a number'; 
    28 $error = null; 
    29 $t->ok(!$v->execute($number, $error), '->execute() returns "nan_error" if value is not a number'); 
    30 $t->is($error, 'Input is not a number', '->execute() changes "$error" with a default message if it returns false'); 
     27foreach (array('not a number', '0xFE') as $number) 
     28
     29  $error = null; 
     30  $t->ok(!$v->execute($number, $error), '->execute() returns "nan_error" if value is not a number'); 
     31  $t->is($error, 'Input is not a number', '->execute() changes "$error" with a default message if it returns false'); 
     32
    3133 
    3234foreach (array('any', 'decimal', 'float', 'int', 'integer') as $type) 
  • branches/dwhittle/1.1/lib/debug/sfWebDebug.class.php

    r7548 r7594  
    388388      <div id="main_'.$id.'" class="sfWebDebugActionCache" style="border: 1px solid #f00"> 
    389389      <div id="sub_main_'.$id.'" class="sfWebDebugCache" style="background-color: '.$bgColor.'; border-right: 1px solid #f00; border-bottom: 1px solid #f00;"> 
    390       <div style="height: 16px; padding: 2px"><a href="#" onclick="sfWebDebugToggle(\''.$id.'\'); return false;"><strong>cache information</strong></a>&nbsp;<a href="#" onclick="sfWebDebugToggle(\'sub_main_'.$id.'\'); document.getElementById(\'main_'.$id.'\').style.border = \'none\'; return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/close.png').'</a>&nbsp;</div> 
    391         <div style="padding: 2px; display: none" id="'.$id.'"> 
     390      <div style="height: 16px; padding: 2px"><a href="#" onclick="sfWebDebugToggle(\'sub_main_info_'.$id.'\'); return false;"><strong>cache information</strong></a>&nbsp;<a href="#" onclick="sfWebDebugToggle(\'sub_main_'.$id.'\'); document.getElementById(\'main_'.$id.'\').style.border = \'none\'; return false;">'.image_tag(sfConfig::get('sf_web_debug_web_dir').'/images/close.png').'</a>&nbsp;</div> 
     391        <div style="padding: 2px; display: none" id="sub_main_info_'.$id.'"> 
    392392        [uri]&nbsp;'.htmlentities($internalUri, ENT_QUOTES, sfConfig::get('sf_charset')).'<br /> 
    393393        [life&nbsp;time]&nbsp;'.$cache->getLifeTime($internalUri).'&nbsp;seconds<br /> 
  • branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/lib/validator/sfNumberValidator.class.php

    r5386 r7594  
    4646  public function execute(&$value, &$error) 
    4747  { 
    48     if (!is_numeric($value)) 
     48    if (!preg_match('/^\d+(\.\d+)?$/', $value)) 
    4949    { 
    5050      // it's NaN, what nerve! 
  • branches/dwhittle/1.1/lib/plugins/sfCompat10Plugin/test/unit/validator/sfNumberValidatorTest.php

    r5386 r7594  
    1313require_once(dirname(__FILE__).'/sfValidatorTestHelper.class.php'); 
    1414 
    15 $t = new lime_test(49, new lime_output_color()); 
     15$t = new lime_test(51, new lime_output_color()); 
    1616 
    1717$context = sfContext::getInstance(); 
     
    2424$t->ok($v->execute($number, $error), '->execute() returns true if you don\'t define any parameter'); 
    2525 
    26 $number = 'not a number'; 
    27 $error = null; 
    28 $t->ok(!$v->execute($number, $error), '->execute() returns "nan_error" if value is not a number'); 
    29 $t->is($error, 'Input is not a number', '->execute() changes "$error" with a default message if it returns false'); 
     26foreach (array('not a number', '0xFE') as $number) 
     27
     28  $error = null; 
     29  $t->ok(!$v->execute($number, $error), '->execute() returns "nan_error" if value is not a number'); 
     30  $t->is($error, 'Input is not a number', '->execute() changes "$error" with a default message if it returns false'); 
     31
    3032 
    3133foreach (array('any', 'decimal', 'float', 'int', 'integer') as $type) 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.