ez projects / ezsi / forum / general / ezsi files /var/si-blocks/... / re: ezsi files /var/si-bloc...
You need to be logged in to post messages in the forums. New users may register here.
Member since: Posts: 17 |
Wednesday 19 May 2010 4:22:57 pm Hello, I got multiple frontend, and a db cluster (ezdbcluster) behind. I noticed the ezsi files are stored on the filesystem : var/si-blocks/ ... of my frontend. Is there a way to store them within the ezdbfile / data tables ? thanks. Pablo Pernot |
|
|
Member since: Posts: 5 |
Friday 04 June 2010 11:26:35 am Hello,
Is there a way to store them within the ezdbfile / data tables ?Yes, you will need to write your own file handler that will use cluster api instead of direct file calls. To achieve this, a class ezsiclusterfilehandler can be written in folder classes/filehandlers/cluster , defining how to store and delete using cluster api. It should contain something like : public function storeFile( $directory, $fileName, $fileContents ) { $filePath = 'var/'.$directory.'/'.$fileName; $clusterFileHandler = eZClusterFileHandler::instance(); $clusterFileHandler->fileStoreContents( $filePath, $fileContents ); // TODO : Check for a better error handling return true; } .. public function removeFile( $directory, $fileName ) { $filePath = $directory.'/'.$fileName; eZDebug::writeNotice( 'Removing ' . $filePath, __METHOD__ ); $clusterFileHandler = eZClusterFileHandler::instance( $filePath ); $clusterFileHandler->delete(); } This works nice for me. Just check carefully that SI blocks will also be cached by your Varnish as this may strongly increase charge on your database.. Enjoy |
|
|
Member since: Posts: 265 |
Friday 04 June 2010 1:49:26 pm More examples of using the cluster-file-handler to store files: look at the bottom of
http://svn.projects.ez.no/ggsysinfo/modules/sysinfo/storagechurn.php and http://svn.projects.ez.no/ggsysinfo/modules/sysinfo/logchurn.php or http://svn.projects.ez.no/ezwebse...webservicesapi/xmlrpc/initialize.php Principal Consultant International Business |
You need to be logged in to post messages in the forums. New users may register here.