Created
December 9, 2018 02:08
-
-
Save easychen/f7ecbeefe59063d6bc6c422724f2e9d5 to your computer and use it in GitHub Desktop.
分组存储
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( preg_match("/:save\s(.+?)$/i" , $cmd , $out ) ) | |
{ | |
file_put_contents( "saestor://todo/ttd-easy-". md5($out[1]) .".json" , v('todos') ); | |
$ret['js'] = "alert('Saved to ". $out[1] ." 🤠 ')"; | |
} | |
elseif( preg_match("/:load\s(.+?)$/i" , $cmd , $out ) ) | |
{ | |
if($new_todos = file_get_contents( "saestor://todo/ttd-easy-". md5($out[1]) .".json" )) | |
$ret['js'] = "this.props.store.todo_load_base64('". base64_encode( $new_todos ) ."')"; | |
else | |
$ret['js'] = "alert('Todo list [" . $out . "] not found 🙃 ')"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment