mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-24 15:25:28 -04:00
PHP < 5.6 compatibility and StyleCI recommendations
This commit is contained in:
parent
4f06feef81
commit
9f26894b2e
6 changed files with 24 additions and 25 deletions
|
@ -134,15 +134,15 @@ class FilesystemTest extends PHPUnit_Framework_TestCase
|
|||
public function testOldFilesGetConverted()
|
||||
{
|
||||
// generate 10 (default purge batch size) pastes in the old format
|
||||
$paste = Helper::getPaste();
|
||||
$comment = Helper::getComment();
|
||||
$paste = Helper::getPaste();
|
||||
$comment = Helper::getComment();
|
||||
$commentid = Helper::getCommentId();
|
||||
$ids = array();
|
||||
$ids = array();
|
||||
for ($i = 0, $max = 10; $i < $max; ++$i) {
|
||||
// PHPs mt_rand only supports 32 bit or up 0x7fffffff on 64 bit systems to be precise :-/
|
||||
$dataid = str_pad(dechex(mt_rand(0, mt_getrandmax())), 8, '0', STR_PAD_LEFT) .
|
||||
str_pad(dechex(mt_rand(0, mt_getrandmax())), 8, '0', STR_PAD_LEFT);
|
||||
$storagedir = $this->_path . DIRECTORY_SEPARATOR . substr($dataid, 0, 2) .
|
||||
$storagedir = $this->_path . DIRECTORY_SEPARATOR . substr($dataid, 0, 2) .
|
||||
DIRECTORY_SEPARATOR . substr($dataid, 2, 2) . DIRECTORY_SEPARATOR;
|
||||
$ids[$dataid] = $storagedir;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue