在App Engine上使用PHP的Google Cloud Storage文件夹列表 [英] Google Cloud Storage folders list with PHP on App Engine
问题描述
我一直在寻找一种解决方案,以在不使用GCS PHP API的情况下在App Engine上使用PHP获得Google Cloud Storage Folders列表的列表.
I have been trouble looking a solution to get listed of Google Cloud Storage Folders list with PHP on App Engine without using GCS PHP API.
-
我知道有适用于此的PHP API ...
I know that there is PHP API for this...
我知道它仅在列出文件时(readdir,opendir和其他PHP dir方法),但跳过了任何文件夹...
I know that it is only listing files when (readdir, opendir and other PHP dir methods) but skipped any folder...
有人可以给我一些提示吗,我的问题是如何在特定文件夹中列出所有内容?
Can somebody guide me with a tips, my question is that how do I get listed anything on a particular folder?
推荐答案
在GCS上没有文件夹"之类的东西-它是一个平面文件系统.
There is no such thing as a 'folder' on GCS - it is a flat file system.
在UI + API中模拟了文件夹,但是将名称中带有'/'的文件视为文件夹结构的一部分.
Folders are simulated in the UI + APIs but treating files with a '/' in the name as part of a folder structure.
话虽这么说,App Engine随附的gcs流包装器应在Cloud Storage存储分区上支持opendir(),readdir(),closedir(),并使其看起来像在列出文件夹.这怎么不适合您?
That being said, the gcs stream wrapper provided with App Engine should support opendir(), readdir(), closedir() on a Cloud Storage bucket and make it look like it's listing a folder. How is this not working for you?
这篇关于在App Engine上使用PHP的Google Cloud Storage文件夹列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!