Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
27b4991b
Verified
Commit
27b4991b
authored
Aug 04, 2018
by
noplanman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner boot script.
parent
667696f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
boot.php
boot.php
+23
-4
No files found.
boot.php
View file @
27b4991b
...
...
@@ -2,13 +2,20 @@
use
RedBeanPHP\R
;
require_once
__DIR__
.
'/vendor/autoload.php'
;
function
c
(
$param
=
null
,
$default
=
null
)
/**
* Helper to get config values.
*
* @param null|string $param
* @param null|mixed $default
*
* @return mixed|null
*/
function
c
(
string
$param
=
null
,
$default
=
null
)
{
static
$config
;
if
(
$config
===
null
)
{
$config
=
require
__DIR__
.
'/config.php'
;
is_array
(
$config
)
||
die
(
'Invalid config format.'
);
}
if
(
$param
===
null
)
{
...
...
@@ -24,7 +31,19 @@ function c($param = null, $default = null)
define
(
'PODUPTIME'
,
microtime
(
true
));
require_once
__DIR__
.
'/vendor/autoload.php'
;
// Set up global DB connection.
R
::
setup
(
'pgsql:host='
.
c
(
'pghost'
)
.
';dbname='
.
c
(
'pgdb'
),
c
(
'pguser'
),
c
(
'pgpass'
),
true
);
R
::
setup
(
sprintf
(
'pgsql:host=%s;port=%d;dbname=%s'
,
c
(
'pghost'
),
c
(
'pgport'
,
5432
),
c
(
'pgdb'
)
),
c
(
'pguser'
),
c
(
'pgpass'
),
true
);
R
::
testConnection
()
||
die
(
'Error in DB connection'
);
R
::
usePartialBeans
(
true
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment