pub / rememori

Simple file-based bookmarking and notes application
git clone https://src.jayvii.de/pub/rememori.git
Home | Log | Files | Exports | Refs | README | RSS

delete.php (480B)


      1 <?php
      2 
      3 function delete_note(
      4     string $user,
      5     string $category,
      6     string $filename,
      7 ) {
      8 
      9     /* Create full file path name */
     10     $dirpath = $GLOBALS["data_dir"] . "/" . $user . "/" . $category;
     11     $filepath = $dirpath . "/" . $filename;
     12 
     13     /* delete note */
     14     $status = unlink($filepath);
     15 
     16     /* cleanup directories and removed empty categories */
     17     remove_empty_categories($user, $category);
     18 
     19     /* return status of deletion action */
     20     return $status;
     21 }
     22 
     23 ?>
     24