This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('memory_limit', '8G'); | |
$raw = file_get_contents('lib.tar'); | |
$length = strlen($raw); | |
echo "Loaded file " . $length . " bytes\n"; | |
$chunks = []; | |
for ($i = 0; $i < $length - 100*1024; $i += 100*1024) { | |
$chunks[] = substr($raw, $i, 100*1024); | |
} | |
echo "Created " . count($chunks) . " 100KB chunks\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This file is part of Moodle - http://moodle.org/ | |
// | |
// Moodle is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or | |
// (at your option) any later version. | |
// | |
// Moodle is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class move_to_recycle_bin extends scheduled_task { | |
/** @var string For unit testing only */ | |
protected $testmtracebuffer = ''; | |
/** | |
* Outputs a line of text to the cron log. | |
* | |
* @param string $line Line of text | |
*/ |