Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "cluster/storeFile" cluster event #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/features/4.7/cluster_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ Try to use constants instead or configuration objects passed to your custom gate
- `cluster/storeMetadata` - **Notification**.
The metadata array is passed as argument.

- `cluster/storeFile` - **Notification**.
The file path, datatype and scope are passed as arguments.

- `cluster/loadMetadata` - **Filter**.
File path we need metadata from is passed as argument.
Must return an the metadata array or false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ function _store( $filePath, $datatype, $scope, $fname = false )
$return = $this->_protect( array( $this, '_storeInner' ), $fname,
$filePath, $datatype, $scope, $fname );

$this->eventHandler->notify( 'cluster/deleteFile', array( $filePath ) );
$this->eventHandler->notify( 'cluster/storeFile', array( $filePath, $datatype, $scope ) );

return $return;
}
Expand Down Expand Up @@ -2006,6 +2006,7 @@ public function registerListener( eZClusterEventListener $listener )
'cluster/storeMetadata',
'cluster/loadMetadata',
'cluster/fileExists',
'cluster/storeFile',
'cluster/deleteFile',
'cluster/deleteByLike',
'cluster/deleteByDirList',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,14 @@ public function deleteByDirList( array $dirList, $commonPath, $commonSuffix );
* @return void
*/
public function deleteByNametrunk( $nametrunk );

/**
* Notifies of a storeFile operation
*
* @param string $filePath
* @param string $datatype
* @param string $scope
* @return void
*/
public function storeFile( $filePath, $datatype, $scope );
}