Newer
Older
backup-commander / src / index.php
<?php

/**
	BACKUP COMMANDER VERIOSN 2
	==========================

		So far, we have created a new composer project, imported Amara and run it successfully.
		Before going any further, I need to organise the HTML.
		I will do this by creating a template engine as part of Amara.
		
*/
 
	session_start();

	require dirname(__DIR__)."/vendor/autoload.php";

	use \Johnpearcey\Amara\AmaraApp;
	use \Johnpearcey\Amara\JPLogger;

	JPLogger::init( dirname(__DIR__).'/logs', Psr\Log\LogLevel::DEBUG );
	JPLogger::get()->info("*** Request start ***");

	// database required for backup commander and Amara
	$db = new \PDO('sqlite:'.__DIR__.'/data/data.db');
		
	// secret properties, logins for email etc.
	$local_props_json = __DIR__."/bu-command-local-conf.json";
	
	// Init Amara application using it's own nav defaults
	$app = new AmaraApp( $db, $local_props_json );

	//set globals
	$app->setGlobals( __DIR__.'/bu-command-nav.json' );

	// settings and overrides for "Handlers" and "Navigate"		
	$app->setAdditional_Nav_Rq( __DIR__.'/bu-command-nav.json' );

	// settings and overrides "Templates"
	$app->setAdditional_Templates( __DIR__.'/bu-command-pages.json' );

	// settings and overrides "PageBuilder" and "DataSources"
	$app->setAdditional_PageBuilder( __DIR__.'/bu-command-pages.json' );

	// Start Amara application
	$app->run( );
	
?>