public function reservation() { if ($this->id == 0) { return; } $precs = array(); try { $precs = $this->getPrograms(); } catch (Exception $e) { throw $e; } if (count($precs) < 300) { // 一気に録画予約 foreach ($precs as $rec) { try { if ($rec->autorec) { Reservation::simple($rec->id, $this->id, $this->autorec_mode); usleep(100); // あんまり時間を空けないのもどう? } } catch (Exception $e) { // 無視 } } } else { throw new Exception("300件以上の自動録画は実行できません"); } }
<?php include_once 'config.php'; include_once INSTALL_PATH . "/DBRecord.class.php"; include_once INSTALL_PATH . "/Reservation.class.php"; include_once INSTALL_PATH . "/reclib.php"; include_once INSTALL_PATH . "/Settings.class.php"; if (!isset($_GET['program_id'])) { exit("Error: 番組が指定されていません"); } $program_id = $_GET['program_id']; $settings = Settings::factory(); try { Reservation::simple($program_id, 0, $settings->autorec_mode); } catch (Exception $e) { exit("Error:" . $e->getMessage()); }