Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/startup.php
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | |||||
define('GW_CLASS_PATH', MODULES_PATH . '/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path | define('GW_CLASS_PATH', MODULES_PATH . '/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path | ||||
define('SYNC_CLASS_PATH', FULL_PATH . '/sync'); // path for 3rd party user syncronization scripts | define('SYNC_CLASS_PATH', FULL_PATH . '/sync'); // path for 3rd party user syncronization scripts | ||||
define('ENV_VAR_NAME','env'); | define('ENV_VAR_NAME','env'); | ||||
define('IMAGES_PATH', WRITEBALE_BASE . '/images/'); | define('IMAGES_PATH', WRITEBALE_BASE . '/images/'); | ||||
define('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/'); | define('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/'); | ||||
define('MAX_UPLOAD_SIZE', min(ini_get('upload_max_filesize'), ini_get('post_max_size'))*1024*1024); | |||||
$upload_limit = kUtil::parseIniSize(ini_get('upload_max_filesize')); | |||||
$post_max_size = ini_get('post_max_size'); | |||||
$upload_limit = $post_max_size !== '0' ? min($upload_limit, kUtil::parseIniSize($post_max_size)) : $upload_limit; | |||||
alex: Please replace `$post_max_size !== '0'` with `(string)$post_max_size !== '0'`.
---
I'm not… | |||||
$memory_limit = ini_get('memory_limit'); | |||||
$upload_limit = $memory_limit !== '-1' ? min($upload_limit, kUtil::parseIniSize($memory_limit)) : $upload_limit; | |||||
alexUnsubmitted Not Done ReplyPlease replace $memory_limit !== '-1' with (string)$memory_limit !== '-1'. I'm not sure if ini_get is doing any automatic type casting or not. alex: Please replace `$memory_limit !== '-1'` with `(string)$memory_limit !== '-1'`.
---
I'm not… | |||||
define('MAX_UPLOAD_SIZE', $upload_limit); | |||||
alexUnsubmitted Not Done ReplyPlease wrap all that in self-invoking anonymous function (aka closure). All these temp variables used to calculate constant value pollute global scope. alex: Please wrap all that in self-invoking anonymous function (aka closure).
---
All these temp… | |||||
define('EDITOR_PATH', $vars['EditorPath']); | define('EDITOR_PATH', $vars['EditorPath']); | ||||
// caching types | // caching types | ||||
define('CACHING_TYPE_NONE', 0); | define('CACHING_TYPE_NONE', 0); | ||||
define('CACHING_TYPE_MEMORY', 1); | define('CACHING_TYPE_MEMORY', 1); | ||||
define('CACHING_TYPE_TEMPORARY', 2); | define('CACHING_TYPE_TEMPORARY', 2); | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |
Please replace $post_max_size !== '0' with (string)$post_max_size !== '0'.
I'm not sure if ini_get is doing any automatic type casting or not.