PHP code example of mediawiki / smw-file-protect

1. Go to this page and download the library: Download mediawiki/smw-file-protect library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mediawiki / smw-file-protect example snippets


wfLoadExtension( 'SMWFileProtect' );

$SMWFileProtectRights = [ 'sysop' ]; // Groups that can always read files, whatever pages use them
$SMWFileProtectReferNS = true; // Namespace protection based on Lockdown
$SMWFileProtectReferSMW = false; // Property-based protection, below
$SMWFileProtectReferUsers = [ 'Has User' ]; // Page or text properties listing the users (User:Name) allowed to read files used on a page
$SMWFileProtectReferProps = [ 'Is Visible' ]; // Boolean properties that must be true for files used on a page to be readable