Вход Регистрация
Файл: gapps/vendor/league/flysystem/src/Plugin/EmptyDir.php
Строк: 23
<?php

namespace LeagueFlysystemPlugin;

class 
EmptyDir extends AbstractPlugin
{
    
/**
     * Get the method name.
     *
     * @return string
     */
    
public function getMethod()
    {
        return 
'emptyDir';
    }

    
/**
     * Empty a directory's contents.
     *
     * @param $dirname
     */
    
public function handle($dirname)
    {
        
$listing $this->filesystem->listContents($dirnamefalse);

        foreach (
$listing as $item) {
            if (
$item['type'] === 'dir') {
                
$this->filesystem->deleteDir($item['path']);
            } else {
                
$this->filesystem->delete($item['path']);
            }
        }
    }
}
Онлайн: 1
Реклама