/bin/mkdir/mkdir.php
PHP | 16 lines | 16 code | 0 blank | 0 comment | 3 complexity | 131783cc0c2695390348894d78b4f128 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
- <?php
- function htsh_mkdir($args) {
- if (isset($args['params'][0])) {
- foreach ($args['params'] as $dir) {
- if (!mkdir($dir)) {
- return array('result' => "Error: I can't do that.");
- }
- }
- return array('result' => '');
- } elseif (in_array('-h', $args['options']) || in_array('--help', $args['options'])) {
- return array('result' => "Usage: mkdir DIRECTORY...\nCreate the DIRECTORY(ies), if they do not already exist.");
- } else {
- return array('result' => 'mkdir --help for help');
- }
- }
- ?>