System_Folders
[ class tree: System_Folders ] [ index: System_Folders ] [ all elements ]

Source for file cached.php

Documentation is available at cached.php

  1. <?php
  2. require_once 'System/Folders/Cached.php';
  3. $sf = new System_Folders_Cached();
  4.  
  5. //show the path of the config file
  6. echo 'Config file: ' $sf->getDefaultConfigFile("\r\n";
  7.  
  8. //load the stored settings from last time
  9. $err $sf->loadFromFile();
  10.  
  11. echo 'Home:      ' $sf->getHome("\r\n";
  12. echo 'Documents: ' $sf->getDocuments("\r\n";
  13.  
  14. echo "\r\n";
  15.  
  16. $doc $sf->getDocuments();
  17. if (file_exists($doc)) {
  18.     echo "Setting new Documents directory\r\n";
  19.     //Set an own documents directory
  20.     // and save the settings for next time
  21.     $sf->setDocuments('/strange/path/to/MyDocuments/');
  22.     $sf->saveToFile();
  23.     echo 'New Documents directory: ' $sf->getDocuments("\r\n";
  24.     echo "Run this program again to reset the path to default\r\n";
  25. else {
  26.     //unset the path
  27.     echo "Unsetting the documents directory\r\n";
  28.     $sf->setDocuments(null);
  29.     $sf->saveToFile();
  30.     echo 'New Documents directory: ' $sf->getDocuments("\r\n";
  31. }
  32. ?>

Documentation generated on Mon, 11 Mar 2019 15:52:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.