Base of installer for phpMemAdmin. This installer automate the single steps of symlink folders to document root. On Windows the symlink functionality requires administrator privileges on *nix platforms you will need the right to symlink to the folder in general.
Author: Benjamin Carl (opensource@clickalicious.de)
Example #1
0
 /**
  * Validates a path for installation.
  *
  * @param string $path The path to validate
  *
  * @author Benjamin Carl <*****@*****.**>
  * @return string TRUE if path is valid, otherwise FALSE
  * @access protected
  * @throws Exception
  */
 protected static function validatePath($path)
 {
     // Validate path by default logic
     $path = parent::validatePath($path);
     // Collection of existing folders for error message
     $existingFolders = array();
     // Check now if any of the target directories exists
     foreach (self::getFolders() as $folder) {
         if (file_exists($path . $folder)) {
             $existingFolders[] = $folder . '/';
         }
     }
     // Any folder found? => Exception
     if (count($existingFolders) > 0) {
         throw new Exception('The target directory contains the following files/folders already: ' . implode(' & ', $existingFolders) . '.' . PHP_EOL . 'Remove those files/folders first and try again.' . PHP_EOL);
     }
     return $path;
 }