WP_Filesystem_SSH2::chgrp() public WP 2.7.0
Changes the file group.
{} Это метод класса: WP_Filesystem_SSH2{}
Хуков нет.
Возвращает
true/false. True on success, false on failure.
Использование
$WP_Filesystem_SSH2 = new WP_Filesystem_SSH2(); $WP_Filesystem_SSH2->chgrp( $file, $group, $recursive );
- $file(строка) (обязательный)
- Path to the file.
- $group(строка/число) (обязательный)
- A group name or number.
- $recursive(true/false)
- If set to true, changes file group recursively.
По умолчанию: false
Список изменений
С версии 2.7.0 | Введена. |
Код WP_Filesystem_SSH2::chgrp() WP Filesystem SSH2::chgrp WP 5.6.2
public function chgrp( $file, $group, $recursive = false ) {
if ( ! $this->exists( $file ) ) {
return false;
}
if ( ! $recursive || ! $this->is_dir( $file ) ) {
return $this->run_command( sprintf( 'chgrp %s %s', escapeshellarg( $group ), escapeshellarg( $file ) ), true );
}
return $this->run_command( sprintf( 'chgrp -R %s %s', escapeshellarg( $group ), escapeshellarg( $file ) ), true );
}