2016-01-10 11:01:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class main_requestGenPlanets {
|
|
|
|
|
2024-12-31 00:25:05 +01:00
|
|
|
public function __construct($lib) {
|
2016-01-10 11:01:49 +01:00
|
|
|
$this->lib = $lib;
|
|
|
|
$this->db = $this->lib->game->db;
|
|
|
|
}
|
|
|
|
|
|
|
|
function run($first, $amount) {
|
|
|
|
$dir = config::getParam('pgenreq');
|
|
|
|
$game = $this->lib->game->name;
|
|
|
|
if (!is_dir($dir)) {
|
|
|
|
$base = dirname($dir);
|
|
|
|
if (!(is_dir($base) && is_writable($base) && @mkdir($dir))) {
|
|
|
|
logText("main::requestGenPlanets($game,$first,$amount): unable to create directory '$dir'", LOG_WARNING);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$r = @touch("$dir/req-$game-$first-$amount");
|
|
|
|
if (!$r) {
|
|
|
|
logText("main::requestGenPlanets($game,$first,$amount): unable to create file 'req-$game-$first-$amount'", LOG_WARNING);
|
|
|
|
}
|
|
|
|
return $r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|