Here's an abbreviated version of my config file:
<?php
/**
* Set some path properties used in config
*/
$FS = '/var/www/htdocs/';
$WEB = '';
/* Categories of configuration are listed first. One-offs are listed after */
$Config = new Phalcon\Config([
,'dirs' => ['config' => $FS.'/app/config'
,'app' => $FS.'/app'
,'app_web' => $WEB
,'assets_web' => $WEB.'/public/assets'
,'file_budget' => realpath($_SERVER['DOCUMENT_ROOT'].'/../uploads/budget')
,'file_acceptance' => realpath($_SERVER['DOCUMENT_ROOT'].'/../uploads/acceptance')
,'file_user' => realpath($_SERVER['DOCUMENT_ROOT'].'/../uploads/user')
,'public' => $FS.'/public'
,'public_web' => $WEB.'/public'
,'views' => $FS.'/app/views'
,'views_compile' => $FS.'/app/views/compiled/'
]
,'username_max_length' => 20
]
);
return $Config;
And how it is put into my DI in my bootstrap.php
$Config = require 'config.php';
$DI->setShared('config',$Config);
Little known fact: Files you reference with include()
and require()
can return a value.