properly use BASEPATH in global config, created shared file for crons

This commit is contained in:
Sebastian Grewe 2013-05-10 19:59:54 +02:00
parent ef4b9fd21d
commit b9904a5eee
4 changed files with 42 additions and 20 deletions

View File

@ -18,18 +18,8 @@ limitations under the License.
*/
// MODIFY THIS
// We need to find our include files so set this properly
define("BASEPATH", "../public/");
// Our security check
define("SECURITY", 1);
// Include our configuration (holding defines for the requires)
require_once(BASEPATH . '/include/config/global.inc.php');
// We include all needed files here, even though our templates could load them themself
require_once(BASEPATH . INCLUDE_DIR . '/autoloader.inc.php');
// Include all settings and classes
require_once('shared.inc.php');
// Fetch our last block found from the DB as a starting point
$strLastBlockHash = $block->getLast()->blockhash;

32
cronjobs/shared.inc.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/*
Copyright:: 2013, Sebastian Grewe
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// MODIFY THIS
// We need to find our include files so set this properly
define("BASEPATH", "../public/");
// Our security check
define("SECURITY", 1);
// Include our configuration (holding defines for the requires)
require_once(BASEPATH . '/include/config/global.inc.php');
// We include all needed files here, even though our templates could load them themself
require_once(BASEPATH . INCLUDE_DIR . '/autoloader.inc.php');

View File

@ -1,10 +1,10 @@
<?php
require_once(BASEPATH . CLASS_DIR . '/debug.class.php');
require_once(BASEPATH . CLASS_DIR . '/bitcoin.class.php');
require_once(BASEPATH . INCLUDE_DIR . '/database.inc.php');
require_once(BASEPATH . INCLUDE_DIR . '/smarty.inc.php');
require_once(CLASS_DIR . '/debug.class.php');
require_once(CLASS_DIR . '/bitcoin.class.php');
require_once(INCLUDE_DIR . '/database.inc.php');
require_once(INCLUDE_DIR . '/smarty.inc.php');
// Load classes that need the above as dependencies
require_once(BASEPATH . CLASS_DIR . '/user.class.php');
require_once(BASEPATH . CLASS_DIR . '/block.class.php');
require_once(BASEPATH . CLASS_DIR . '/settings.class.php');
require_once(CLASS_DIR . '/user.class.php');
require_once(CLASS_DIR . '/block.class.php');
require_once(CLASS_DIR . '/settings.class.php');

View File

@ -7,7 +7,7 @@ if (!defined('SECURITY'))
define('THEME', 'mmcFE');
// Our include directory for additional features
define('INCLUDE_DIR', 'include');
define('INCLUDE_DIR', BASEPATH . 'include');
// Our class directory
define('CLASS_DIR', INCLUDE_DIR . '/classes');