Reference/Core

Core.php Reference

Configuration Keys

lepton.mailer.*

lepton.mailer: controls sending of emails from the application. The supported values for backend is SMTP, SENDMAIL, and PEAR. You can add additional backend by creating a "NameMailerBackend?" class extending "MailerBackend?".

config::set('lepton.mailer.backend','smtp'); 
config::set('lepton.mailer.smtp.server','your.smtp.server');

lepton.dbx.*

lepton.dbx: The new minty fresh database api. Hostname, Port, Username, Password, Database and Type should be fairly obvious. Cluster sets the role of the server in the set. "R" for Reading queries, "W" for Writing (updating) queries. The number specifies priority. The lower the value, the higher the priority.

Place any additional set in lepton.dbx.sets.SETNAME

config::set('lepton.dbx.sets.default', array(
	// First host in set. Handles both reads and writes.
	'localhost' => array(
		'hostname'	=> 'db.host.tld',
		'port'		=> null,
		'username'	=> 'username',
		'password'	=> 'password',
		'database'	=> 'database',
		'type'		=> 'mysqli',
		'cluster'	=> 'RW 2'
	),
	// Second host in set, this one handles reads only.
	'replicated' => array(
		'hostname'	=> 'db2.host.tld',
		'port'		=> null,
		'username'	=> 'username',
		'password'	=> 'password',
		'database'	=> 'database',
		'type'		=> 'mysqli',
		'cluster'	=> 'R 1'
	)
));
// Select what set to load as default, if the load should be balanced
// evenly to hosts. This one might be a bit funky. Cache sets the lifetime
// of the items in the query cache. Set to 0 or null to disable.
config::set('lepton.dbx.options.defaultset','default'); 
config::set('lepton.dbx.options.balanceload',true); // Distribute hosts
config::set('lepton.dbx.options.cache',300); // Cache for 5 minutes
config::set('lepton.dbx.options.exclusivereaders',false); // If true, a writer will never be used as a reader
config::set('lepton.dbx.lockschemas',false); // Set to true on production system

lepton.mvc.*

Controllers to handle specific events. Specify as a string containing both the controller and the method to call, like "Test:method".

config::set('lepton.mvc.map.errorcontroller',null);
config::set('lepton.mvc.map.accesscontroller',null);
config::set('lepton.mvc.map.notfoundcontroller',null);
// Routing support - to be implemented
config::set('lepton.mvc.router',null);
// Global autoloading. Set this to an array of classes with classnames
// to import to all controllers and models. F.ex. 'siteapi'=>SiteAPILib
config::set('lepton.mvc.globals',null);
// lepton.core - Foundation features
config::set('lepton.core.production', false);
config::set('lepton.core.errorpage', DefaultErrorPage);

lepton.i18n.*

i18n support

config::set('lepton.i18n.defaultlanguage','en-us');
config::set('lepton.i18n.namedarguments',false); // use {name} and array and 2nd parm

Authentication configuration

Authentication libraries:

lepton.users - For the Users library

config::set('lepton.users.default.active',false);
config::set('lepton.users.default.flags','+r');
config::set('lepton.users.loggedout.flags','');

lepton.openid - For the Lepton OpenID support

config::set('lepton.openid.trustroot','');
config::set('lepton.openid.approvedurl','');
config::set('lepton.openid.cancelurl','');
config::set('lepton.openid.fields.required',array());
config::set('lepton.openid.fields.optional',array());

lepton.rpx - For the Lepton RPX library

config::set('lepton.rpx.apikey', null);
config::set('lepton.rpx.domain', null);

Cookie authentication provider. You should provide a random string here which is used to encrypt the cookie data. Compromising this key could be bad.

config::set('lepton.cookieauth.key', null);

lepton.captcha.*

Note: Font search paths are by default ./, ./fonts/, ../ and /usr/share/fonts/truetype/

// Captcha library configuration
config::set('lepton.captcha.textlength', 5);
config::set('lepton.captcha.font', null);
config::set('lepton.captcha.fontsize', 18);
config::set('lepton.captcha.width', 160);
config::set('lepton.captcha.height', 40);

lepton.graphics.*

Note: The default value for the lepton.graphics.* keys are hardcoded in the file graphics.php. They can however be overridden by providing a new value for the appropriate key.

config::set('lepton.graphics.fontpaths', array(
   './',
   './fonts/',
   '../',
   '/usr/share/fonts/truetype/'
));

lepton.avatars.*

Experimental avatar support for the Lepton users class.

// Avatars for the user library. The defaultprovider is the one that is expected to handle
// the setAvatar() call.
config::set('lepton.avatars.providers', array(
    LocalAvatarProvider,
    GravatarAvatarProvider
));
config::set('lepton.avatars.defaultprovider', LocalAvatarProvider);
config::set('lepton.avatars.defaultsize', 64);
config::set('lepton.avatars.gravatars.default','identicon');

lepton.ldwp.*

For LDWP

config::set('lepton.ldwp.enabled',false);
config::set('lepton.ldwp.worker.name','worker1');
config::set('lepton.ldwp.server.name','server1');
config::set('tepton.ldwp.server.workers',array(
	'worker1',
	'worker2',
	'worker3'
));
config::set('lepton.ldwp.worker.maxjobs','5');
config::set('lepton.ldwp.server.key','InSeRtArAnDoMkEyHeRe%WFM');

lepton.session.*

lepton.session - The Lepton Extended Session management classes. Pick the desired backend, specify the domains to share the session cookies, and enjoy. Just remember to prepend a dot to the domain name to include all subdomains, i.e. ".noccy.com" for "lepton.noc..", "www.noc.." etc.

config::set('lepton.sessions.autostart', true);
config::set('lepton.sessions.backend', null);
config::set('lepton.sessions.domain', null);
config::set('lepton.sessions.expires', 1200); // 20 minutes

Other directives

Lepton::using(module)

Loads a library or a module. Looks for the file in several folders including the project root.

Lepton::autoload(library[,load_as])

Causes the specified library to be autoloaded into your controllers.