Get file contents as array.

@return array
555131
public function getAttributes()
    {
        if (config('modules.cache.enabled') === false) {
            return json_decode($this->getContents(), 1);
        }

        return app('cache')->remember($this->getPath(), config('modules.cache.lifetime'), function () {
            return json_decode($this->getContents(), 1);
        });
    }
45258
public function toArray(): array
    {
        return [
            "clientFilename" => $this->getClientFilename(),
            "unverifiedContentType" => $this->error ? "" : $this->getContentType(true),
            "verifiedContentType" => $this->error ? "" : $this->getContentType(),
            "size" => $this->error ? 0 : $this->getSize(),
            "tempPath" => $this->error ? "" : $this->getTempPath(),
            "error" => $this->error ? $this->error->getMessage() : "",
        ];
    }
1204524
private function contents(): array
    {
        if (! $this->contents) {
            if (! file_exists($this->path)) {
                throw new \LogicException(
                    vsprintf('The PHP configuration file does not exist (%s)', [
                        realpath($this->path),
                    ])
                );
            }

            $contents = require $this->path;

            if (! is_array($contents)) {
                throw new \UnexpectedValueException(
                    vsprintf('The PHP configuration file must return an array, %s returned (%s)', [
                        gettype($contents),
                        realpath($this->path),
                    ])
                );
            }

            $this->contents = [
                'parameters' => $contents['parameters'] ?? [],
                'aliases' => $contents['aliases'] ?? [],
                'invokables' => $contents['invokables'] ?? [],
                'factories' => $contents['factories'] ?? [],
                'tags' => $contents['tags'] ?? [],
                'mappers' => $contents['mappers'] ?? [],
                'extensions' => $contents['extensions'] ?? [],
            ];
        }

        return $this->contents;
    }
776749
public function getData(): array
    {
        $uploads = [];
        //if the user is trying to upload a image
        if ($this->request->hasFiles()) {
            foreach ($this->request->getUploadedFiles() as $file) {
                $uploads[] = [
                    'name' => $file->getKey(),
                    'filename' => $file->getName(),
                    'contents' => file_get_contents($file->getTempName()),
                ];
            }

            $parseUpload = function ($request) use (&$uploads) {
                foreach ($request as $key => $value) {
                    if (is_array($value)) {
                        foreach ($value as $f => $v) {
                            $uploads[] = ['name' => $key . '[' . $f . ']', 'contents' => $v];
                        }
                    } else {
                        $uploads[] = ['name' => $key, 'contents' => $value];
                    }
                }
            };
        }

        switch ($this->request->getMethod()) {
            case 'GET':
                $queryParams = $this->request->getQuery();
                unset($queryParams['_url']);
                return ['query' => $queryParams];
                break;

            case 'POST':
                if (!$uploads) {
                    //if we dont get post send the raw
                    if (count($this->request->getPost()) > 0) {
                        return ['form_params' => $this->request->getPost()];
                    } elseif ($this->request->getJsonRawBody()) {
                        return ['json' => json_decode($this->request->getRawBody(), true)];
                    }
                    //why did we get here?
                    return ['form_params' => $this->request->getPost()];
                } else {
                    $parseUpload($this->request->getPost());
                    return ['multipart' => $uploads];
                }
                break;

            case 'PUT':
                if (!$uploads) {
                    //if we get put send it with the normal put, else send json
                    if (count($this->request->getPut()) > 0) {
                        return ['form_params' => $this->request->getPut()];
                    } elseif ($this->request->getJsonRawBody()) {
                        return ['json' => json_decode($this->request->getRawBody(), true)];
                    }
                    //why did we get here?
                    return ['form_params' => $this->request->getPut()];
                } else {
                    $parseUpload($this->request->getPut());
                    return ['multipart' => $uploads];
                }

                break;
            default:
                return [];
                break;
        }
    }
155060
public function toArray()
	{
		return array(
			'width' => $this->width,
			'height' => $this->height,
			'type' => $this->type,
			'bits' => $this->bits,
			'channels' => $this->channels,
			'mime' => $this->mime,
			'path' => $this->path,
			'size' => $this->size,
			'name' => $this->name,
			'directory' => $this->directory,
			'extension' => $this->extension,
		);
	}
973242
public function contents()
    {
        $files = array();
        foreach ($this->tar->listContent() as $data) {
          $files[$data['filename']] = $data;
        }

        return $files;
    }
302527
public function asArray()
    {
        $headers = [];
        foreach (array_filter($this->storage) as $header => $value) {
            $headers[] = $header . ': ' . $value;
        }

        return $headers;
    }
1209882
public function toArray()
	{
		$result = parent::toArray();

		if (isset($result['activated']))
		{
			$result['activated'] = $this->getActivatedAttribute($result['activated']);
		}
		if (isset($result['permissions']))
		{
			$result['permissions'] = $this->getPermissionsAttribute($result['permissions']);
		}
		if (isset($result['suspended_at']))
		{
			$result['suspended_at'] = $result['suspended_at']->format('Y-m-d H:i:s');
		}

		return $result;
	}
1288525
public function getFiles() : array
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return array_map(function($file) {
            return new File($this->getPath(). DIRECTORY_SEPARATOR .$file);
        }, $this->_files);
    }
539684
public function getList()
    {
        $result = [];
        foreach (config('crude_special_files.files') as $key)
            $result[$key] = [
                'key' => $key,
                'label' => $this->getLabel($key),
                'data' => $this->getFileData($key)
            ];

        return $result;
    }
580619
public function toArray()
    {
        return [
            'sType'      => $this->sType,
            'aTo'        => array_filter(array_unique($this->aTo)),
            'aCc'        => array_filter(array_unique($this->aCc)),
            'aBcc'       => array_filter(array_unique($this->aBcc)),
            'sFromName'  => $this->sFromName,
            'sFromEmail' => $this->sFromEmail,
            'sSubject'   => $this->sSubject,
            'aData'      => $this->aData,
        ];
    }
38734
public function getContents()
    {
        $contents = file_get_contents($this->getPath());

        return str_replace(
            array_keys($this->replaces), array_values($this->replaces), $contents
        );
    }
1337977
public function getMultipartArray()
    {
        $arrMultipart = array();

        $arrMultipart[] = ['name' => $this->name,
                            'contents' => $this->contents,
                            'headers' => $this->headers,
                            'filename' => $this->filename
        ];

        return $arrMultipart;
    }
109173
private function getArchiveFiles(): array {

        $list = [];

        for ( $i = 0; $i < $this->getArchive()->numFiles; $i++ ) {

            $file = $this->getArchive()->statIndex($i);
            if ( $file === false ) {
                continue;
            }

            $name = str_replace('\\', '/', $file['name']);
            if (
                (
                    $name[0] == "." &&
                    in_array($this->getSkipMode(), ["HIDDEN", "ALL"])
                ) ||
                (
                    $name[0] == "." &&
                    @$name[1] == "_" &&
                    in_array($this->getSkipMode(), ["COMODOJO", "ALL"])
                )
            ) {
                continue;
            }

            $list[] = $name;

        }

        return $list;

    }
84347
public function toArray()
    {
        return array(
            'filter' => $this->getFilter(),
            'width' => $this->getWidth(),
            'height' => $this->getHeight(),
            'percent' => $this->getPercent(),
            'dummy' => $this->getDummy(),
            'border' => $this->getBorder(),
            'layer' => $this->getLayer(),
            'quality' => $this->getQuality(), 
            'crop' => $this->getCrop(),
            'x' => $this->getX(),
            'y' => $this->getY(),
            'rotate' => $this->getRotate(),
            'gravity' => $this->getGravity(), 
            'extension' => $this->getExtension(),
            'filename' => $this->getFilename(),
        );
    }
694747
public function getFiles()
    {

        // initialize the array with the files
        $files = array();

        // iterate over the file keys and read the configuration values
        foreach (FileKeys::getServerFileKeys() as $fileKey) {
            $files[$fileKey] = $this->getSystemConfiguration()->getParam($fileKey);
        }

        // return the array with the files
        return $files;
    }
1175062
protected function getFilenameArray()
    {
        $table = DataObject::singleton(File::class)->baseTable();
        // Convert original query, ensuring the legacy "Filename" is included in the result
        /** @skipUpgrade */
        return $this
            ->getFileQuery()
            ->dataQuery()
            ->selectFromTable($table, ['ID', 'Filename'])
            ->execute()
            ->map(); // map ID to Filename
    }