Example #1
0
/**
 *
 * Check to see if the setup script needs to be run
 */
function checkInstall()
{
    preg_match('|([^-]*)|', ZENPHOTO_VERSION, $version);
    if ($i = getOption('zenphoto_install')) {
        $install = getSerializedArray($i);
    } else {
        $install = array('ZENPHOTO' => '0.0.0[0000]');
    }
    preg_match('|([^-]*).*\\[(.*)\\]|', $install['ZENPHOTO'], $matches);
    if (isset($matches[1]) && isset($matches[2]) && $matches[1] != $version[1] || $matches[2] != ZENPHOTO_RELEASE || (time() & 7) == 0 && OFFSET_PATH != 2 && $i != serialize(installSignature())) {
        require_once dirname(__FILE__) . '/reconfigure.php';
        reconfigureAction(0);
    }
}
Example #2
0
/**
 * Force a setup to get the configuration right
 *
 * @param int $action if positive the setup is mandatory
 *
 * @author Stephen Billard
 * @Copyright 2015 by Stephen L Billard for use in {@link https://github.com/ZenPhoto20/ZenPhoto20 ZenPhoto20}
 */
function _setup($action)
{
    require_once dirname(__FILE__) . '/reconfigure.php';
    reconfigureAction($action);
}