本文整理汇总了PHP中DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb方法的具体用法?PHP DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb怎么用?PHP DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseCompatibilityUtil
的用法示例。
在下文中一共展示了DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetDatabaseMaxAllowedPacketsSizeRb
public function testGetDatabaseMaxAllowedPacketsSizeRb()
{
$maxAllowedPacketSize = DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb();
$this->assertGreaterThan(0, $maxAllowedPacketSize);
}
示例2: getMaxAllowedFileSize
/**
* Looks at the post_max_size, upload max size, and database max_allowed_packets
* @return integer of max allowed file size for uploads.
*/
public static function getMaxAllowedFileSize()
{
//todo: cache this information.
$actualPostLimitBytes = null;
static::checkPhpPostSizeSetting(1, $actualPostLimitBytes);
$actualUploadLimitBytes = null;
static::checkPhpUploadSizeSetting(1, $actualUploadLimitBytes);
$actualMaxAllowedBytes = DatabaseCompatibilityUtil::getDatabaseMaxAllowedPacketsSizeRb();
return min($actualPostLimitBytes, $actualUploadLimitBytes, $actualMaxAllowedBytes);
}