Skip to content

Commit 9246c0f

Browse files
committed
Update example
1 parent 4420231 commit 9246c0f

File tree

1 file changed

+77
-6
lines changed

1 file changed

+77
-6
lines changed

application-example.php

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44
THIS IS A TEMPLATE! Pick what you need for your app
55
**********************************************************/
66
return array(
7+
// The Application class
78
'application' => 'MyWebApp\\Application',
9+
// The theme
810
'theme' => 'WebApp\\BootstrapTheme\\BootstrapTheme',
11+
// The name as it appears in page headers
912
'name' => 'My Bootstrap App',
10-
//'brandLogo' => 'my-logo.png',
13+
// A logo (used in layouts)
14+
'brandLogo' => 'my-logo.png',
15+
// A copyright for a footer
1116
'copyright' => '© '.date('Y').' by TechnicalGuru',
12-
'debug' => true,
17+
// Be verbose about messages in UI (Do not enable in productive environments)
18+
'debug' => false,
19+
// Switch on maintenance mode when you dont want front-end users to use yr app
20+
'maintenance' => false,
21+
22+
// The router class for your app
1323
'router' => array(
1424
'class' => 'WebApp\\Router',
1525
'config' => array(
@@ -28,27 +38,82 @@
2838
'logout' => '/index.html',
2939
'forget_password' => '/forgot-password.html',
3040
),
41+
// Configuration of a vault (github.com/technicalguru/php-vault)
42+
'vault' => array(
43+
// see php-vault doc for possible types
44+
'type' => 'none',
45+
// see php-vault doc for config
46+
'config' => array(
47+
// Only for hashicorp vaults
48+
'uri' => 'http://myvault',
49+
'roleId' => 'roleId',
50+
'secretId' => 'secretId',
51+
'renewTokens' => false,
52+
'maxTtl' => 900,
53+
// Only for file vaults
54+
'filename' => '/etc/ticketing.secrets',
55+
// Only for memory vault
56+
'secrets' => '{"json-values"}',
57+
),
58+
),
59+
// see github.com/technicalguru/php-database
3160
'database' => array(
3261
'host' => 'my-db-host',
3362
'port' => 3306,
34-
'user' => 'my-db-user',
35-
'pass' => 'my-db-password',
3663
'dbname' => 'my-db-instance-name',
3764
'tablePrefix' => 'mywebapp_',
65+
// Specify where in vault the username and secret is
66+
'security' => array(
67+
'type' => 'vault',
68+
'path' => '/path/to/vault/secret',
69+
),
70+
// Or simply give auth data here
71+
'user' => 'my-db-user',
72+
'pass' => 'my-db-password',
3873
),
74+
// Use a data model
3975
'dataModel' => true,
40-
'authentication' => 'WebApp\\Auth\\UserDatabaseAuthenticator',
41-
'authorization' => 'WebApp\\Auth\\UserRoleAuthorizator',
76+
// Use a service factory
77+
'serviceFactory' => array(
78+
'class' => 'MyWebApp\\Service\\ServiceFactory',
79+
),
80+
// Use your own User class (recommended)
81+
'authentication' => array(
82+
'class' => 'WebApp\\Auth\\UserDatabaseAuthenticator',
83+
'config' => array(
84+
'modelClass' => 'MyWebApp\\DataModel\\User',
85+
),
86+
),
87+
// Alternative default usage:
88+
// 'authentication' => 'WebApp\\Auth\\UserDatabaseAuthenticator',
89+
90+
// Configure the authorizator class
91+
'authorization' => array(
92+
'class' => 'WebApp\\Auth\\UserRoleAuthorizator',
93+
'config' => array(
94+
// Configure here
95+
),
96+
),
97+
// Alternative default usage:
98+
// 'authorization' => 'WebApp\\Auth\\UserRoleAuthorizator',
99+
100+
// Mail config, see github.com/technicalguru/php-email
42101
'mailQueue' => array(
43102
'timezone' => 'Europe/Berlin',
44103
'mailMode' => 'reroute',
104+
// Use username and password from vault
105+
'security' => array(
106+
'type' => 'vault',
107+
'path' => '/path/to/vault/secret',
108+
),
45109
'smtpConfig' => array(
46110
'host' => 'my-smtp-server',
47111
'port' => 587,
48112
'debugLevel' => 0,
49113
'auth' => true,
50114
'secureOption' => 'starttls',
51115
'charset' => 'utf8',
116+
// Only when not using a vault
52117
'credentials' => array(
53118
'user' => 'my-smtp-username',
54119
'pass' => 'my-smtp-password',
@@ -65,5 +130,11 @@
65130
'defaultSender' => 'My WebApp <noreply@example.com>',
66131
'subjectPrefix' => '[My WebApp] ',
67132
),
133+
// Log Level, see github.com/technicalguru/php-utils
134+
'logLevel' => "error",
135+
// Save error messages in database
136+
'logErrors' => true,
137+
// Save simplified access log in database
138+
'accessLog' => true,
68139
);
69140

0 commit comments

Comments
 (0)