本文整理汇总了PHP中Toolbox::return_bytes_from_ini_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbox::return_bytes_from_ini_vars方法的具体用法?PHP Toolbox::return_bytes_from_ini_vars怎么用?PHP Toolbox::return_bytes_from_ini_vars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toolbox
的用法示例。
在下文中一共展示了Toolbox::return_bytes_from_ini_vars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: file
if ($resource->canCreate() && $_POST['plugin_resources_choiceitems_id'] > 0 && $_POST['plugin_resources_resources_id'] > 0) {
$choice->addHelpdeskItem($_POST);
}
$choice->wizardFourForm($_POST["plugin_resources_resources_id"]);
} else {
if (isset($_POST["deletechoice"])) {
if ($resource->canCreate()) {
$choice->delete(array('id' => $_POST["id"]));
}
$choice->wizardFourForm($_POST["plugin_resources_resources_id"]);
//next step : email and finish resource creation
} else {
if (isset($_POST["upload_five_step"])) {
if (isset($_FILES) && isset($_FILES['picture'])) {
if ($_FILES['picture']['type'] == "image/jpeg" || $_FILES['picture']['type'] == "image/pjpeg") {
$max_size = Toolbox::return_bytes_from_ini_vars(ini_get("upload_max_filesize"));
if ($_FILES['picture']['size'] <= $max_size) {
$resource->getFromDB($_POST["plugin_resources_resources_id"]);
$_POST['picture'] = $resource->addPhoto($resource);
$_POST["id"] = $_POST["plugin_resources_resources_id"];
$resource->update($_POST);
$newID = $_POST["id"];
} else {
echo "<div align='center'><b><span class='plugin_resources_date_over_color'>" . __('Failed to send the file (probably too large)') . "</span></b></div><br \\>";
}
} else {
echo "<div align='center'><b><span class='plugin_resources_date_over_color'>" . __('Invalid filename') . " : " . $_FILES['picture']['type'] . "</span></b></div><br \\>";
}
}
$values = array();
$values['target'] = Toolbox::getItemTypeFormURL('PluginResourcesWizard');
示例2: getMaxUploadSize
/**
* Get max upload size from php config
**/
static function getMaxUploadSize()
{
$max_size = Toolbox::return_bytes_from_ini_vars(ini_get("upload_max_filesize"));
$max_size /= 1024 * 1024;
//TRANS: %s is a size
return sprintf(__('%s Mio max'), round($max_size, 1));
}
示例3: prepareInputForUpdate
function prepareInputForUpdate($input)
{
if (isset($input['date_begin']) && empty($input['date_begin'])) {
$input['date_begin'] = 'NULL';
}
if (isset($input['date_end']) && empty($input['date_end'])) {
$input['date_end'] = 'NULL';
}
//unset($input['picture']);
$this->getFromDB($input["id"]);
if (isset($_FILES) && isset($_FILES['picture']) && $_FILES['picture']['size'] > 0) {
if ($_FILES['picture']['type'] == "image/jpeg" || $_FILES['picture']['type'] == "image/pjpeg") {
$max_size = Toolbox::return_bytes_from_ini_vars(ini_get("upload_max_filesize"));
if ($_FILES['picture']['size'] <= $max_size) {
$input['picture'] = $this->addPhoto($this);
} else {
Session::addMessageAfterRedirect(__('Failed to send the file (probably too large)'), false, ERROR);
}
} else {
Session::addMessageAfterRedirect(__('Invalid filename') . " : " . $_FILES['picture']['type'], false, ERROR);
}
}
$input["_old_name"] = $this->fields["name"];
$input["_old_firstname"] = $this->fields["firstname"];
$input["_old_plugin_resources_contracttypes_id"] = $this->fields["plugin_resources_contracttypes_id"];
$input["_old_users_id"] = $this->fields["users_id"];
$input["_old_users_id_recipient"] = $this->fields["users_id_recipient"];
$input["_old_date_declaration"] = $this->fields["date_declaration"];
$input["_old_date_begin"] = $this->fields["date_begin"];
$input["_old_date_end"] = $this->fields["date_end"];
$input["_old_quota"] = $this->fields["quota"];
$input["_old_plugin_resources_departments_id"] = $this->fields["plugin_resources_departments_id"];
$input["_old_plugin_resources_resourcestates_id"] = $this->fields["plugin_resources_resourcestates_id"];
$input["_old_plugin_resources_resourcesituations_id"] = $this->fields["plugin_resources_resourcesituations_id"];
$input["_old_plugin_resources_contractnatures_id"] = $this->fields["plugin_resources_contractnatures_id"];
$input["_old_plugin_resources_ranks_id"] = $this->fields["plugin_resources_ranks_id"];
$input["_old_plugin_resources_resourcespecialities_id"] = $this->fields["plugin_resources_resourcespecialities_id"];
$input["_old_locations_id"] = $this->fields["locations_id"];
$input["_old_is_leaving"] = $this->fields["is_leaving"];
$input["_old_plugin_resources_leavingreasons_id"] = $this->fields["plugin_resources_leavingreasons_id"];
$input["_old_comment"] = $this->fields["comment"];
return $input;
}