1. Go to this page and download the library: Download anime-db/smart-sleep library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
anime-db / smart-sleep example snippets
use AnimeDb\SmartSleep\Rule\EverydayRule;
use AnimeDb\SmartSleep\Schedule;
$schedule = new Schedule([
new EverydayRule(0, 3, 260), // [00:00, 03:00)
new EverydayRule(3, 9, 900), // [03:00, 09:00)
new EverydayRule(9, 19, 160), // [09:00, 19:00)
new EverydayRule(19, 23, 70), // [19:00, 23:00)
new EverydayRule(23, 24, 60), // [23:00, 24:00)
]);
use AnimeDb\SmartSleep\SmartSleep;
$smart = new SmartSleep($schedule);