Changeset 12066

Show
Ignore:
Timestamp:
06/25/08 06:25:52 (2 years ago)
Author:
asha
Message:

#5235 - PHP Timeout Settings (Configurable through config.inc.php) - Asha

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vtigercrm/branches/5.1/config.template.php

    r12031 r12066  
    194194$listview_max_textlength = 40; 
    195195 
     196// Maximum time limit for PHP script execution (in seconds) 
     197$php_max_execution_time = 0; 
     198 
    196199?> 
  • vtigercrm/branches/5.1/index.php

    r12015 r12066  
    104104        require_once('config_override.php'); 
    105105} 
    106 $default_config_values = Array( "allow_exports"=>"all","upload_maxsize"=>"3000000", "listview_max_textlength" => "40" ); 
    107        
     106$default_config_values = Array( "allow_exports"=>"all","upload_maxsize"=>"3000000", "listview_max_textlength" => "40", "php_max_execution_time" => "0"); 
     107       
    108108set_default_config($default_config_values); 
    109109require_once('include/logging.php'); 
  • vtigercrm/branches/5.1/install/5createTables.php

    r12064 r12066  
    1717 * Description:  Executes a step in the installation process. 
    1818 ********************************************************************************/ 
    19 set_time_limit(2000); 
     19set_time_limit(0); 
    2020 
    2121if (isset($_REQUEST['db_name'])) $db_name                               = $_REQUEST['db_name']; 
  • vtigercrm/branches/5.1/modules/Import/ImportStep3.php

    r11840 r12066  
    3737require_once('modules/Import/ImportSave.php'); 
    3838 
    39 set_time_limit(0); 
     39global $php_max_execution_time; 
     40set_time_limit($php_max_execution_time); 
    4041ini_set("display_errors",'0'); 
    4142 
  • vtigercrm/branches/5.1/modules/Migration/DBChanges/42P2_to_50.php

    r11968 r12066  
    1111 
    1212ini_set("memory_limit","32M"); 
    13 set_time_limit(600); 
     13global $php_max_execution_time; 
     14set_time_limit($php_max_execution_time); 
    1415 
    1516//This file is used to modify the database from 4.2Patch2 to 5.0 Alpha release 
  • vtigercrm/branches/5.1/modules/Migration/HTMLtoUTF8Conversion.php

    r12064 r12066  
    1010 
    1111ini_set("memory_limit","32M"); 
    12 set_time_limit(-1); 
     12global $php_max_execution_time; 
     13set_time_limit($php_max_execution_time); 
    1314 
    1415echo '<div align = "center"><br><b>Started UTF8 Conversion</b><br></div>'; 
  • vtigercrm/branches/5.1/modules/Migration/MigrationInfo.php

    r12064 r12066  
    283283                                                <br /> 
    284284                                 
    285                                                 Note :  Please copy and archive the failed queries log. This may help in future references.<br><br><?php 
    286 //Added to check database charset and $default_charset are set to UTF8. 
    287 //If both are not set to be UTF-8, Then we will show an alert message. 
    288 /*function check_db_utf8_support($conn)  
    289 {  
    290         $dbvarRS = &$conn->query("show variables like '%_database' ");  
    291         $db_character_set = null;  
    292         $db_collation_type = null;  
    293         while(!$dbvarRS->EOF) {  
    294                 $arr = $dbvarRS->FetchRow();  
    295                 $arr = array_change_key_case($arr);  
    296                 switch($arr['variable_name']) {  
    297                 case 'character_set_database' : $db_character_set = $arr['value']; break;  
    298                 case 'collation_database'     : $db_collation_type = $arr['value']; break;  
    299                 } 
    300                 // If we have all the required information break the loop.  
    301                 if($db_character_set != null && $db_collation_type != null) break;  
    302         }  
    303         return (stristr($db_character_set, 'utf8') && stristr($db_collation_type, 'utf8'));  
    304 
    305  
    306         global $adb,$default_charset; 
    307         $db_status=check_db_utf8_support($adb); 
    308         if(strtolower($default_charset) == 'utf-8')     $config_status=1; 
    309         else                                            $config_status=0; 
    310  
    311         if(!$db_status && !$config_status) 
    312         { 
    313                 $msg='<font color="red"><b>Your database charset and $default_charset variable in config.inc.php are not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the above to UTF-8</b></font>'; 
    314         } 
    315         else if($db_status && !$config_status) 
    316         { 
    317                 $msg='<font color="red"><b>Your database charset is set as UTF-8. But $default_charset variable in config.inc.php is not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the $default_charset variable to UTF-8</b></font>'; 
    318  
    319         } 
    320         else if(!$db_status && $config_status) 
    321         { 
    322                 $msg='<font color="red"><b>Your $default_charset variable in config.inc.php is set as UTF-8. But your database charset is not set as UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set your database charset to UTF-8</b></font>'; 
    323  
    324         } 
    325 echo $msg; 
    326  
    327  */ 
    328  
    329 ?> 
     285                                                Note :  Please copy and archive the failed queries log. This may help in future references.<br><br> 
    330286                                        </td> 
    331287                                   </tr> 
    332288                                   <tr bgcolor="#FFFFFF"><td colspan="2">&nbsp;</td></tr> 
    333         <!--                       <tr bgcolor="#FFFFFF"><td colspan="2"> --> 
    334 <?php/* 
    335 if($continue_42P2) 
    336 
    337  echo '<br><table border="1" cellpadding="3" cellspacing="0" height="100%" width="80%" align="center"> 
    338                 <tr> 
    339                 <td colspan="2" align="center"><br>If you migrated from 503 or its below version the special characters like other language characters are stored as html values. These html values are not getting displayed properly in the latest version, it will display as html symbols without conversion. So that you need to change your html values into utf8 characters. If you are going to use ISO charset in config file and in DataBase, then you no need do this conversion. Click on the Convert Now button to convert your html characters into utf8 characters.<br><br>  
    340                                         <form name="ascii_to_utf" method="post" action="index.php"> 
    341                                         <input type="hidden" name="module" value="Migration"> 
    342                                         <input type="hidden" name="action" value="HTMLtoUTF8Conversion"> 
    343                                         <input type="submit" name="close" value=" &nbsp;Convert Now&nbsp; " class="crmbutton small cancel" /> 
    344                                 </form><br> 
    345                         </td> 
    346                 </tr> 
    347                 </table> 
    348                 <tr bgcolor="#FFFFFF"><td colspan="2">&nbsp;</td></tr>'; 
    349  
    350 }*/ 
    351 ?> 
    352 <!-- </td></tr> --> 
     289                                    
    353290                                   <tr> 
    354291                                        <td colspan="2" align="center"> 
  • vtigercrm/branches/5.1/modules/Migration/MigrationStep0.php

    r12064 r12066  
    5959        header("Location: index.php?module=Migration&action=index&parenttab=Settings"); 
    6060} 
    61 /* Only for testing  
    62 $smarty->assign("DB_CHARSET", "latin1"); 
    63 $smarty->assign("DB_STATUS", 0); 
    64 $smarty->assign("CONFIG_CHARSET", "ISO"); 
    65 $smarty->assign("CONFIG_STATUS", 0); 
    66 $db_migration_status = 2; 
    67 */ 
     61 
    6862$smarty->assign("CONVERSION_MSG", $data_conversion_msg[$db_migration_status]); 
    6963 
  • vtigercrm/branches/5.1/modules/Migration/PatchApply.php

    r12002 r12066  
    1111 
    1212ini_set("memory_limit","32M"); 
    13 set_time_limit(-1); 
     13global $php_max_execution_time; 
     14set_time_limit($php_max_execution_time); 
    1415 
    1516global $current_user; 
     
    135136} 
    136137 
    137 //Added to check database charset and $default_charset are set to UTF8. 
    138 //If both are not set to be UTF-8, Then we will show an alert message. 
    139 /* 
    140 function check_db_utf8_charset($conn)  
    141 {  
    142         $dbvarRS = &$conn->query("show variables like '%_database' ");  
    143         $db_character_set = null;  
    144         $db_collation_type = null;  
    145         while(!$dbvarRS->EOF) {  
    146                 $arr = $dbvarRS->FetchRow();  
    147                 $arr = array_change_key_case($arr);  
    148                 switch($arr['variable_name']) {  
    149                 case 'character_set_database' : $db_character_set = $arr['value']; break;  
    150                 case 'collation_database'     : $db_collation_type = $arr['value']; break;  
    151                 } 
    152                 // If we have all the required information break the loop.  
    153                 if($db_character_set != null && $db_collation_type != null) break;  
    154         }  
    155         return (stristr($db_character_set, 'utf8') && stristr($db_collation_type, 'utf8'));  
    156 } 
    157  
    158 /*      global $adb,$default_charset; 
    159         $db_status=check_db_utf8_charset($adb); 
    160         if(strtolower($default_charset) == 'utf-8')     $config_status=1; 
    161         else                                            $config_status=0; 
    162  
    163         if(!$db_status && !$config_status) 
    164         { 
    165                 $msg='<br><font color="red"><b>Your database charset and $default_charset variable in config.inc.php are not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the above to UTF-8</b></font>'; 
    166         } 
    167         else if($db_status && !$config_status) 
    168         { 
    169                 $msg='<br><font color="red"><b>Your database charset is set as UTF-8. But $default_charset variable in config.inc.php is not set to UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set the $default_charset variable to UTF-8</b></font>'; 
    170  
    171         } 
    172         else if(!$db_status && $config_status) 
    173         { 
    174                 $msg='<br><font color="red"><b>Your $default_charset variable in config.inc.php is set as UTF-8. But your database charset is not set as UTF-8. Due to that you may not use UTF-8 characters in vtigerCRM. Please set your database charset to UTF-8</b></font>'; 
    175  
    176         } 
    177         echo $msg; 
    178 if(!$continue_42P2 && $db_change_conformation == true) 
    179 { 
    180 echo '<br><table border="1" cellpadding="3" cellspacing="0" height="100%" width="80%" align="center"> 
    181                 <tr> 
    182                 <td colspan="2" align="center"><br>If you are migrating from 5.0.3 or earlier versions, which had partial unicode (UTF-8) support, the unicode characters got saved as HTML entities. <br>If you are going to use ISO charset in config file and in database, then you need not do conversion.<br> Click on "Convert Now" button to convert html entities into utf8 characters.<br><br>  
    183                                         <form name="html_to_utf" method="post" action="index.php"> 
    184                                         <input type="hidden" name="module" value="Migration"> 
    185                                         <input type="hidden" name="action" value="HTMLtoUTF8Conversion"> 
    186  
    187                                         <input type="submit" name="close" value=" &nbsp;Convert Now&nbsp; " class="crmbutton small save" /> 
    188                                 </form><br> 
    189                         </td> 
    190                 </tr> 
    191         </table><br><br>'; 
    192  
    193 } 
    194 //if($db_change_conformation == true) 
    195 //{ */ 
    196138echo '<table width="95%"  border="0" align="center"> 
    197139        <tr bgcolor="#FFFFFF"><td colspan="2">&nbsp;</td></tr> 
     
    206148                </tr> 
    207149        </table><br><br>'; 
    208 //} 
     150 
    209151perform_post_migration_activities(); 
    210152 
  • vtigercrm/branches/5.1/modules/Migration/index.php

    r12016 r12066  
    103103} 
    104104 
    105 //Added to check database charset and $default_charset are set to UTF8. 
    106 //If both are not set to be UTF-8, Then we will show an alert message. 
    107 /*function check_db_utf8_support($conn)  
    108 {  
    109         $dbvarRS = &$conn->query("show variables like '%_database' ");  
    110         $db_character_set = null;  
    111         $db_collation_type = null;  
    112         while(!$dbvarRS->EOF) {  
    113                 $arr = $dbvarRS->FetchRow();  
    114                 $arr = array_change_key_case($arr);  
    115                 switch($arr['variable_name']) {  
    116                 case 'character_set_database' : $db_character_set = $arr['value']; break;  
    117                 case 'collation_database'     : $db_collation_type = $arr['value']; break;  
    118                 } 
    119                 // If we have all the required information break the loop.  
    120                 if($db_character_set != null && $db_collation_type != null) break;  
    121         }  
    122         return (stristr($db_character_set, 'utf8') && stristr($db_collation_type, 'utf8'));  
    123 } 
    124         global $adb,$default_charset; 
    125         $db_status=check_db_utf8_support($adb); 
    126         if(strtolower($default_charset) == 'utf-8')     $config_status=1; 
    127         else                                            $config_status=0; 
    128105 
    129         $db_migration_status =true; 
    130  
    131         if(!isset($db_character_set)) 
    132         { 
    133         $result = $adb->query("show variables like 'character_set_database'");   
    134         $row = $adb->fetch_array($result); 
    135         $db_character_set = $row['value']; 
    136         } 
    137         if(!$db_status && !$config_status) 
    138         { 
    139                 $db_migration_status = false; 
    140                 if($db_character_set =='latin1' && strtolower($default_charset) == 'iso-8859-1') 
    141                 $db_migration_status = true; 
    142                 $msg='<br/>'; 
    143         } 
    144         else if($db_status && !$config_status) 
    145         { 
    146                 $db_migration_status = false; 
    147                 $msg='<br> If you want to use UTF-8 charset for both vtigerCRM server and database , please change the $default_charset variable to UTF-8 in config.inc.php file and click on the "Continue" button.<br/><b> Otherwise '; 
    148  
    149         } 
    150         else if(!$db_status && $config_status) 
    151         { 
    152                 $db_migration_status = false; 
    153                 $msg='<br> If you want to use UTF-8 charset for both vtigerCRM server and database , please click on the <b> "Use UTF-8 charset" </b> button. <br/><b> Otherwise  '; 
    154  
    155         } 
    156  */      
    157106$smarty = new vtigerCRM_Smarty(); 
    158  
    159 //$smarty->assign("CHARSET_CHECK", $msg); 
    160107 
    161108$smarty->assign("MIG_CHECK", $status); 
     
    182129global $vtiger_current_version; 
    183130$smarty->assign("CURRENT_VERSION", $vtiger_current_version); 
    184 /* 
    185 if($db_migration_status == false) 
    186 { 
    187         echo '<br><br> 
    188                 <font color ="red"> <ul><li>Changes made to database during migration cannot be reverted back. So we highly recommend to take database dump of the current working database before migration.</ul></font><br/> <br/></table>'; 
    189                  
    190         echo '  <table border="1" cellpadding ="2" cellspacing="0" height="100%" width="50%" align="center"> 
    191                 <tr><td>vtigerCRM Database Characterset </td><td>'; 
    192                 if(isset($db_character_set)) 
    193                         echo $db_character_set; 
    194         echo '  </td></tr> 
    195                 <tr><td>vtigerCRM Server Characterset </td><td>'.$default_charset.' </td></tr> 
    196                 </table>'; 
    197         echo '<br><br> 
    198                 <table border="1" cellpadding="3" cellspacing="0" height="100%" width="80%" align="center"> 
    199                 <tr> 
    200                 <td colspan="2" align="center"><br>'; 
    201         echo '<font color ="red"> <br/> There is a conflict between the vtigerCRM server characterset and database characterset. '; 
    202         echo $msg; 
    203         echo '<b> Specify the same character set both in vtigerCRM server & database and click on the "Continue" button to proceed with Migration.</b> </font> '; 
    204         echo '<br><br><form name="html_to_utf" method="post" action="index.php"> 
    205                                         <input type="hidden" name="module" value="Migration"> 
    206                                         <input type="hidden" name="action" value="index"> 
    207                                         <input type="hidden" name="dbconversionutf8" value = ""> 
    208                                         <input type="hidden" name="parenttab" value="Settings">'; 
    209                                 if(!$db_status && $config_status){       
    210                         echo    '<input type="button" name="close" value=" &nbsp; Use UTF-8 Charset &nbsp; " onclick ="dbcovert();" class="crmbutton small save" />'; 
    211 } 
    212                 echo  ' <input type="submit" name="close" value=" &nbsp;Continue &nbsp; " class="crmbutton small save" /> 
    213                         </form> 
    214 <script>function dbcovert(){getObj("dbconversionutf8").value="yes";document.html_to_utf.submit();}</script> 
    215                         <br> 
    216                         </td> 
    217                 </tr> 
    218         </table><br><br>'; 
    219131 
    220         //echo "<a href='index.php?action=index&module=".$_REQUEST['module']."&parenttab=".$_REQUEST['parenttab']."'>Continue</a>"; 
    221         exit;    
    222 
    223 else */ 
    224         $smarty->display("Migration.tpl"); 
    225  
    226 //include("modules/Migration/DBChanges/501_to_502.php"); 
     132$smarty->display("Migration.tpl"); 
    227133 
    228134?> 
  • vtigercrm/branches/5.1/modules/Reports/CreateXL.php

    r11648 r12066  
    99* 
    1010********************************************************************************/ 
    11 set_time_limit(10); 
     11global $php_max_execution_time; 
     12set_time_limit($php_max_execution_time); 
    1213 
    1314require_once("include/php_writeexcel/class.writeexcel_workbook.inc.php"); 
  • vtigercrm/branches/5.1/modules/Reports/ReportRun.php

    r11967 r12066  
    18021802        function GenerateReport($outputformat,$filterlist) 
    18031803        { 
    1804                 global $adb,$current_user
     1804                global $adb,$current_user,$php_max_execution_time
    18051805                global $modules,$app_strings; 
    18061806                global $mod_strings,$current_language; 
     
    19611961                                        $thirdvalue = $tnewvalue; 
    19621962                                        $arr_val[] = $arraylists; 
    1963                                         set_time_limit(0); 
     1963                                        set_time_limit($php_max_execution_time); 
    19641964                                }while($custom_field_values = $adb->fetch_array($result)); 
    19651965 
     
    20522052                                        } 
    20532053                                        $arr_val[] = $arraylists; 
    2054                                         set_time_limit(0); 
     2054                                        set_time_limit($php_max_execution_time); 
    20552055                                }while($custom_field_values = $adb->fetch_array($result)); 
    20562056 
     
    22832283                                         $thirdvalue = $tnewvalue; 
    22842284                                         $arr_val[] = $arraylists; 
    2285                                          set_time_limit(0); 
     2285                                         set_time_limit($php_max_execution_time); 
    22862286                                }while($custom_field_values = $adb->fetch_array($result)); 
    22872287                                 
  • vtigercrm/branches/5.1/modules/Users/RecalculateSharingRules.php

    r11954 r12066  
    99* 
    1010 ********************************************************************************/ 
    11  
    12 set_time_limit(-1); 
     11global $php_max_execution_time; 
     12set_time_limit($php_max_execution_time); 
    1313RecalculateSharingRules(); 
    1414