scache_move renames source_path into target_path. If source_path contains subtree, subtree is moved in complete into new target_path. Source and target path's can intersect, subtrees can be moved to it's parent and parent can be move to it's descendant. In case target_path already contains data, target is overwritten with source_path's contents.
TRUE on success, FALSE on failure.
In case of failure, error codes resolvable by scache_lasterr is one of below :
- SCERR_NOT_EXIST Path given does not exist.
- SCERR_NO_SESSION Connected session does not exist or has been expired. Connection is not valid any more.
- SCERR_NOT_CONNECTED Connection to backend is broken and cannot be reconnected.
- SCERR_PROTOCOL Internal protocol error has occurred when communicating to backend. This indicates something is severely broken.
Simple listing :
<?php $sess = scache_reset('MySess'); scache_set($sess, 'my/path/somevalue', 'Move me!'); scache_move($sess, 'my/path', 'my/path/somevalue/overwritten'); scache_move($sess, 'my/path/somevalue/overwritten', 'my'); print_r(scache_get($sess, 'my/somevalue')); /* outputs Move me! */ ?>