/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
- <?php
- /** For UTF-8: äöü */
- /**
- * Description of Chmod
- *
- * @author Paul Schramenko
- */
- class DirectoryOperations_Strategy_Chmod extends DirectoryOperations_Strategy_Abstract
- {
- public function run(DirectoryOperations_Api_Abstract $obj)
- {
- if (is_file($obj->getPath())) {
- $this->_do($obj, new SplFileInfo($obj->getPath()));
- }
- return $obj->getOutputData();
- }
- public function _do(DirectoryOperations_Api_Abstract $obj, SplFileInfo $fileinfo)
- {
- chmod($fileinfo->getPath() . '/' . $fileinfo->getFilename(), 0777);
- parent::_do($obj, $fileinfo);
- }
- }