PHP code example of mathiasreker / php-chmod
1. Go to this page and download the library: Download mathiasreker/php-chmod 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/ */
mathiasreker / php-chmod example snippets
use MathiasReker\PhpChmod\Scanner;
tFileMode(0644)
->setDefaultDirectoryMode(0755)
->setExcludedFileModes([0400, 0444, 0640])
->setExcludedDirectoryModes([0750])
->scan([__DIR__])
->dryRun();
var_dump($result); // string[]
use MathiasReker\PhpChmod\Scanner;
0644)
->setDefaultDirectoryMode(0755)
->setExcludedFileModes([0400, 0444, 0640])
->setExcludedDirectoryModes([0750])
->scan([__DIR__])
->fix(); // void
$result = new Scanner();
$result->setDefaultFileMode(0644);
$result->setDefaultDirectoryMode(0755);
$result->setExcludedFileModes([0400, 0444, 0640]);
$result->setExcludedDirectoryModes([0750]);
$result->setExcludedNames(['*.rb', '*.py']);
$result->setNames(['*.php']);
$result->setExcludedPaths(['first/dir', 'other/dir']);
$result->doExcludeFiles();
$result->doExcludeDirectories();
$result->scan([__DIR__]);
$result->setPaths($paths);
$result->dryRun();
$result->fix();
bash
composer
bash
docker exec -it php-chmod bash