Skip to content

Commit 93cfc2d

Browse files
committed
Merge pull request #392 from opencaching/feature/logimages
Added new methods for handling log entry images
2 parents b49bf61 + 42afe1d commit 93cfc2d

File tree

16 files changed

+1280
-81
lines changed

16 files changed

+1280
-81
lines changed

okapi/core.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,8 @@ public static function init_internals($allow_cronjobs = true)
13321332
if ($init_made)
13331333
return;
13341334
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()
13351337
Db::connect();
13361338
if (Settings::get('TIMEZONE') !== null)
13371339
date_default_timezone_set(Settings::get('TIMEZONE'));
@@ -1902,6 +1904,28 @@ public static function fix_oc_html($html)
19021904

19031905
return $html;
19041906
}
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;
19051929
}
19061930

19071931
/** A data caching layer. For slow SQL queries etc. */
767 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)