Get all storage files as an array from database.

This method is used to retrieve all files from the database and indexed by file key.

@return array An array with all storage files indexed by the file id.
355618
public function getFilesArray()
    {
        if ($this->_filesArray === null) {
            $this->_filesArray = $this->getQueryCacheHelper((new Query())->from('{{%admin_storage_file}}')->select(['id', 'is_hidden', 'is_deleted', 'folder_id', 'name_original', 'name_new', 'name_new_compound', 'mime_type', 'extension', 'hash_name', 'hash_file', 'upload_timestamp', 'file_size', 'upload_user_id', 'caption'])->indexBy('id'), self::CACHE_KEY_FILE);
        }

        return $this->_filesArray;
    }
1071974
public function toArray() {
        $data = array(
            'basename' => $this->basename(),
            'dir' => $this->dir(),
            'ext' => $this->ext(),
            'name' => $this->name(),
            'path' => $this->path(),
            'size' => $this->size(),
            'type' => $this->type(),
            'height' => $this->height(),
            'width' => $this->width()
        );

        // Include exif data
        foreach ($this->exif() as $key => $value) {
            $data['exif.' . $key] = $value;
        }

        return $data;
    }
268589
public function toArray()
    {
        return [
            'filename' => $this->filename,
            'original_filename' => $this->original_filename,
            'title' => $this->title,
            'alt' => $this->alt,
            'description' => '',
            'size' => $this->size,
            'extension' => $this->extension
        ];
    }
846930
public function getFolders() {

		$result = [];
		$files = glob($this->path . '*', GLOB_ONLYDIR);

		if($files) {
			foreach($files as $f) {
				$result[] = self::getInstance($f);
			}
		}

		return $result;

	}
298601
public function getFileArray()
    {
        if (!$this->FileArray) {
            $user = $this->getConfig('user');
            is_true_or_fail(is_positive($user), __d('me_cms', 'You have to set a valid user id'), InvalidArgumentException::class);
            $this->FileArray = new FileArray(LOGIN_RECORDS . 'user_' . $user . '.log');
        }

        return $this->FileArray;
    }
366435
public function data()
    {
        $data = [
            'filesystems' => array_keys((array)Configure::read(self::CONFIGURE_KEY)),
            'instances' => [],
        ];

        foreach ($data['filesystems'] as $filesystem) {
            $data['instances'][$filesystem] = FilesystemRegistry::retrieve($filesystem);
        }

        return $data;
    }
478860
public function getData() {
        $values = array_filter(filter_input_array(INPUT_POST));
        foreach ($values as $key => $value) {
            if ( is_array($value) )  {
                $values[$key] = array_filter($value);
            }
        }

        return $values + $_FILES;
    }
316560
public function toArray()
    {
        $arr = array();
        foreach ($this as $key => $value) {
            $method = 'get' . $key;
            if (method_exists($this, $method)) {
                $arr[$key] = $this->$method();
            }
        }

        return $arr;
    }
739606
public static function getAll()
    {
        Base::checkOpen();
        if (Base::driver() == "file") {
            return $_SESSION;
        }
        $session = Base::getSessionObject();
        $data_str = $session->read($session->getId());
        if ($data_str === null) {
            return [];
        }
        return unserialize($data_str);
    }
145732
public function getFileList()
    {
        $allfiles = [];

        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($this->project);

            $files = $ds->getIncludedFiles();

            // We need to store these files keyed by the basedir from DirectoryScanner
            // so that we can resolve the fullpath of the file later.
            if (isset($allfiles[$ds->getBasedir()])) {
                $allfiles[$ds->getBasedir()] = array_merge($allfiles[$ds->getBasedir()], $files);
            } else {
                $allfiles[$ds->getBasedir()] = $files;
            }
        }

        $struc = [];

        foreach ($allfiles as $basedir => $files) {
            foreach ($files as $file) {
                // paths are relative to $basedir above
                $path = strtr(dirname($file), DIRECTORY_SEPARATOR, '/');

                if (!$path || $path == '.') {
                    $path = '/'; // for array index
                }

                $parts = explode('.', basename($file));
                $ext = array_pop($parts);
                if (strlen($ext) == strlen($file)) {
                    $ext = '';
                }

                $f = new PhingFile($basedir, $file);

                $struc[$path][] = [
                    'file' => basename($file),
                    'ext' => $ext,
                    'path' => (($path == '/') ? basename($file) : $path . '/' . basename($file)),
                    'fullpath' => $f->getAbsolutePath()
                ];
            }
        }

        uksort($struc, 'strnatcasecmp');
        foreach ($struc as $key => $ind) {
            usort($ind, [$this, 'sortfiles']);
            $struc[$key] = $ind;
        }

        $tempstruc = $struc;
        $struc = ['/' => $tempstruc['/']];
        $bv = 0;
        foreach ($tempstruc as $key => $ind) {
            $save = $key;
            if ($key != '/') {
                $struc['/'] = $this->setupDirs($struc['/'], explode('/', $key), $tempstruc[$key]);
            }
        }
        uksort($struc['/'], [$this, 'mystrucsort']);

        return $struc;
    }
388730
public function all()
	{
		$path = $this->directory;

		$data = array();

		$dirIterator = new \DirectoryIterator($path);
		foreach ($dirIterator as $folder)
		{
			if ($folder->isDot() || !$folder->isDir())
			{
				continue;
			}

			$name = $folder->getFilename();

			$item = new Auditor($name);

			$files = new \DirectoryIterator($path . DS . $name);
			foreach ($files as $file)
			{
				if ($folder->isDot() || $folder->isDir())
				{
					continue;
				}

				$item->tally(filesize($path . '/' . $name . '/' . $file->getFilename()) / 1024);
			}

			$data[$name] = $item;
		}

		return $data;
	}
998926
public function toArray()
    {
        $data = array(
            'added' => $this->getAdded(true),
            'api' => $this->getApi(),
            'cwd' => $this->getCwd(true),
            'debug' => $this->getDebug(),
            'files' => $this->getFiles(true),
            'list' => $this->getList(),
            'netDrivers' => $this->getNetDrivers(),
            'options' => $this->getOptions(),
            'removed' => $this->getRemoved(true),
            'tree' => $this->getTree(true),
            'uplMaxSize' => $this->getUplMaxSize(),
            'content' => $this->getContent(),
            'size' => $this->getSize(),
            'error' => $this->getError(),
            'dim' => $this->getDim(),
        );

        return array_filter(
            $data,
            function ($var) {
                return !is_null($var);
            }
        );
    }
1370092
public function toArray()
    {
        return [
            'fileId' => $this->file->getId(),
            'fileVersion' => $this->file->getVersion(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
614510
public function findAll()
    {
        $keys = $this->getFileManager()->keys();
        $entities = array();
        if(is_array($keys)) {
            foreach($keys as $key) {
                if(preg_match('/^'.$this->getHash().'/', $key)) {
                    $entities[] = $this->loadEntity($key);
                }
            }
        }
        
        return $entities;
    }
690222
private function getCacheFiles()
    {
        if (!($files = @scandir($this->directory, 1))) {
            return false;
        }

        $negExtLen = -1 * strlen($this->extension);
        $return = array();
        foreach ($files as $file) {
            if (substr($file, $negExtLen) === $this->extension) {
                $return[] = $this->directory . '/' . $file;
            }
        }
        return $return;
    }
402265
public function toArray()
    {
        $keys = $this->redis->hKeys($this->key);
        $result = array();
        foreach ($keys as $key) {
            $result[$key] = $this->offsetGet($key);
        }
        return $result;
    }
999294
public function getFileSetIDs()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $rows = $db->fetchAll('select fsID from FileSetFiles where fID = ?', [$this->getFileID()]);
        $ids = array_map('intval', array_map('array_pop', $rows));

        return $ids;
    }