!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/wataxi.picotech.app/public_html/vendor/cmixin/business-time/src/BusinessTime/   drwxr-xr-x
Free 28.42 GB of 117.98 GB (24.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Calculator.php (4.08 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace BusinessTime;

use 
BusinessTime\Exceptions\InvalidArgumentException;
use 
Carbon\CarbonInterface;
use 
Carbon\CarbonInterval;
use 
Cmixin\BusinessTime;
use 
DateInterval;
use 
Spatie\OpeningHours\OpeningHours;

class 
Calculator
{
    
/**
     * @var CarbonInterface
     */
    
protected $date;

    
/**
     * @var CarbonInterval
     */
    
protected $interval;

    
/**
     * @var bool
     */
    
protected $open;

    
/**
     * @var bool
     */
    
protected $holidaysAreClosed;

    
/**
     * @var bool
     */
    
protected $past;

    
/**
     * @var OpeningHours
     */
    
protected $openingHours;

    public function 
__construct(CarbonInterface $dateCarbonInterval $intervalbool $openbool $holidaysAreClosed)
    {
        
$this->date $date;

        try {
            
$this->openingHours $date->getOpeningHours(BusinessTime::LOCAL_MODE);
        } catch (
InvalidArgumentException $e) {
            
$this->openingHours null;
        }

        
$this->interval $interval;
        
$this->open $open;
        
$this->holidaysAreClosed $holidaysAreClosed;
    }

    public function 
calculate($maximum INF): CarbonInterface
    
{
        
$remainingInterval $this->interval;
        
$resultCandidate $this->completeDate(
            
$this->date->copy()->add($remainingInterval)
        );
        
$this->past $resultCandidate $this->date;
        
$base $this->getStartDate($this->date);

        for (
$i 0$i $maximum$i++) {
            [
$next$resultCandidate] = $this->getNextAndCandidate($base$remainingInterval);

            if (
$this->isInLimit($resultCandidate$next)) {
                return 
$this->completeDate(
                    
$this->date->setDateTimeFrom($resultCandidate)
                );
            }

            
$remainingInterval $next->diff($resultCandidatefalse);
            
$base $this->getNextInTakenState($next);
        }

        throw new 
InvalidArgumentException('Maximum iteration ('.$maximum.') has been reached.');
    }

    protected function 
isInExpectedState(CarbonInterface $date): bool
    
{
        
$methodPrefix 'is';

        if (
$this->holidaysAreClosed) {
            
$methodPrefix .= 'Business';
        }

        return 
$date->{$methodPrefix.($this->open 'Open' 'Closed')}();
    }

    protected function 
getNextInTakenState(CarbonInterface $date): CarbonInterface
    
{
        return 
$this->getNext($date$this->open);
    }

    protected function 
getNext(CarbonInterface $datebool $openState): CarbonInterface
    
{
        
$methodPrefix $this->past 'previous' 'next';

        if (
$this->holidaysAreClosed) {
            
$methodPrefix .= 'Business';
        }

        return 
$this->completeDate(
            
$this->completeDate($date->copy())
                ->{
$methodPrefix.($this->past === $openState 'Close' 'Open')}()
        );
    }

    protected function 
getNextAndCandidate(CarbonInterface $dateDateInterval $interval): array
    {
        
$next $this->getNextInSkippedState($date);
        
$resultCandidate $this->completeDate($date->copy()->add($interval));

        if (!
$this->isInExpectedState($date)) {
            
$next $this->getNextInSkippedState($date);
        }

        return [
$next$resultCandidate];
    }

    protected function 
getNextInSkippedState(CarbonInterface $date): CarbonInterface
    
{
        return 
$this->getNext($date, !$this->open);
    }

    protected function 
isInLimit(CarbonInterface $possibleResultCarbonInterface $limitDate): bool
    
{
        return 
$this->past $possibleResult >= $limitDate $possibleResult $limitDate;
    }

    protected function 
getStartDate(CarbonInterface $date)
    {
        return 
$this->isInExpectedState($date) || (
            
$this->past && $this->isInExpectedState($this->completeDate($date->copy()->subMicrosecond()))
        )
            ? 
$date
            
$this->getNextInTakenState($date);
    }

    protected function 
completeDate(CarbonInterface $date): CarbonInterface
    
{
        if (
$this->openingHours) {
            return 
$date->setOpeningHours($this->openingHours);
        }

        return 
$date;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0043 ]--