elfinder-flysystem-driver
elfinder-flysystem-driver copied to clipboard
Elfinder connect to GCS
I am trying to make a connection between Eflinder and my GCS Buckets but I don't know how to do it and I can not found a good solutions.
Please help to solve my problem or give me the solution....!
Thanks in advance for your help...
Best Regards,
Did you use https://github.com/Superbalist/flysystem-google-cloud-storage
I checked it already but I don't know to how to configure with Elfinder connector. If you have any idea please guide me.
Thanks in advance!
Seyha
On Fri, Dec 16, 2016 at 2:48 PM, Barry vd. Heuvel [email protected] wrote:
Did you use https://github.com/Superbalist/flysystem-google-cloud-storage
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/barryvdh/elfinder-flysystem-driver/issues/55#issuecomment-267536709, or mute the thread https://github.com/notifications/unsubscribe-auth/ARzj2-DGJsd9MoEBSqKXdVthOW9WdX8iks5rIkJkgaJpZM4LN5I8 .
-- Mr Chroeng Seyha Sangkat Chorm Chao, Khan Por Sen Chey No. 11GE, st. 210 Phnom Penh M: +855 96 58 57 068 E: [email protected]
Setup the GCS flysystem, then add it as a root volume in elFinder
'roots' => [
[
'driver' => 'Flysystem',
'filesystem' => $this->_google_cloud_storage($project_name),
]
]
private function _google_cloud_storage($bucket)
{
$storageClient = new StorageClient([
'projectId' => $project_id,
'keyFilePath' =>$keyfile
]);
$bucket = $storageClient->bucket($bucket);
$adapter = new GoogleStorageAdapter($storageClient, $bucket);
return new Filesystem($adapter);
}
i use helper instead of $this->_google_cloud_storage
function elfinder_gcs($project_id, $bucket, $key_file) {
$storageClient = new StorageClient([
'projectId' => $project_id,
'keyFilePath' => $key_file
]);
$bucket = $storageClient->bucket($bucket);
$adapter = new GoogleStorageAdapter($storageClient, $bucket);
return new Filesystem($adapter);
}
So, my elfinder.php
'roots' => [
[
'driver' => 'Flysystem',
'filesystem' => elfinder_gcs(env('GCS_PROJECT_ID'), env('GCS_STORAGE_BUCKET'),
app_path(
'../'.env('GCS_KEY_FILE')
)
),
]
],
If facing issue where the file not publicly accessible, here is my temporary solution
Thank you @paulcanning
Hi @barryvdh, is there an easy way how to extend the Driver ? I would like to implement thumbnails methods to use google cloud bucket path. i use also https://github.com/Superbalist/flysystem-google-cloud-storage