„LnxUser::getGroup” változatai közötti eltérés
Innen: IT documentation
(Üres oldal létrehozva) |
Nincs szerkesztési összefoglaló |
||
| (Egy közbenső módosítás ugyanattól a szerkesztőtől nincs mutatva) | |||
| 1. sor: | 1. sor: | ||
== Description == | |||
Object-oriented style<syntaxhighlight lang="php"> | |||
public lnxUser::getGroup ( string | int $group ): array | |||
</syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | |||
lnxGetGroup ( string | int $group ): array | |||
</syntaxhighlight> | |||
Returns informations about the linux group. | |||
== Parameters == | |||
; group | |||
: Name or Group ID of linux group. | |||
== Return Values == | |||
Returns an '''array''' what contains the information about group, or '''false''' if group is not exists. | |||
Structure of array: | |||
[ | |||
; 'name' => string | |||
: Name of linux group. | |||
; 'gid' => int | |||
: Group ID of linux group. | |||
; 'members' => array | |||
: It is a simple indexed array what contains the users who is member of this group. Note: Contains the users too to whom this group is primary group! | |||
] | |||
== Changelog == | |||
{| class="wikitable" | |||
!Version<br>(lnxUser) | |||
!Description | |||
|- | |||
|1.00 | |||
|available | |||
|} | |||
== Examples == | |||
<syntaxhighlight lang="php"> | |||
$group = 'testGroup'; | |||
# Query information about the linux group | |||
print( "Information of '$group' group:" . PHP_EOL ); | |||
if ( lnxExistsGroup( $group ) ) | |||
foreach ( lnxGetGroup ( $group ) as $key => $value ) { | |||
print( $key . ' : ' ); | |||
if ( is_array( $value ) ) | |||
print( implode ( ',', $value ) ); | |||
else | |||
print( $value ); | |||
print( PHP_EOL ); | |||
} | |||
</syntaxhighlight> | |||
[[Kategória:LnxUser]] | |||
A lap jelenlegi, 2021. szeptember 19., 15:42-kori változata
Description
Object-oriented style
public lnxUser::getGroup ( string | int $group ): array
Procedural style
lnxGetGroup ( string | int $group ): array
Returns informations about the linux group.
Parameters
- group
- Name or Group ID of linux group.
Return Values
Returns an array what contains the information about group, or false if group is not exists.
Structure of array:
[
- 'name' => string
- Name of linux group.
- 'gid' => int
- Group ID of linux group.
- 'members' => array
- It is a simple indexed array what contains the users who is member of this group. Note: Contains the users too to whom this group is primary group!
]
Changelog
| Version (lnxUser) |
Description |
|---|---|
| 1.00 | available |
Examples
$group = 'testGroup';
# Query information about the linux group
print( "Information of '$group' group:" . PHP_EOL );
if ( lnxExistsGroup( $group ) )
foreach ( lnxGetGroup ( $group ) as $key => $value ) {
print( $key . ' : ' );
if ( is_array( $value ) )
print( implode ( ',', $value ) );
else
print( $value );
print( PHP_EOL );
}