initial release of almost completely automatic event rewarder
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
$startTime = microtime(true);
|
||||
|
||||
// we have to figure out XenForo path
|
||||
// dirname(dirname(__FILE__)) should work most of the time
|
||||
// as it was the way XenForo's index.php does
|
||||
// however, sometimes it may not work...
|
||||
// so we have to be creative
|
||||
$parentOfDirOfFile = dirname(dirname(__FILE__));
|
||||
$scriptFilename = (isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '');
|
||||
$pathToCheck = '/src/XF.php';
|
||||
$fileDir = false;
|
||||
if (file_exists($parentOfDirOfFile . $pathToCheck))
|
||||
{
|
||||
$fileDir = $parentOfDirOfFile;
|
||||
}
|
||||
if ($fileDir === false AND !empty($scriptFilename))
|
||||
{
|
||||
$parentOfDirOfScriptFilename = dirname(dirname($scriptFilename));
|
||||
if (file_exists($parentOfDirOfScriptFilename . $pathToCheck))
|
||||
{
|
||||
$fileDir = $parentOfDirOfScriptFilename;
|
||||
}
|
||||
}
|
||||
if ($fileDir === false)
|
||||
{
|
||||
die('XenForo path could not be figured out...');
|
||||
}
|
||||
|
||||
require ($fileDir . '/src/XF.php');
|
||||
|
||||
XF::start($dir);
|
||||
$app = XF::setupApp('XF\Pub\App');
|
||||
|
||||
// Get Upgrade Repository
|
||||
$app->repository('XF:UserUpgrade');
|
||||
|
||||
Reference in New Issue
Block a user