@@ -1332,6 +1332,8 @@ public static function init_internals($allow_cronjobs = true)
1332
1332
if ($ init_made )
1333
1333
return ;
1334
1334
ini_set ('memory_limit ' , '256M ' );
1335
+ # The memory limit is - among other - crucial for the maximum size
1336
+ # of processable images; see services/logs/images/add.php: max_pixels()
1335
1337
Db::connect ();
1336
1338
if (Settings::get ('TIMEZONE ' ) !== null )
1337
1339
date_default_timezone_set (Settings::get ('TIMEZONE ' ));
@@ -1902,6 +1904,28 @@ public static function fix_oc_html($html)
1902
1904
1903
1905
return $ html ;
1904
1906
}
1907
+
1908
+ function php_ini_get_bytes ($ variable )
1909
+ {
1910
+ $ value = trim (ini_get ($ variable ));
1911
+ if (!preg_match ("/^[0-9]+[KM]?$/ " , $ value ))
1912
+ throw new Exception ("Unexpected PHP setting: " .$ variable . " = " .$ value );
1913
+ $ value = str_replace ('K ' , '*1024 ' , $ value );
1914
+ $ value = str_replace ('M ' , '*1024*1024 ' , $ value );
1915
+ $ value = eval ('return ' .$ value .'; ' );
1916
+ return $ value ;
1917
+ }
1918
+
1919
+ # object types in table okapi_submitted_objects
1920
+ const OBJECT_TYPE_CACHE = 1 ;
1921
+ const OBJECT_TYPE_CACHE_DESCRIPTION = 2 ;
1922
+ const OBJECT_TYPE_CACHE_IMAGE = 3 ;
1923
+ const OBJECT_TYPE_CACHE_MP3 = 4 ;
1924
+ const OBJECT_TYPE_CACHE_LOG = 5 ; # implemented
1925
+ const OBJECT_TYPE_CACHE_LOG_IMAGE = 6 ; # implemented
1926
+ const OBJECT_TYPE_CACHELIST = 7 ;
1927
+ const OBJECT_TYPE_EMAIL = 8 ;
1928
+ const OBJECT_TYPE_CACHE_REPORT = 9 ;
1905
1929
}
1906
1930
1907
1931
/** A data caching layer. For slow SQL queries etc. */
0 commit comments