$session->storeAllRepository( $filename )
The storeAllRepository() function saves the repository in the named file, which is located in the directory $SM_HOME/repos. The directory name must not contain any path separator characters.
$session->saveAllRepository( "save.rps" );