本文整理汇总了PHP中Safe::get_cfg_var方法的典型用法代码示例。如果您正苦于以下问题:PHP Safe::get_cfg_var方法的具体用法?PHP Safe::get_cfg_var怎么用?PHP Safe::get_cfg_var使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Safe
的用法示例。
在下文中一共展示了Safe::get_cfg_var方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: str_replace
*
* Accept following invocations:
* - users/select_avatar.php/12
* - users/select_avatar.php?id=12
*
* @author Bernard Paques
* @author GnapZ
* @tester Kedare
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
include_once '../images/images.php';
// the maximum size for uploads
$image_maximum_size = str_replace('M', '000000', Safe::get_cfg_var('upload_max_filesize'));
if (!$image_maximum_size || $image_maximum_size > 20000000) {
$image_maximum_size = 2000000;
}
// look for the id
$id = NULL;
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
} elseif (isset($context['arguments'][0])) {
$id = $context['arguments'][0];
} elseif (Surfer::is_logged()) {
$id = Surfer::get_id();
}
$id = strip_tags($id);
// get the item from the database
$item = Users::get($id);
示例2: str_replace
}
// create the record in the database
if (!($fields['id'] = Files::post($fields))) {
return FALSE;
}
// record surfer activity
Activities::post('file:' . $fields['id'], 'upload');
}
}
// so far so good
if (count($context['uploaded_files']) == 1) {
return $context['uploaded_files'][0];
} else {
return $context['uploaded_files'];
}
}
}
// some error has occured
return FALSE;
}
}
// load localized strings
if (is_callable(array('i18n', 'bind'))) {
i18n::bind('files');
}
// the maximum size for uploads
global $context;
$context['file_maximum_size'] = str_replace('M', ' M', Safe::get_cfg_var('upload_max_filesize'));
if (!$context['file_maximum_size']) {
$context['file_maximum_size'] = '2 M';
}