PageRenderTime 77ms CodeModel.GetById 24ms RepoModel.GetById 4ms app.codeStats 0ms

/class/DirectoryOperations/Strategy/Chmod.php

https://bitbucket.org/PSchramenko/php_class_compilation
PHP | 24 lines | 16 code | 2 blank | 6 comment | 1 complexity | 48859ca26da079ba30fc3f1252827714 MD5 | raw file
  1. <?php
  2. /** For UTF-8: äöü */
  3. /**
  4. * Description of Chmod
  5. *
  6. * @author Paul Schramenko
  7. */
  8. class DirectoryOperations_Strategy_Chmod extends DirectoryOperations_Strategy_Abstract
  9. {
  10. public function run(DirectoryOperations_Api_Abstract $obj)
  11. {
  12. if (is_file($obj->getPath())) {
  13. $this->_do($obj, new SplFileInfo($obj->getPath()));
  14. }
  15. return $obj->getOutputData();
  16. }
  17. public function _do(DirectoryOperations_Api_Abstract $obj, SplFileInfo $fileinfo)
  18. {
  19. chmod($fileinfo->getPath() . '/' . $fileinfo->getFilename(), 0777);
  20. parent::_do($obj, $fileinfo);
  21. }
  22. }