diff --git a/pfosten/app/Http/Controllers/GamesController.php b/pfosten/app/Http/Controllers/GamesController.php index 90ffd97c..9f6b3ac0 100644 --- a/pfosten/app/Http/Controllers/GamesController.php +++ b/pfosten/app/Http/Controllers/GamesController.php @@ -9,7 +9,7 @@ use Carbon\Carbon; use Auth; use App\User; use Log; - +use App\MyClasses\TimeLogger; class GamesController extends Controller { @@ -23,8 +23,11 @@ class GamesController extends Controller public function store() { if (Auth::guest()) { return redirect("/login"); } - // Validate form + $a=new TimeLogger("GamesController::store"); + Log::info($a->getStartMessage()); + + // Validate form Log::info("Starting validation"); $this->validate(request(), [ 'id' => 'required', @@ -60,6 +63,8 @@ class GamesController extends Controller $game->kickoff=User::toDBDate(request('kickoff')); $game->save(); + Log::info($a->getEndMessage()); + // Redirect to the Rounds Index return redirect('/rounds#'.$game->round_id); } diff --git a/pfosten/app/Http/Controllers/Leagues/LeaguesController.php b/pfosten/app/Http/Controllers/Leagues/LeaguesController.php index f787f2c9..e83ce67c 100644 --- a/pfosten/app/Http/Controllers/Leagues/LeaguesController.php +++ b/pfosten/app/Http/Controllers/Leagues/LeaguesController.php @@ -20,9 +20,14 @@ use App\Leagues\Match; use Log; use DB; +use App\MyClasses\TimeLogger; + class LeaguesController extends Controller { public function index() { + $a=new TimeLogger("LeaguesController.index"); + Log::info($a->getStartMessage()); + $season=Season::getCurrent(); if (Auth::guest()) { return redirect("/"); } @@ -62,14 +67,18 @@ class LeaguesController extends Controller // + Log::info($a->getEndMessage()); + return view('leagues.index', compact('season','rounds','start_round_id','start_round_name','league_mode','round_count')); } public function createLeagues($start_round_id, $round_count) { - + $a=new TimeLogger("LeaguesController::createLeagues()"); + Log::info($a->getStartMessage()); $users=User::getActives(); if (sizeof($users)==0){ + Log::info($a->getEndMessage()); return view("leagues.no_users"); } @@ -79,12 +88,16 @@ class LeaguesController extends Controller Match::createMatchups(); + Log::info($a->getEndMessage()); return redirect("/seasons"); } public function showLeagueRounds() { if (Auth::guest()) { return redirect("/"); } + $a=new TimeLogger("LeaguesController::showLeagueRounds()"); + Log::info($a->getStartMessage()); + $season=Season::getCurrent(); $roundNames = Round::getNames(); @@ -106,18 +119,26 @@ class LeaguesController extends Controller $matchesTotal[$match->round_id][$league->id] = $lg; } } + Log::info($a->getEndMessage()); return view ('leagues.matches', compact('season', 'matchesTotal','leagues','leagueNames','roundNames')); } public static function showLeagueRanking() { + + $a=new TimeLogger("LeaguesController::showLeagueRanking()"); + Log::info($a->getStartMessage()); + $season = Season::getCurrent(); //$leagues = array_reverse(League::getRanking($rank)); $leagueNames = League::getNames(); $userNames = User::getNames(); $leagues = League::where('season_id','=',$season->id)->where('rank','<=', 4)->orderBy('id')->get(); - if (!sizeof($leagues)) return redirect("/"); + if (!sizeof($leagues)) { + Log::info($a->getEndMessage()); + return redirect("/"); + } $totalRanking = League::getTotalRankingOverall(); // Nur für Auf/Abstiegsinfo benötigt. $rankInfo=array(); @@ -138,6 +159,9 @@ class LeaguesController extends Controller $leagueScores[$rank] = League::getRanking($rank); } + Log::info($a->getEndMessage()); + //error_log($a->getEndMessage()); + return view ('leagues.chart',compact('season', 'leagueNames', 'userNames','leagueScores','rankInfo','rank','cols')); } diff --git a/pfosten/app/Http/Controllers/RoundmailController.php b/pfosten/app/Http/Controllers/RoundmailController.php index 4e66b231..c4183141 100644 --- a/pfosten/app/Http/Controllers/RoundmailController.php +++ b/pfosten/app/Http/Controllers/RoundmailController.php @@ -13,6 +13,7 @@ use Auth; use DB; use Log; use Carbon; +use App\MyClasses\TimeLogger; class RoundmailController extends Controller { @@ -22,6 +23,9 @@ class RoundmailController extends Controller if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } + $a=new TimeLogger("RoundmailController::index()"); + Log::info($a->getStartMessage()); + $mails_db = Roundmail::all(); $mails=array(); foreach($mails_db as $mail_db) { @@ -39,6 +43,8 @@ class RoundmailController extends Controller } $mails=array_reverse($mails); + Log::info($a->getEndMessage()); + return view('roundmails.index',compact('mails')); } @@ -46,6 +52,9 @@ class RoundmailController extends Controller if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } + $a=new TimeLogger("RoundmailController::show start"); + Log::info($a->getStartMessage()); + $user_id=Auth::user()->id; $users = DB::table('users')->where('deleted',null)->orderBy('lastname')->get(); @@ -124,6 +133,8 @@ class RoundmailController extends Controller if ($sender) {$sender_name = $sender->name;} } + Log::info($a->getEndMessage()); + return view('roundmails.show',compact('mail_id','activeMailList','inactiveMailList','missingTippMailList','missingJokerMailList','adminMailList','send_date','user_id','topic', 'mail_message', 'recipients', 'sender_name','viewmode','tippSpielLink')); } diff --git a/pfosten/app/Http/Controllers/RoundsController.php b/pfosten/app/Http/Controllers/RoundsController.php index 5064469f..32ea1941 100644 --- a/pfosten/app/Http/Controllers/RoundsController.php +++ b/pfosten/app/Http/Controllers/RoundsController.php @@ -12,6 +12,7 @@ use App\Quota; use DB; use Auth; use Log; +use App\MyClasses\TimeLogger; class RoundsController extends Controller { @@ -19,6 +20,9 @@ class RoundsController extends Controller if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } + $a=new TimeLogger("RoundsController::index()"); + Log::info($a->getStartMessage()); + $activeSeason=Season::getCurrent(); $rounds =null; @@ -30,6 +34,8 @@ class RoundsController extends Controller $quotas = Quota::getQuotas(); $round_count = Round::getCount(); + Log::info($a->getEndMessage()); + return view('rounds.index', compact('rounds','activeSeason', 'round_count')); } @@ -51,6 +57,9 @@ class RoundsController extends Controller if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } + $a=new TimeLogger("RoundsController::store() start"); + Log::info($a->getStartMessage()); + // Validate form $this->validate(request(), [ 'name' => 'required', @@ -108,6 +117,8 @@ class RoundsController extends Controller Tipp::createAllTips(); + Log::info($a->getEndMessage()); + // Redirect to the home page return redirect('/rounds'); } @@ -116,6 +127,9 @@ class RoundsController extends Controller if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } + $a=new TimeLogger("RoundsController::store_report()"); + Log::info($a->getStartMessage()); + // Validate form $this->validate(request(), [ 'round_id' => 'required' @@ -133,6 +147,7 @@ class RoundsController extends Controller } $round->save(); + Log::info($a->getEndMessage()); // Redirect to the home page return redirect('/rounds'); @@ -150,6 +165,9 @@ class RoundsController extends Controller if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } + $a=new TimeLogger("RoundsController::storename()"); + Log::info($a->getStartMessage()); + // Validate form $this->validate(request(), [ 'round_id' => 'required', @@ -160,6 +178,8 @@ class RoundsController extends Controller $round->name = request('name'); $round->save(); + Log::info($a->getEndMessage()); + return redirect('/rounds'); } } diff --git a/pfosten/app/Http/Controllers/TippsController.php b/pfosten/app/Http/Controllers/TippsController.php index 95393068..7f60948b 100755 --- a/pfosten/app/Http/Controllers/TippsController.php +++ b/pfosten/app/Http/Controllers/TippsController.php @@ -13,12 +13,17 @@ use Auth; use Log; use DB; +use App\MyClasses\TimeLogger; class TippsController extends Controller { //Duplicate from Tipps model //TODO: Refactor usage to use only the Tipps version public static function createTipps($user_id) { + + $a=new TimeLogger("TippsController::createTipps()"); + Log::info($a->getStartMessage()); + $activeSeason = Season::getCurrent(); $rounds = Round::all()->where('season_id', '=', $activeSeason->id); @@ -44,15 +49,22 @@ class TippsController extends Controller } } } + + Log::info($a->getEndMessage()); + } //Duplicate from Tipps model //TODO: Refactor usage to use only the Tipps version public static function createAllTips(){ + $a=new TimeLogger("TippsController::createAllTipps()"); + Log::info($a->getStartMessage()); + $users = DB::table('users')->where('deleted',null)->get(); foreach($users as $user) { TippsController::createTipps($user->id); } + Log::info($a->getEndMessage()); } public function index() diff --git a/pfosten/app/Http/Controllers/UsersController.php b/pfosten/app/Http/Controllers/UsersController.php index ccb32d8e..f1b0a2d4 100755 --- a/pfosten/app/Http/Controllers/UsersController.php +++ b/pfosten/app/Http/Controllers/UsersController.php @@ -22,10 +22,15 @@ use Auth; use Log; use Carbon; +use App\MyClasses\TimeLogger; class UsersController extends Controller { public function main() { + $a=new TimeLogger("UsersController::main()"); + Log::info($a->getStartMessage()); + //error_log($a->getStartMessage()); + $currentSeason=Season::getCurrent(); $roundname=""; $report=""; @@ -90,15 +95,30 @@ class UsersController extends Controller } } + Log::info($a->getEndMessage()); + //error_log($a->getEndMessage()); + return view('main',compact('roundname','display_rounds','message_text_joker','message_text_tipps','nextRoundName','nextRoundLockTime', 'hourDiffToLock')); } + + + + + public function index() { + $a=new TimeLogger("UserController::index()"); + Log::info($a->getStartMessage()); + //error_log($a->getStartMessage()); + if (Auth::guest()) { return redirect("/"); } if (!Auth::user()->admin) { return redirect("/"); } $activeUsers = User::getActives(); + $b=new TimeLogger("UsersController::index-db_subqueries"); + Log::info($b->getStartMessage()); + $currentSeason=Season::getCurrent(); if (!$currentSeason) { return redirect('/'); } @@ -107,28 +127,45 @@ class UsersController extends Controller $users = DB::table('users')->where('deleted',null)->orderBy('lastname')->get(); - foreach($users as $key => $user) { - if (User::hasMissingTipp($user->id)) { - $users[$key]->missingTippText="Tipps fehlen"; - $users[$key]->tippStyling="red"; + Log::info($b->getEndMessage()); + + + Log::info($a->getStartMessage()); + $missingTipps = User::getMissingTippsAndJokers($users); + + $c=new TimeLogger("UsersController::index-missingTipp Loop"); + Log::info($c->getStartMessage()); + + + foreach($users as $user_id => $user) { + if (array_key_exists($user_id, $missingTipps["MISSING_TIPP"])) { + $users[$user_id]->missingTippText = "Tipps fehlen"; + $users[$user_id]->tippStyling = "red"; } else { - $users[$key]->missingTippText="Runde getippt"; - $users[$key]->tippStyling="green"; + $users[$user_id]->missingTippText = "Runde getippt"; + $users[$user_id]->tippStyling = "green"; } - if (User::hasMissingJoker($user->id)) { - $users[$key]->missingJokerText="Joker fehlt"; - $users[$key]->jokerStyling="red"; + + + if (array_key_exists($user_id, $missingTipps["MISSING_JOKER"])) { + $users[$user_id]->missingJokerText = "Joker fehlt"; + $users[$user_id]->jokerStyling = "red"; } else { - $users[$key]->missingJokerText="Joker gesetzt"; - $users[$key]->jokerStyling="green"; + $users[$user_id]->missingJokerText = "Joker gesetzt"; + $users[$user_id]->jokerStyling = "green"; } } + Log::info($c->getEndMessage()); + $round = Round::getFirstTippableRound(); $firstTippableRound=new Round(); $firstTippableRound->name="-"; if ($round) { $firstTippableRound = $round; } + Log::info($a->getEndMessage()); + //error_log($a->getEndMessage()); + return view('users.index', compact('users','active_user_count','total_user_count', 'firstTippableRound')); } /* @@ -160,6 +197,11 @@ class UsersController extends Controller public function store() { if (Auth::guest()) { return redirect("/"); } + + $a=new TimeLogger("UsersController::store()"); + Log::info($a->getStartMessage()); + //error_log($a->getStartMessage()); + $season_id = Season::getCurrent()->id; // Validate form $this->validate(request(), [ @@ -194,6 +236,9 @@ class UsersController extends Controller Tipp::createAllTips(); + Log::info($a->getEndMessage()); + //error_log($a->getEndMessage()); + return redirect('/users'); } @@ -657,28 +702,28 @@ class UsersController extends Controller - public function gshirt_ranking() { - if (Auth::guest()) { return redirect("/"); } + public function gshirt_ranking() { + if (Auth::guest()) { return redirect("/"); } - // Check ob mindestens eine Runde der Saison gelockt ist und angezeigt werden kann + // Check ob mindestens eine Runde der Saison gelockt ist und angezeigt werden kann - $season=Season::getCurrent(); - $seasonId=$season->id; + $season=Season::getCurrent(); + $seasonId=$season->id; - $max_round_id = Round::getLastCompleteRoundId(); - if ($max_round_id==-1) { + $max_round_id = Round::getLastCompleteRoundId(); + if ($max_round_id==-1) { - $sql="select DATE_FORMAT(date_sub(min(games.kickoff), interval 1 hour),'%d.%m.%Y %H:%i') as start_date from rounds,games where rounds.season_id=".$seasonId." and games.round_id=rounds.id order by rounds.id;"; - //dd($sql); - $entries = DB::select($sql); + $sql="select DATE_FORMAT(date_sub(min(games.kickoff), interval 1 hour),'%d.%m.%Y %H:%i') as start_date from rounds,games where rounds.season_id=".$seasonId." and games.round_id=rounds.id order by rounds.id;"; + //dd($sql); + $entries = DB::select($sql); - if (count($entries)>0) { - $start_date = $entries[0]->start_date; - return view('users.no_ranking', compact('start_date')); - } else { - return redirect("/"); - } + if (count($entries)>0) { + $start_date = $entries[0]->start_date; + return view('users.no_ranking', compact('start_date')); + } else { + return redirect("/"); } + } diff --git a/pfosten/app/MyClasses/TimeLogger.php b/pfosten/app/MyClasses/TimeLogger.php deleted file mode 100644 index 86b9bbf7..00000000 --- a/pfosten/app/MyClasses/TimeLogger.php +++ /dev/null @@ -1,23 +0,0 @@ -startTime = microtime(true); - $this->functionName =$_functionName; - $this->pkey="".rand(1000,9999); - } - - public function getStartMessage() { - return "[CLOCK] [".$this->pkey."-".$this->functionName."] [started]"; - } - - public function getEndMessage() { - return "[CLOCK] [".$this->pkey."-". $this->functionName."] [ended] [elapsed: ".number_format( ( microtime(true) - $this->startTime), 4)."]"; - } -} \ No newline at end of file diff --git a/pfosten/app/MyClasses/TimeLogger/TimeLogger.php b/pfosten/app/MyClasses/TimeLogger/TimeLogger.php new file mode 100644 index 00000000..a86e47f1 --- /dev/null +++ b/pfosten/app/MyClasses/TimeLogger/TimeLogger.php @@ -0,0 +1,44 @@ +getStartMessage()); + +--END OF METHOD +Log::info($a->getEndMessage()); +*/ + +class TimeLogger +{ + public $startTime; + public $pkey; + public $functionName; + + public function __construct($_functionName) { + $this->startTime = microtime(true); + $this->functionName =$_functionName; + $this->pkey="".rand(1000,9999); + } + + public function getStartMessage() { + return "[CLOCK] [".$this->pkey."-".$this->functionName."] [started]"; + } + + public function getEndMessage() { + $time= ( microtime(true) - $this->startTime); + $timestr=number_format( $time, 4); + + $retval="[CLOCK] [".$this->pkey."-". $this->functionName."] [ended] [elapsed: ".$timestr."]"; + if ($time > 1.5) { + $retval=$retval." [PERFORMANCE_WARNING]"; + } + + return $retval; + } +} \ No newline at end of file diff --git a/pfosten/app/Round.php b/pfosten/app/Round.php index 6bb52718..35439ec3 100755 --- a/pfosten/app/Round.php +++ b/pfosten/app/Round.php @@ -9,6 +9,7 @@ use App\Season; use Log; use DB; use Carbon; +use App\MyClasses\TimeLogger; class Round extends Model { @@ -127,22 +128,28 @@ class Round extends Model } public static function getFirstTippableRound($seasonId=-1) { + $season=null; if ($seasonId==-1) { $season=Season::getCurrent(); } else { $season=Season::where('id','=', $seasonId)->first(); } - if (!$season) return null; + if (!$season) { + return null; + } $rounds=Round::where('season_id','=',$season->id)->orderBy('id')->get(); $locked = false; foreach ($rounds as $round) { - if (!Round::hasLockedGame($round->id) ) { + if (!Round::hasLockedGame($round->id)) { return $round; } } + + + return null; } diff --git a/pfosten/app/Tipp.php b/pfosten/app/Tipp.php index d3a42d7a..b16446e4 100755 --- a/pfosten/app/Tipp.php +++ b/pfosten/app/Tipp.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Model; use DB; use Carbon; use Log; +use App\MyClasses\TimeLogger; class Tipp extends Model { @@ -177,6 +178,10 @@ class Tipp extends Model } public static function createTipps($user_id) { + + $a=new TimeLogger("Tipp::createTipps()"); + Log::info($a->getStartMessage()); + $activeSeason = Season::getCurrent(); $rounds = Round::all()->where('season_id', '=', $activeSeason->id); @@ -202,14 +207,21 @@ class Tipp extends Model } } } + + Log::info($a->getEndMessage()); + } public static function createAllTips() { + $a=new TimeLogger("Tipp::createAllTipps()"); + Log::info($a->getStartMessage()); + $users = DB::table('users')->where('deleted',null)->get(); foreach($users as $user) { Log::info("Creating tipps for userid ".$user->id); Tipp::createTipps($user->id); } + Log::info($a->getEndMessage()); } @@ -247,6 +259,9 @@ class Tipp extends Model // TODO: Implement partial caching public static function getRoundTipps($max_round_id=-1, $seasonId=-1) { + $a=new TimeLogger("getRoundTipps max_round_id=".$max_round_id.", seasonId=".$seasonId); + Log::info($a->getStartMessage()); + $startTime = microtime(true); $currentSeason = Season::getCurrent(); @@ -353,6 +368,7 @@ class Tipp extends Model ///////////////////////////////////////////////////////////////////// // CALCULATION OF SCORES, RANKS, ETC. (COMPUTE AGGREGATED VALUES) EXCEPT GREENSHIRT, ARGH !! ///////////////////////////////////////////////////////////////////// + $highestDayscores = array(); foreach ($user_ids as $user_id) { $totalRankScore = 0; @@ -383,6 +399,7 @@ class Tipp extends Model } } + //////////////////////////////////////////////////////// // Sortier-Array nach Rang (nur für max_round_id) $userRankings = array(); @@ -509,6 +526,7 @@ class Tipp extends Model // B) SET GSCORE TOTAL EVERY ROUND ( and take fouls into consideration ) $maxScorePerRound=array(); + foreach($user_ids as $user_id) { $foulCount=0; $totalScore=0; @@ -558,7 +576,6 @@ class Tipp extends Model //dd("User 11 Round 1 gshirt_score =".$roundtipps['1_11']['gshirt_score'].", totalscore=".$roundtipps['1_11']['gshirt_totalscore']); - ////////////////////////////// // START OF HURTFUL 6 PLACE RESTRICTION IF DAYSCORE WIN (exception: completely even scores) // If more than 6 DayScoreWinners: Restrict by dayscore (rank) @@ -642,9 +659,11 @@ class Tipp extends Model } } } - ///// END OF HURTFUL 6 PLACE RESTRICTION + + /// CALCULATE RANK AND PAYOUT QUOTAS + $quotas=Quota::getQuotas(); error_log("Round-Count=".$round_count); @@ -687,7 +706,6 @@ class Tipp extends Model } } } - //////////////////// END OF ROUNDTIPPS CREATION /////////////////// $response = array(); @@ -698,6 +716,8 @@ class Tipp extends Model Log::info("Tipp::getRoundTipps: ExecutionTime: " . number_format(( microtime(true) - $startTime), 4) . " Seconds\n"); + Log::info($a->getEndMessage()); + return $response; } @@ -722,6 +742,9 @@ class Tipp extends Model } public static function gshirt_table() { + $a=new TimeLogger("Tipp::gshirt_table()"); + Log::info($a->getStartMessage()); + $rt = Tipp::getRoundTipps(); $roundtipps = $rt['roundtipps']; $round_ids = $rt['round_ids']; @@ -760,6 +783,8 @@ class Tipp extends Model array_push($rankingDisplay2,$rankingDisplay[$user_id]); } + Log::info($a->getEndMessage()); + return $rankingDisplay2; } diff --git a/pfosten/app/User.php b/pfosten/app/User.php index e9c0aff1..9f6ecb9a 100644 --- a/pfosten/app/User.php +++ b/pfosten/app/User.php @@ -12,6 +12,7 @@ use App\Game; use Carbon; use Log; use DB; +use App\MyClasses\TimeLogger; class User extends Authenticatable { @@ -138,10 +139,77 @@ class User extends Authenticatable return $dbDate; } - public static function hasMissingTipp($user_id) { + // TODO: implement hasMissingTipps($user_array) + // OPTIMIZED VERSION FOR hasMissingTipp + public static function getMissingTippsAndJokers($users) { $round = Round::getFirstTippableRound(); if (!$round) return false; + $tippClock=new TimeLogger("User::getMissingTippsAndJokers()"); + Log::info($tippClock->getStartMessage()); + // expecting collection of user db objects like: $users = DB::table('users')->where('deleted',null)->orderBy('lastname')->get(); + $idlist = array(); + $usersWithoutJoker=array(); + foreach($users as $key => $user) { + array_push($idlist,$key); + array_push($usersWithoutJoker,$key); + } + + $games = Game::where('round_id','=',$round->id)->get(); + $gameIds=array(); + foreach ($games as $key => $game) { + array_push($gameIds,$key); + Log::info("GAME_ID:".$key); + } + + $tipps = Tipp::whereIn('game_id', $gameIds)->get(); + Log::info("Fetched advanced tipps, checking now for missing tipps and jokers"); + + $usersWithoutTipps=array(); + foreach($tipps as $tipp) { + if ($tipp->score1 == -1 || $tipp->score2 == -1) { + $usersWithoutTipps[$tipp->user_id]="no_tipp"; + Log::info("UserId ".$tipp->user_id." is missing a tipp!"); + } + if ($tipp->joker == true) { + Log::info("Removing from jokerlist: ".$tipp->user_id); + unset($usersWithoutJoker[$tipp->user_id]); + } + } + + foreach ($usersWithoutJoker as $id) { + Log::info("Jokerless:".$id); + } + + $result=array(); + $result["MISSING_TIPP"]=$usersWithoutTipps; + $result["MISSING_JOKER"]=$usersWithoutJoker; + + Log::info("USERLIST: ".implode(",",$idlist)); + Log::info($tippClock->getEndMessage()); + + + foreach(array_keys($result) as $key => $value) { + Log::info("Main key: ".$key.", value=".$value); + } + + $mtipps=$result["MISSING_TIPP"]; + foreach($mtipps as $key => $value) { + Log::info("MTipp: ".$key." => ".$value); + } + + + return $result; + } + + public static function hasMissingTipp($user_id) { + + $round = Round::getFirstTippableRound(); + if (!$round) return false; + + //$a=new TimeLogger("User::hasMissingTipp()"); + //Log::info($a->getStartMessage()); + $round_id = $round->id; $games = Game::where('round_id','=',$round_id)->get(); @@ -151,14 +219,18 @@ class User extends Authenticatable if(!$tipp) { Log::info("Tipp doesnt exist: game_id=".$game->id.", user_id=".$user_id); + //Log::info($a->getEndMessage()); return 1; } if ($tipp->score1 == -1 || $tipp->score2 == -1) { - //Log::info("!!! User ".$user_id." has a missing tipp for game_id ".$game->id.", round = ".$round_id); + //Log::info($a->getEndMessage()); return 1; } } + + //Log::info($a->getEndMessage()); + return 0; } diff --git a/pfosten/app/leagues/League.php b/pfosten/app/leagues/League.php index 7c83a97a..f6a51dfa 100644 --- a/pfosten/app/leagues/League.php +++ b/pfosten/app/leagues/League.php @@ -13,6 +13,8 @@ use App\Leagues\LeagueMember; use DB; use Log; +use App\MyClasses; + class League extends Model { @@ -159,9 +161,12 @@ class League extends Model $memberScores[$memberId] = $tpl; } + + $lastLockedRoundId=Round::getLastLockedRoundId(); + Log::info("LASTLOCKKEDROUNDID=".$lastLockedRoundId); $matches=Match::getMatchResults($league->id,-1); foreach ($matches as $match) { - if (Round::isCompleted($match->round_id)) { + if (Round::isCompleted($match->round_id) || $match->round_id==$lastLockedRoundId ) { $memberScores[$match->user1_id][1] += $match->user1_league_score; error_log("+++ ".$match->user1_id." +".$match->user1_league_score); $memberScores[$match->user1_id][2] += $match->user1_rankscore; // goals @@ -215,6 +220,9 @@ class League extends Model // Nur für Auf und Abstiegsberechnung. // Schreibt den zukünftigen Rank auf Index4 public static function getTotalRankingOverall($seasonId=-1) { + $a=new MyClasses\TimeLogger("League::getTotalRankingOverall (seasonId=".$seasonId.")"); + Log::info($a->getStartMessage()); + $userNames = User::getNames(); $totalRanking=array(); @@ -386,7 +394,10 @@ class League extends Model - + Log::info($a->getEndMessage()); + //error_log($a->getEndMessage()); + + return $totalRanking; } diff --git a/pfosten/app/leagues/Match.php b/pfosten/app/leagues/Match.php index 87a1572f..b3c6187c 100644 --- a/pfosten/app/leagues/Match.php +++ b/pfosten/app/leagues/Match.php @@ -258,14 +258,18 @@ class Match extends Model $roundtipps = $roundtipps["roundtipps"]; $matches = Match::getLeagueMatches($leagueId, $maxRoundId); - if ($maxRoundId==-1) { $maxRoundId = Round::getLastRoundId($season->id); } + if ($maxRoundId==-1) { + //$maxRoundId = Round::getLastRoundId($season->id); + $maxRoundId = Round::getLastLockedRoundId($season->id); + Log::info("LASTLOCKEDROUND_ID=".$maxRoundId); + } foreach($matches as $key => $match) { $user1_key = $match->round_id."_".$match->user1_id; $user2_key = $match->round_id."_".$match->user2_id; - if (Round::isCompleted($match->round_id)) { + if (array_key_exists($user1_key,$roundtipps ) && array_key_exists($user2_key,$roundtipps) ) { $user1_score = $roundtipps[$user1_key]["rankscore"]; $user2_score = $roundtipps[$user2_key]["rankscore"]; diff --git a/pfosten/composer.json b/pfosten/composer.json index b180702e..3e17b793 100755 --- a/pfosten/composer.json +++ b/pfosten/composer.json @@ -47,7 +47,7 @@ "config": { "preferred-install": "dist", "sort-packages": true, - "optimize-autoloader": true, + "optimize-autoloader": false, "secure-http":false } } diff --git a/pfosten/composer.lock b/pfosten/composer.lock index de79ccb2..8598b17c 100755 --- a/pfosten/composer.lock +++ b/pfosten/composer.lock @@ -693,16 +693,16 @@ }, { "name": "nesbot/carbon", - "version": "1.32.0", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "64563e2b9f69e4db1b82a60e81efa327a30ff343" + "reference": "55667c1007a99e82030874b1bb14d24d07108413" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/64563e2b9f69e4db1b82a60e81efa327a30ff343", - "reference": "64563e2b9f69e4db1b82a60e81efa327a30ff343", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/55667c1007a99e82030874b1bb14d24d07108413", + "reference": "55667c1007a99e82030874b1bb14d24d07108413", "shasum": "" }, "require": { @@ -744,7 +744,7 @@ "datetime", "time" ], - "time": "2018-07-05T06:59:26+00:00" + "time": "2018-08-07T08:39:47+00:00" }, { "name": "nikic/php-parser", @@ -895,20 +895,22 @@ }, { "name": "psy/psysh", - "version": "v0.9.6", + "version": "v0.9.7", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "4a2ce86f199d51b6e2524214dc06835e872f4fce" + "reference": "4f5b6c090948773a8bfeea6a0f07ab7d0b24e932" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4a2ce86f199d51b6e2524214dc06835e872f4fce", - "reference": "4a2ce86f199d51b6e2524214dc06835e872f4fce", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4f5b6c090948773a8bfeea6a0f07ab7d0b24e932", + "reference": "4f5b6c090948773a8bfeea6a0f07ab7d0b24e932", "shasum": "" }, "require": { "dnoegel/php-xdg-base-dir": "0.1", + "ext-json": "*", + "ext-tokenizer": "*", "jakub-onderka/php-console-highlighter": "0.3.*", "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", "php": ">=5.4.0", @@ -963,7 +965,7 @@ "interactive", "shell" ], - "time": "2018-06-10T17:57:20+00:00" + "time": "2018-08-11T15:54:43+00:00" }, { "name": "ramsey/uuid", @@ -1536,25 +1538,28 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-ctype": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1587,7 +1592,7 @@ "polyfill", "portable" ], - "time": "2018-04-30T19:57:29+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1650,26 +1655,26 @@ }, { "name": "symfony/polyfill-php70", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6" + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6", - "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0|~2.0", + "paragonie/random_compat": "~1.0|~2.0|~9.99", "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1705,7 +1710,7 @@ "portable", "shim" ], - "time": "2018-04-26T10:06:28+00:00" + "time": "2018-08-06T14:22:27+00:00" }, { "name": "symfony/process", diff --git a/pfosten/vendor/composer/autoload_classmap.php b/pfosten/vendor/composer/autoload_classmap.php index 2a24e347..5d856c80 100755 --- a/pfosten/vendor/composer/autoload_classmap.php +++ b/pfosten/vendor/composer/autoload_classmap.php @@ -38,6 +38,7 @@ return array( 'App\\Leagues\\Match' => $baseDir . '/app/Leagues/Match.php', 'App\\Mail\\RoundmailMailer' => $baseDir . '/app/Mail/RoundmailMailer.php', 'App\\ManualPayout' => $baseDir . '/app/ManualPayout.php', + 'App\\MyClasses\\TimeLogger' => $baseDir . '/app/MyClasses/TimeLogger/TimeLogger.php', 'App\\Payment' => $baseDir . '/app/Payment.php', 'App\\Providers\\AppServiceProvider' => $baseDir . '/app/Providers/AppServiceProvider.php', 'App\\Providers\\AuthServiceProvider' => $baseDir . '/app/Providers/AuthServiceProvider.php', diff --git a/pfosten/vendor/composer/autoload_files.php b/pfosten/vendor/composer/autoload_files.php index 0f90f535..0ec42e5d 100755 --- a/pfosten/vendor/composer/autoload_files.php +++ b/pfosten/vendor/composer/autoload_files.php @@ -13,8 +13,8 @@ return array( '023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', - '801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php', '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + '801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php', 'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php', '58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php', 'f18cc91337d49233e5754e93f3ed9ec3' => $vendorDir . '/laravelcollective/html/src/helpers.php', diff --git a/pfosten/vendor/composer/autoload_static.php b/pfosten/vendor/composer/autoload_static.php index db9f401b..cb83b8fe 100755 --- a/pfosten/vendor/composer/autoload_static.php +++ b/pfosten/vendor/composer/autoload_static.php @@ -14,8 +14,8 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb '023d27dca8066ef29e6739335ea73bad' => __DIR__ . '/..' . '/symfony/polyfill-php70/bootstrap.php', '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php', - '801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + '801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php', 'f0906e6318348a765ffb6eb24e0d0938' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Foundation/helpers.php', '58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php', 'f18cc91337d49233e5754e93f3ed9ec3' => __DIR__ . '/..' . '/laravelcollective/html/src/helpers.php', @@ -322,6 +322,7 @@ class ComposerStaticInita19fb0695e1b61b4feeb3cc3fbdd2feb 'App\\Leagues\\Match' => __DIR__ . '/../..' . '/app/Leagues/Match.php', 'App\\Mail\\RoundmailMailer' => __DIR__ . '/../..' . '/app/Mail/RoundmailMailer.php', 'App\\ManualPayout' => __DIR__ . '/../..' . '/app/ManualPayout.php', + 'App\\MyClasses\\TimeLogger' => __DIR__ . '/../..' . '/app/MyClasses/TimeLogger/TimeLogger.php', 'App\\Payment' => __DIR__ . '/../..' . '/app/Payment.php', 'App\\Providers\\AppServiceProvider' => __DIR__ . '/../..' . '/app/Providers/AppServiceProvider.php', 'App\\Providers\\AuthServiceProvider' => __DIR__ . '/../..' . '/app/Providers/AuthServiceProvider.php', diff --git a/pfosten/vendor/composer/installed.json b/pfosten/vendor/composer/installed.json index 7d2fe6c9..f9bf798e 100755 --- a/pfosten/vendor/composer/installed.json +++ b/pfosten/vendor/composer/installed.json @@ -1438,80 +1438,6 @@ "php" ] }, - { - "name": "psy/psysh", - "version": "v0.9.6", - "version_normalized": "0.9.6.0", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "4a2ce86f199d51b6e2524214dc06835e872f4fce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4a2ce86f199d51b6e2524214dc06835e872f4fce", - "reference": "4a2ce86f199d51b6e2524214dc06835e872f4fce", - "shasum": "" - }, - "require": { - "dnoegel/php-xdg-base-dir": "0.1", - "jakub-onderka/php-console-highlighter": "0.3.*", - "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", - "php": ">=5.4.0", - "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", - "symfony/var-dumper": "~2.7|~3.0|~4.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "hoa/console": "~2.15|~3.16", - "phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", - "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." - }, - "time": "2018-06-10T17:57:20+00:00", - "bin": [ - "bin/psysh" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.9.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Psy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ] - }, { "name": "vlucas/phpdotenv", "version": "v2.5.1", @@ -1849,67 +1775,6 @@ "random" ] }, - { - "name": "symfony/polyfill-php70", - "version": "v1.8.0", - "version_normalized": "1.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6", - "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0", - "php": ">=5.3.3" - }, - "time": "2018-04-26T10:06:28+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ] - }, { "name": "symfony/http-foundation", "version": "v3.4.14", @@ -2031,63 +1896,6 @@ "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com" }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.8.0", - "version_normalized": "1.8.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2018-04-30T19:57:29+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ] - }, { "name": "symfony/http-kernel", "version": "v3.4.14", @@ -2440,63 +2248,6 @@ "description": "Symfony Translation Component", "homepage": "https://symfony.com" }, - { - "name": "nesbot/carbon", - "version": "1.32.0", - "version_normalized": "1.32.0.0", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "64563e2b9f69e4db1b82a60e81efa327a30ff343" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/64563e2b9f69e4db1b82a60e81efa327a30ff343", - "reference": "64563e2b9f69e4db1b82a60e81efa327a30ff343", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "time": "2018-07-05T06:59:26+00:00", - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ] - }, { "name": "mtdowling/cron-expression", "version": "v1.2.1", @@ -3663,5 +3414,259 @@ "portable", "shim" ] + }, + { + "name": "nesbot/carbon", + "version": "1.33.0", + "version_normalized": "1.33.0.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "55667c1007a99e82030874b1bb14d24d07108413" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/55667c1007a99e82030874b1bb14d24d07108413", + "reference": "55667c1007a99e82030874b1bb14d24d07108413", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/translation": "~2.6 || ~3.0 || ~4.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "time": "2018-08-07T08:39:47+00:00", + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + } + ], + "description": "A simple API extension for DateTime.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ] + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.9.0", + "version_normalized": "1.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "time": "2018-08-06T14:22:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ] + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.9.0", + "version_normalized": "1.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2018-08-06T14:22:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ] + }, + { + "name": "psy/psysh", + "version": "v0.9.7", + "version_normalized": "0.9.7.0", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "4f5b6c090948773a8bfeea6a0f07ab7d0b24e932" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4f5b6c090948773a8bfeea6a0f07ab7d0b24e932", + "reference": "4f5b6c090948773a8bfeea6a0f07ab7d0b24e932", + "shasum": "" + }, + "require": { + "dnoegel/php-xdg-base-dir": "0.1", + "ext-json": "*", + "ext-tokenizer": "*", + "jakub-onderka/php-console-highlighter": "0.3.*", + "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", + "php": ">=5.4.0", + "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", + "symfony/var-dumper": "~2.7|~3.0|~4.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "hoa/console": "~2.15|~3.16", + "phpunit/phpunit": "~4.8.35|~5.0|~6.0|~7.0" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", + "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." + }, + "time": "2018-08-11T15:54:43+00:00", + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.9.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ] } ] diff --git a/pfosten/vendor/nesbot/carbon/src/Carbon/Carbon.php b/pfosten/vendor/nesbot/carbon/src/Carbon/Carbon.php index abd8a7ad..f62dd45e 100644 --- a/pfosten/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ b/pfosten/vendor/nesbot/carbon/src/Carbon/Carbon.php @@ -1015,17 +1015,24 @@ class Carbon extends DateTime implements JsonSerializable } /** - * Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface. + * Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface + * and not in $other. * - * @param mixed $date + * @param mixed $date + * @param string|array $other * * @throws \InvalidArgumentException */ - protected static function expectDateTime($date) + protected static function expectDateTime($date, $other = array()) { + $message = 'Expected '; + foreach ((array) $other as $expect) { + $message .= "{$expect}, "; + } + if (!$date instanceof DateTime && !$date instanceof DateTimeInterface) { throw new InvalidArgumentException( - 'Expected null, string, DateTime or DateTimeInterface, '. + $message.'DateTime or DateTimeInterface, '. (is_object($date) ? get_class($date) : gettype($date)).' given' ); } @@ -1049,7 +1056,7 @@ class Carbon extends DateTime implements JsonSerializable return static::parse($date, $this->getTimezone()); } - static::expectDateTime($date); + static::expectDateTime($date, array('null', 'string')); return $date instanceof self ? $date : static::instance($date); } @@ -1847,7 +1854,7 @@ class Carbon extends DateTime implements JsonSerializable /** * Set the default format used when type juggling a Carbon instance to a string * - * @param string $format + * @param string|Closure $format * * @return void */ @@ -1863,7 +1870,9 @@ class Carbon extends DateTime implements JsonSerializable */ public function __toString() { - return $this->format(static::$toStringFormat); + $format = static::$toStringFormat; + + return $this->format($format instanceof Closure ? $format($this) : $format); } /** @@ -2284,7 +2293,7 @@ class Carbon extends DateTime implements JsonSerializable /** * Get the minimum instance between a given instance (default now) and the current instance. * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ @@ -2312,7 +2321,7 @@ class Carbon extends DateTime implements JsonSerializable /** * Get the maximum instance between a given instance (default now) and the current instance. * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ @@ -2523,7 +2532,7 @@ class Carbon extends DateTime implements JsonSerializable { $date = $date ?: static::now($this->tz); - static::expectDateTime($date); + static::expectDateTime($date, 'null'); return $this->format($format) === $date->format($format); } @@ -2572,7 +2581,7 @@ class Carbon extends DateTime implements JsonSerializable { $date = $date ? static::instance($date) : static::now($this->tz); - static::expectDateTime($date); + static::expectDateTime($date, 'null'); $ofSameYear = is_null($ofSameYear) ? static::shouldCompareYearWithMonth() : $ofSameYear; @@ -4164,7 +4173,7 @@ class Carbon extends DateTime implements JsonSerializable */ public function endOfDay() { - return $this->modify('23.59.59.999999'); + return $this->modify('23:59:59.999999'); } /** @@ -4322,7 +4331,7 @@ class Carbon extends DateTime implements JsonSerializable */ public function endOfHour() { - return $this->setTime($this->hour, 59, 59); + return $this->modify("$this->hour:59:59.999999"); } /** @@ -4342,7 +4351,27 @@ class Carbon extends DateTime implements JsonSerializable */ public function endOfMinute() { - return $this->setTime($this->hour, $this->minute, 59); + return $this->modify("$this->hour:$this->minute:59.999999"); + } + + /** + * Modify to start of current minute, seconds become 0 + * + * @return static + */ + public function startOfSecond() + { + return $this->modify("$this->hour:$this->minute:$this->second.0"); + } + + /** + * Modify to end of current minute, seconds become 59 + * + * @return static + */ + public function endOfSecond() + { + return $this->modify("$this->hour:$this->minute:$this->second.999999"); } /** @@ -4616,7 +4645,7 @@ class Carbon extends DateTime implements JsonSerializable /** * Modify the current instance to the average of a given instance (default now) and the current instance. * - * @param \Carbon\Carbon|\DateTimeInterface|null $date + * @param \Carbon\Carbon|\DateTimeInterface|string|null $date * * @return static */ diff --git a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/az.php b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/az.php index d567c63c..25f5c4a4 100644 --- a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/az.php +++ b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/az.php @@ -28,4 +28,13 @@ return array( 'from_now' => ':time sonra', 'after' => ':time sonra', 'before' => ':time əvvəl', + 'diff_now' => 'indi', + 'diff_yesterday' => 'dünən', + 'diff_tomorrow' => 'sabah', + 'diff_before_yesterday' => 'srağagün', + 'diff_after_tomorrow' => 'birisi gün', + 'period_recurrences' => ':count dəfədən bir', + 'period_interval' => 'hər :interval', + 'period_start_date' => ':date tarixindən başlayaraq', + 'period_end_date' => ':date tarixinədək', ); diff --git a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/bn.php b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/bn.php index a930df38..5817599c 100644 --- a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/bn.php +++ b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/bn.php @@ -10,22 +10,29 @@ */ return array( - 'year' => '১ বছর|:count বছর', - 'y' => '১ বছর|:count বছর', - 'month' => '১ মাস|:count মাস', - 'm' => '১ মাস|:count মাস', - 'week' => '১ সপ্তাহ|:count সপ্তাহ', - 'w' => '১ সপ্তাহ|:count সপ্তাহ', - 'day' => '১ দিন|:count দিন', - 'd' => '১ দিন|:count দিন', - 'hour' => '১ ঘন্টা|:count ঘন্টা', - 'h' => '১ ঘন্টা|:count ঘন্টা', - 'minute' => '১ মিনিট|:count মিনিট', - 'min' => '১ মিনিট|:count মিনিট', - 'second' => '১ সেকেন্ড|:count সেকেন্ড', - 's' => '১ সেকেন্ড|:count সেকেন্ড', - 'ago' => ':time পূর্বে', - 'from_now' => 'এখন থেকে :time', - 'after' => ':time পরে', - 'before' => ':time আগে', + 'year' => '১ বছর|:count বছর', + 'y' => '১ বছর|:count বছর', + 'month' => '১ মাস|:count মাস', + 'm' => '১ মাস|:count মাস', + 'week' => '১ সপ্তাহ|:count সপ্তাহ', + 'w' => '১ সপ্তাহ|:count সপ্তাহ', + 'day' => '১ দিন|:count দিন', + 'd' => '১ দিন|:count দিন', + 'hour' => '১ ঘন্টা|:count ঘন্টা', + 'h' => '১ ঘন্টা|:count ঘন্টা', + 'minute' => '১ মিনিট|:count মিনিট', + 'min' => '১ মিনিট|:count মিনিট', + 'second' => '১ সেকেন্ড|:count সেকেন্ড', + 's' => '১ সেকেন্ড|:count সেকেন্ড', + 'ago' => ':time পূর্বে', + 'from_now' => 'এখন থেকে :time', + 'after' => ':time পরে', + 'before' => ':time আগে', + 'diff_now' => 'এখন', + 'diff_yesterday' => 'গতকাল', + 'diff_tomorrow' => 'আগামীকাল', + 'period_recurrences' => ':count বার|:count বার', + 'period_interval' => 'প্রতি :interval', + 'period_start_date' => ':date থেকে', + 'period_end_date' => ':date পর্যন্ত', ); diff --git a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/ca.php index f75f6c37..c854b5a9 100644 --- a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/ca.php +++ b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/ca.php @@ -25,7 +25,7 @@ return array( 'second' => ':count segon|:count segons', 's' => ':count segon|:count segons', 'ago' => 'fa :time', - 'from_now' => 'dins de :time', + 'from_now' => 'd\'aquí :time', 'after' => ':time després', 'before' => ':time abans', 'diff_now' => 'ara mateix', diff --git a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/es.php index 607a6b0b..567a280f 100644 --- a/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/es.php +++ b/pfosten/vendor/nesbot/carbon/src/Carbon/Lang/es.php @@ -31,6 +31,6 @@ return array( 'diff_now' => 'ahora mismo', 'diff_yesterday' => 'ayer', 'diff_tomorrow' => 'mañana', - 'diff_before_yesterday' => 'anteayer', + 'diff_before_yesterday' => 'antier', 'diff_after_tomorrow' => 'pasado mañana', ); diff --git a/pfosten/vendor/psy/psysh/composer.json b/pfosten/vendor/psy/psysh/composer.json index 3e169be9..7df60cf4 100644 --- a/pfosten/vendor/psy/psysh/composer.json +++ b/pfosten/vendor/psy/psysh/composer.json @@ -14,6 +14,8 @@ ], "require": { "php": ">=5.4.0", + "ext-json": "*", + "ext-tokenizer": "*", "symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0", "symfony/var-dumper": "~2.7|~3.0|~4.0", "nikic/php-parser": "~1.3|~2.0|~3.0|~4.0", diff --git a/pfosten/vendor/psy/psysh/test/fixtures/config.php b/pfosten/vendor/psy/psysh/test/fixtures/config.php index 4aa1f5fb..4c74b79d 100644 --- a/pfosten/vendor/psy/psysh/test/fixtures/config.php +++ b/pfosten/vendor/psy/psysh/test/fixtures/config.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -$config->setRuntimeDir(sys_get_temp_dir() . '/psysh_test/withconfig/temp'); +$config->setRuntimeDir(\sys_get_temp_dir() . '/psysh_test/withconfig/temp'); return [ 'useReadline' => true,