mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
fix v1
Former-commit-id: f217f78e8085a81df68b9899513e547e148fca0d
This commit is contained in:
parent
f5088299f3
commit
15cd02a49b
@ -120,6 +120,7 @@ our @EXPORT = qw(
|
|||||||
month_have_days
|
month_have_days
|
||||||
translate_obj
|
translate_obj
|
||||||
valid_regex
|
valid_regex
|
||||||
|
read_file
|
||||||
set_file_permissions
|
set_file_permissions
|
||||||
uri_encode
|
uri_encode
|
||||||
check_server_threads
|
check_server_threads
|
||||||
@ -330,6 +331,28 @@ my @ServerThreads;
|
|||||||
# Keep threads running.
|
# Keep threads running.
|
||||||
our $THRRUN :shared = 1;
|
our $THRRUN :shared = 1;
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
## Reads a file and returns entire content or undef if error.
|
||||||
|
##########################################################################
|
||||||
|
sub read_file {
|
||||||
|
my $path = shift;
|
||||||
|
|
||||||
|
my $_FILE;
|
||||||
|
if( !open($_FILE, "<", $path) ) {
|
||||||
|
# failed to open, return undef
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Slurp configuration file content.
|
||||||
|
my $content = do { local $/; <$_FILE> };
|
||||||
|
|
||||||
|
# Close file
|
||||||
|
close($_FILE);
|
||||||
|
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Sets user:group owner for the given file
|
# Sets user:group owner for the given file
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user