PageRenderTime 46ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/bin/mkdir/mkdir.php

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