VersionPress\Utils\SecurityUtils::protectDirectory PHP Method

protectDirectory() public static method

Installs .htaccess and web.config to the given path
public static protectDirectory ( string $path )
$path string
    public static function protectDirectory($path)
    {
        $templatesLocation = __DIR__ . "/../Initialization";
        FileSystem::copy("{$templatesLocation}/.htaccess.tpl", "{$path}/.htaccess");
        FileSystem::copy("{$templatesLocation}/web.tpl.config", "{$path}/web.config");
    }

Usage Example

コード例 #1
0
 /**
  * Copies the .htaccess and web.config files into the vpdb directory.
  */
 private function copyAccessRulesFiles()
 {
     SecurityUtils::protectDirectory(VP_PROJECT_ROOT . "/.git");
     SecurityUtils::protectDirectory(VP_VPDB_DIR);
 }
All Usage Examples Of VersionPress\Utils\SecurityUtils::protectDirectory
SecurityUtils