@@ -67,20 +67,8 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption)
67
67
zend_long memsize = atoi (ZSTR_VAL (new_value ));
68
68
/* sanity check we must use at least 8 MB */
69
69
if (memsize < 8 ) {
70
- const char * new_new_value = "8" ;
71
- zend_ini_entry * ini_entry ;
72
-
73
- memsize = 8 ;
74
70
zend_accel_error (ACCEL_LOG_WARNING , "opcache.memory_consumption is set below the required 8MB.\n" );
75
- zend_accel_error (ACCEL_LOG_WARNING , ACCELERATOR_PRODUCT_NAME " will use the minimal 8MB configuration.\n" );
76
-
77
- if ((ini_entry = zend_hash_str_find_ptr (EG (ini_directives ),
78
- "opcache.memory_consumption" ,
79
- sizeof ("opcache.memory_consumption" )- 1 )) == NULL ) {
80
- return FAILURE ;
81
- }
82
-
83
- ini_entry -> value = zend_string_init_interned (new_new_value , 1 , 1 );
71
+ return FAILURE ;
84
72
}
85
73
if (UNEXPECTED (memsize > ZEND_ULONG_MAX / (1024 * 1024 ))) {
86
74
* p = ZEND_ULONG_MAX ;
@@ -95,29 +83,13 @@ static ZEND_INI_MH(OnUpdateMaxAcceleratedFiles)
95
83
zend_long * p = (zend_long * ) ZEND_INI_GET_ADDR ();
96
84
zend_long size = atoi (ZSTR_VAL (new_value ));
97
85
/* sanity check we must use a value between MIN_ACCEL_FILES and MAX_ACCEL_FILES */
98
-
99
- if (size < MIN_ACCEL_FILES || size > MAX_ACCEL_FILES ) {
100
- const char * new_new_value ;
101
- zend_ini_entry * ini_entry ;
102
-
103
- if (size < MIN_ACCEL_FILES ) {
104
- size = MIN_ACCEL_FILES ;
105
- new_new_value = TOKENTOSTR (MIN_ACCEL_FILES );
106
- zend_accel_error (ACCEL_LOG_WARNING , "opcache.max_accelerated_files is set below the required minimum (%d).\n" , MIN_ACCEL_FILES );
107
- zend_accel_error (ACCEL_LOG_WARNING , ACCELERATOR_PRODUCT_NAME " will use the minimal configuration.\n" );
108
- }
109
- if (size > MAX_ACCEL_FILES ) {
110
- size = MAX_ACCEL_FILES ;
111
- new_new_value = TOKENTOSTR (MAX_ACCEL_FILES );
112
- zend_accel_error (ACCEL_LOG_WARNING , "opcache.max_accelerated_files is set above the limit (%d).\n" , MAX_ACCEL_FILES );
113
- zend_accel_error (ACCEL_LOG_WARNING , ACCELERATOR_PRODUCT_NAME " will use the maximal configuration.\n" );
114
- }
115
- if ((ini_entry = zend_hash_str_find_ptr (EG (ini_directives ),
116
- "opcache.max_accelerated_files" ,
117
- sizeof ("opcache.max_accelerated_files" )- 1 )) == NULL ) {
118
- return FAILURE ;
119
- }
120
- ini_entry -> value = zend_string_init_interned (new_new_value , strlen (new_new_value ), 1 );
86
+ if (size < MIN_ACCEL_FILES ) {
87
+ zend_accel_error (ACCEL_LOG_WARNING , "opcache.max_accelerated_files is set below the required minimum (%d).\n" , MIN_ACCEL_FILES );
88
+ return FAILURE ;
89
+ }
90
+ if (size > MAX_ACCEL_FILES ) {
91
+ zend_accel_error (ACCEL_LOG_WARNING , "opcache.max_accelerated_files is set above the limit (%d).\n" , MAX_ACCEL_FILES );
92
+ return FAILURE ;
121
93
}
122
94
* p = size ;
123
95
return SUCCESS ;
@@ -129,18 +101,8 @@ static ZEND_INI_MH(OnUpdateMaxWastedPercentage)
129
101
zend_long percentage = atoi (ZSTR_VAL (new_value ));
130
102
131
103
if (percentage <= 0 || percentage > 50 ) {
132
- const char * new_new_value = "5" ;
133
- zend_ini_entry * ini_entry ;
134
-
135
- percentage = 5 ;
136
104
zend_accel_error (ACCEL_LOG_WARNING , "opcache.max_wasted_percentage must be set between 1 and 50.\n" );
137
- zend_accel_error (ACCEL_LOG_WARNING , ACCELERATOR_PRODUCT_NAME " will use 5%%.\n" );
138
- if ((ini_entry = zend_hash_str_find_ptr (EG (ini_directives ),
139
- "opcache.max_wasted_percentage" ,
140
- sizeof ("opcache.max_wasted_percentage" )- 1 )) == NULL ) {
141
- return FAILURE ;
142
- }
143
- ini_entry -> value = zend_string_init_interned (new_new_value , strlen (new_new_value ), 1 );
105
+ return FAILURE ;
144
106
}
145
107
* p = (double )percentage / 100.0 ;
146
108
return SUCCESS ;
0 commit comments