Example #1
0
 /**
  * @test
  * @expectedException \Neos\Utility\Exception\FilesException
  */
 public function sizeStringThrowsExceptionIfTheSpecifiedUnitIsUnknown()
 {
     Files::sizeStringToBytes('123 UnknownUnit');
 }
 /**
  * Returns the lowest configured maximum upload file size
  *
  * @return string
  */
 protected function renderMaximumFileUploadSize()
 {
     $maximumFileUploadSizeInBytes = min(Files::sizeStringToBytes(ini_get('post_max_size')), Files::sizeStringToBytes(ini_get('upload_max_filesize')));
     return sprintf('"%d"; // %s, as configured in php.ini', $maximumFileUploadSizeInBytes, Files::bytesToSizeString($maximumFileUploadSizeInBytes));
 }
 /**
  * Returns the lowest configured maximum upload file size
  *
  * @return integer
  */
 protected function maximumFileUploadSize()
 {
     return min(Files::sizeStringToBytes(ini_get('post_max_size')), Files::sizeStringToBytes(ini_get('upload_max_filesize')));
 }