Web Interfaces of PROSUME

app.php 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <?php
  2. $ini = parse_ini_file(dirname(__FILE__).'/../client.ini', true);
  3. $host = $ini['database']['host'] ?? null;
  4. $db = $ini['database']['name'] ?? null;
  5. $user = $ini['database']['user'] ?? null;
  6. $pass = $ini['database']['pass'] ?? null;
  7. $charset = $ini['database']['charset'] ?? null;
  8. return [
  9. /**
  10. * Debug Level:
  11. *
  12. * Production Mode:
  13. * false: No error messages, errors, or warnings shown.
  14. *
  15. * Development Mode:
  16. * true: Errors and warnings shown.
  17. */
  18. 'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),
  19. /**
  20. * Configure basic information about the application.
  21. *
  22. * - namespace - The namespace to find app classes under.
  23. * - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time.
  24. * - encoding - The encoding used for HTML + database connections.
  25. * - base - The base directory the app resides in. If false this
  26. * will be auto detected.
  27. * - dir - Name of app directory.
  28. * - webroot - The webroot directory.
  29. * - wwwRoot - The file path to webroot.
  30. * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to
  31. * use CakePHP pretty URLs, remove these .htaccess
  32. * files:
  33. * /.htaccess
  34. * /webroot/.htaccess
  35. * And uncomment the baseUrl key below.
  36. * - fullBaseUrl - A base URL to use for absolute links. When set to false (default)
  37. * CakePHP generates required value based on `HTTP_HOST` environment variable.
  38. * However, you can define it manually to optimize performance or if you
  39. * are concerned about people manipulating the `Host` header.
  40. * - imageBaseUrl - Web path to the public images directory under webroot.
  41. * - cssBaseUrl - Web path to the public css directory under webroot.
  42. * - jsBaseUrl - Web path to the public js directory under webroot.
  43. * - paths - Configure paths for non class based resources. Supports the
  44. * `plugins`, `templates`, `locales` subkeys, which allow the definition of
  45. * paths for plugins, view templates and locale files respectively.
  46. */
  47. 'App' => [
  48. 'namespace' => 'App',
  49. 'encoding' => env('APP_ENCODING', 'UTF-8'),
  50. 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'it_IT'),
  51. 'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'CET'),
  52. 'base' => false,
  53. 'dir' => 'src',
  54. 'webroot' => 'webroot',
  55. 'wwwRoot' => WWW_ROOT,
  56. //'baseUrl' => env('SCRIPT_NAME'),
  57. 'fullBaseUrl' => false,
  58. 'imageBaseUrl' => 'img/',
  59. 'cssBaseUrl' => 'css/',
  60. 'jsBaseUrl' => 'js/',
  61. 'paths' => [
  62. 'plugins' => [ROOT . DS . 'plugins' . DS],
  63. 'templates' => [APP . 'Template' . DS],
  64. 'locales' => [APP . 'Locale' . DS],
  65. ],
  66. ],
  67. /**
  68. * Security and encryption configuration
  69. *
  70. * - salt - A random string used in security hashing methods.
  71. * The salt value is also used as the encryption key.
  72. * You should treat it as extremely sensitive data.
  73. */
  74. 'Security' => [
  75. 'salt' => env('SECURITY_SALT', 'b9f23aba16cf2fb8a678a48e620406def7f6d11f'),
  76. ],
  77. /**
  78. * Apply timestamps with the last modified time to static assets (js, css, images).
  79. * Will append a querystring parameter containing the time the file was modified.
  80. * This is useful for busting browser caches.
  81. *
  82. * Set to true to apply timestamps when debug is true. Set to 'force' to always
  83. * enable timestamping regardless of debug value.
  84. */
  85. 'Asset' => [
  86. //'timestamp' => true,
  87. // 'cacheTime' => '+1 year'
  88. ],
  89. /**
  90. * Configure the cache adapters.
  91. */
  92. 'Cache' => [
  93. 'default' => [
  94. 'className' => 'Cake\Cache\Engine\FileEngine',
  95. 'path' => CACHE,
  96. 'url' => env('CACHE_DEFAULT_URL', null),
  97. ],
  98. /**
  99. * Configure the cache used for general framework caching.
  100. * Translation cache files are stored with this configuration.
  101. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
  102. * If you set 'className' => 'Null' core cache will be disabled.
  103. */
  104. '_cake_core_' => [
  105. 'className' => 'Cake\Cache\Engine\FileEngine',
  106. 'prefix' => 'myapp_cake_core_',
  107. 'path' => CACHE . 'persistent/',
  108. 'serialize' => true,
  109. 'duration' => '+1 years',
  110. 'url' => env('CACHE_CAKECORE_URL', null),
  111. ],
  112. /**
  113. * Configure the cache for model and datasource caches. This cache
  114. * configuration is used to store schema descriptions, and table listings
  115. * in connections.
  116. * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
  117. */
  118. '_cake_model_' => [
  119. 'className' => 'Cake\Cache\Engine\FileEngine',
  120. 'prefix' => 'myapp_cake_model_',
  121. 'path' => CACHE . 'models/',
  122. 'serialize' => true,
  123. 'duration' => '+1 years',
  124. 'url' => env('CACHE_CAKEMODEL_URL', null),
  125. ],
  126. /**
  127. * Configure the cache for routes. The cached routes collection is built the
  128. * first time the routes are processed via `config/routes.php`.
  129. * Duration will be set to '+2 seconds' in bootstrap.php when debug = true
  130. */
  131. '_cake_routes_' => [
  132. 'className' => 'Cake\Cache\Engine\FileEngine',
  133. 'prefix' => 'myapp_cake_routes_',
  134. 'path' => CACHE,
  135. 'serialize' => true,
  136. 'duration' => '+1 years',
  137. 'url' => env('CACHE_CAKEROUTES_URL', null),
  138. ],
  139. ],
  140. /**
  141. * Configure the Error and Exception handlers used by your application.
  142. *
  143. * By default errors are displayed using Debugger, when debug is true and logged
  144. * by Cake\Log\Log when debug is false.
  145. *
  146. * In CLI environments exceptions will be printed to stderr with a backtrace.
  147. * In web environments an HTML page will be displayed for the exception.
  148. * With debug true, framework errors like Missing Controller will be displayed.
  149. * When debug is false, framework errors will be coerced into generic HTTP errors.
  150. *
  151. * Options:
  152. *
  153. * - `errorLevel` - int - The level of errors you are interested in capturing.
  154. * - `trace` - boolean - Whether or not backtraces should be included in
  155. * logged errors/exceptions.
  156. * - `log` - boolean - Whether or not you want exceptions logged.
  157. * - `exceptionRenderer` - string - The class responsible for rendering
  158. * uncaught exceptions. If you choose a custom class you should place
  159. * the file for that class in src/Error. This class needs to implement a
  160. * render method.
  161. * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that
  162. * extend one of the listed exceptions will also be skipped for logging.
  163. * E.g.:
  164. * `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']`
  165. * - `extraFatalErrorMemory` - int - The number of megabytes to increase
  166. * the memory limit by when a fatal error is encountered. This allows
  167. * breathing room to complete logging or error handling.
  168. */
  169. 'Error' => [
  170. 'errorLevel' => E_ALL,
  171. 'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
  172. 'skipLog' => [],
  173. 'log' => true,
  174. 'trace' => true,
  175. ],
  176. /**
  177. * Email configuration.
  178. *
  179. * By defining transports separately from delivery profiles you can easily
  180. * re-use transport configuration across multiple profiles.
  181. *
  182. * You can specify multiple configurations for production, development and
  183. * testing.
  184. *
  185. * Each transport needs a `className`. Valid options are as follows:
  186. *
  187. * Mail - Send using PHP mail function
  188. * Smtp - Send using SMTP
  189. * Debug - Do not send the email, just return the result
  190. *
  191. * You can add custom transports (or override existing transports) by adding the
  192. * appropriate file to src/Mailer/Transport. Transports should be named
  193. * 'YourTransport.php', where 'Your' is the name of the transport.
  194. */
  195. 'EmailTransport' => [
  196. 'default' => [
  197. 'className' => 'Cake\Mailer\Transport\MailTransport',
  198. /*
  199. * The following keys are used in SMTP transports:
  200. */
  201. 'host' => '1.1.1.1',
  202. 'port' => 25,
  203. 'timeout' => 30,
  204. 'username' => null,
  205. 'password' => null,
  206. 'client' => null,
  207. 'tls' => null,
  208. 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
  209. ],
  210. ],
  211. /**
  212. * Email delivery profiles
  213. *
  214. * Delivery profiles allow you to predefine various properties about email
  215. * messages from your application and give the settings a name. This saves
  216. * duplication across your application and makes maintenance and development
  217. * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
  218. * for more information.
  219. */
  220. 'Email' => [
  221. 'default' => [
  222. 'transport' => 'default',
  223. 'from' => 'you@localhost',
  224. //'charset' => 'utf-8',
  225. //'headerCharset' => 'utf-8',
  226. ],
  227. ],
  228. /**
  229. * Connection information used by the ORM to connect
  230. * to your application's datastores.
  231. *
  232. * ### Notes
  233. * - Drivers include Mysql Postgres Sqlite Sqlserver
  234. * See vendor\cakephp\cakephp\src\Database\Driver for complete list
  235. * - Do not use periods in database name - it may lead to error.
  236. * See https://github.com/cakephp/cakephp/issues/6471 for details.
  237. * - 'encoding' is recommended to be set to full UTF-8 4-Byte support.
  238. * E.g set it to 'utf8mb4' in MariaDB and MySQL and 'utf8' for any
  239. * other RDBMS.
  240. */
  241. 'Datasources' => [
  242. 'default' => [
  243. 'className' => 'Cake\Database\Connection',
  244. 'driver' => 'Cake\Database\Driver\Mysql',
  245. 'persistent' => false,
  246. 'host' => $host,
  247. /*
  248. * CakePHP will use the default DB port based on the driver selected
  249. * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
  250. * the following line and set the port accordingly
  251. */
  252. //'port' => 'non_standard_port_number',
  253. 'username' => $user,
  254. 'password' => $pass,
  255. 'database' => $db,
  256. /*
  257. * You do not need to set this flag to use full utf-8 encoding (internal default since CakePHP 3.6).
  258. */
  259. //'encoding' => 'utf8mb4',
  260. 'timezone' => 'UTC',
  261. 'flags' => [],
  262. 'cacheMetadata' => true,
  263. 'log' => false,
  264. /**
  265. * Set identifier quoting to true if you are using reserved words or
  266. * special characters in your table or column names. Enabling this
  267. * setting will result in queries built using the Query Builder having
  268. * identifiers quoted when creating SQL. It should be noted that this
  269. * decreases performance because each query needs to be traversed and
  270. * manipulated before being executed.
  271. */
  272. 'quoteIdentifiers' => false,
  273. /**
  274. * During development, if using MySQL < 5.6, uncommenting the
  275. * following line could boost the speed at which schema metadata is
  276. * fetched from the database. It can also be set directly with the
  277. * mysql configuration directive 'innodb_stats_on_metadata = 0'
  278. * which is the recommended value in production environments
  279. */
  280. //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  281. 'url' => env('DATABASE_URL', null),
  282. ],
  283. /**
  284. * The test connection is used during the test suite.
  285. */
  286. 'test' => [
  287. 'className' => 'Cake\Database\Connection',
  288. 'driver' => 'Cake\Database\Driver\Mysql',
  289. 'persistent' => false,
  290. 'host' => 'localhost',
  291. //'port' => 'non_standard_port_number',
  292. 'username' => 'my_app',
  293. 'password' => 'secret',
  294. 'database' => 'test_myapp',
  295. //'encoding' => 'utf8mb4',
  296. 'timezone' => 'UTC',
  297. 'cacheMetadata' => true,
  298. 'quoteIdentifiers' => false,
  299. 'log' => false,
  300. //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
  301. 'url' => env('DATABASE_TEST_URL', null),
  302. ],
  303. ],
  304. /**
  305. * Configures logging options
  306. */
  307. 'Log' => [
  308. 'debug' => [
  309. 'className' => 'Cake\Log\Engine\FileLog',
  310. 'path' => LOGS,
  311. 'file' => 'debug',
  312. 'url' => env('LOG_DEBUG_URL', null),
  313. 'scopes' => false,
  314. 'levels' => ['notice', 'info', 'debug'],
  315. ],
  316. 'error' => [
  317. 'className' => 'Cake\Log\Engine\FileLog',
  318. 'path' => LOGS,
  319. 'file' => 'error',
  320. 'url' => env('LOG_ERROR_URL', null),
  321. 'scopes' => false,
  322. 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
  323. ],
  324. // To enable this dedicated query log, you need set your datasource's log flag to true
  325. 'queries' => [
  326. 'className' => 'Cake\Log\Engine\FileLog',
  327. 'path' => LOGS,
  328. 'file' => 'queries',
  329. 'url' => env('LOG_QUERIES_URL', null),
  330. 'scopes' => ['queriesLog'],
  331. ],
  332. ],
  333. /**
  334. * Session configuration.
  335. *
  336. * Contains an array of settings to use for session configuration. The
  337. * `defaults` key is used to define a default preset to use for sessions, any
  338. * settings declared here will override the settings of the default config.
  339. *
  340. * ## Options
  341. *
  342. * - `cookie` - The name of the cookie to use. Defaults to 'CAKEPHP'. Avoid using `.` in cookie names,
  343. * as PHP will drop sessions from cookies with `.` in the name.
  344. * - `cookiePath` - The url path for which session cookie is set. Maps to the
  345. * `session.cookie_path` php.ini config. Defaults to base path of app.
  346. * - `timeout` - The time in minutes the session should be valid for.
  347. * Pass 0 to disable checking timeout.
  348. * Please note that php.ini's session.gc_maxlifetime must be equal to or greater
  349. * than the largest Session['timeout'] in all served websites for it to have the
  350. * desired effect.
  351. * - `defaults` - The default configuration set to use as a basis for your session.
  352. * There are four built-in options: php, cake, cache, database.
  353. * - `handler` - Can be used to enable a custom session handler. Expects an
  354. * array with at least the `engine` key, being the name of the Session engine
  355. * class to use for managing the session. CakePHP bundles the `CacheSession`
  356. * and `DatabaseSession` engines.
  357. * - `ini` - An associative array of additional ini values to set.
  358. *
  359. * The built-in `defaults` options are:
  360. *
  361. * - 'php' - Uses settings defined in your php.ini.
  362. * - 'cake' - Saves session files in CakePHP's /tmp directory.
  363. * - 'database' - Uses CakePHP's database sessions.
  364. * - 'cache' - Use the Cache class to save sessions.
  365. *
  366. * To define a custom session handler, save it at src/Network/Session/<name>.php.
  367. * Make sure the class implements PHP's `SessionHandlerInterface` and set
  368. * Session.handler to <name>
  369. *
  370. * To use database sessions, load the SQL file located at config/schema/sessions.sql
  371. */
  372. 'Session' => [
  373. 'defaults' => 'cake'
  374. ],
  375. ];