我已经编写了一个用于较大文件的文件上传,即将文件上传到云存储。不幸的是,这需要一段时间,因为文件首先上传到网络服务器,然后再次从网络服务器上传到 Google 云存储。有没有办法使用 Google PHP Api 客户端(https://github.com/google/google-api-php-client)将文件直接上传到云存储?我在文档中找不到有关此主题的任何内容。
在 Symfony4 中,我使用以下配置来进行学说 apcu 缓存:
doctrine:
orm:
auto_mapping: true
auto_generate_proxy_classes: false
metadata_cache_driver: apcu
query_cache_driver: apcu
result_cache_driver: apcu
Run Code Online (Sandbox Code Playgroud)
升级到 Symfony5 后,出现错误:
为实体管理器“default”中的缓存“metadata_cache”配置的“apc”类型的未知缓存。
将其更改为以下配置时,它可以工作:
doctrine:
orm:
auto_mapping: true
auto_generate_proxy_classes: false
metadata_cache_driver:
type: pool
pool: doctrine.system_cache_pool
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool
Run Code Online (Sandbox Code Playgroud)
但是我现在使用什么样的缓存?我怎样才能将它切换到apcu?
如何使用 Typoscript 中新集成的 symfony 表达式语言检查页面是否是单一视图(即新闻)?我正在寻找相当于:
[globalVar = GP:tx_news_pi1|news > 0]
我目前正在尝试将云存储文件重命名和/或移动到另一个名称/位置,但我无法让它工作.我使用https://github.com/google/google-api-php-client作为客户端,上传工作正常:
...
$storageService = new \Google_Service_Storage( $client )
$file = new \Google_Service_Storage_StorageObject()
$file->setName( 'test.txt' );
$storageService->objects->insert(
$bucketName,
$file,
array(
'name' => $filename,
'data' => file_get_contents( $somefile )
)
);
...
Run Code Online (Sandbox Code Playgroud)
所以我试图通过$ storageObject-> objects-> update()方法更改文件名,但我找不到任何关于此的文档.我使用$ storageService-> objects-> get($ bucketName,$ fileName)来获取我想要重命名的特定文件(使用$ file-> setName()),但似乎我无法将文件传递给对象 - >更新功能.我做错了吗?
php google-app-engine google-cloud-storage google-api-php-client