コード例 #1
0
ファイル: index.php プロジェクト: BlocklandGlass/GlassWebsite
<?php

require_once realpath(dirname(__FILE__) . "/private/class/InstallationManager.php");
if (InstallationManager::checkInstallation() == false) {
    header('Location: /install/');
    return;
}
require_once realpath(dirname(__FILE__) . "/private/header.php");
require_once realpath(dirname(__FILE__) . "/private/navigationbar.php");
require_once realpath(dirname(__FILE__) . "/private/class/UserLog.php");
require_once realpath(dirname(__FILE__) . "/private/class/StatManager.php");
$testEnvironment = false;
if (is_file(dirname(__FILE__) . '/private/test.json')) {
    $testEnvironment = true;
}
?>

<div class="bigheadcontainer">
	<!-- <h1>Blockland Glass</h1> -->
	<image style="margin: 10px 0px 5px 0px; max-width: 100%" src="/img/logoWhite.png" />
	<h2 style="font-weight: normal">A service for the community, by the community</h2>
	<a href="dl.php" class="btn blue"><b>Download</b></a><br />
	<!-- <a href="builds" class="btn green" style="width: 150px">Builds</a> -->
	<a href="addons" class="btn yellow" style="width: 150px">Add-Ons</a><br /><br />
</div>
<div class="maincontainer">
	<?php 
if ($testEnvironment) {
    ?>
	<p>
		<h3>Glass Test Site</h3>
コード例 #2
0
<?php

require_once 'Utils.php';
require_once 'ParseClient.php';
InstallationManager::getInstallations(array());
class InstallationManager
{
    static function getInstallations($condition, $pageSize = 40, $pageno = 1)
    {
        $skip = ($pageno - 1) * $pageSize;
        $args = array('className' => '_Installation', 'limit' => $pageSize, 'skip' => $skip, 'order' => '-createAt');
        if (isset($condition) && count($condition) > 0) {
            $args['query'] = $condition;
        }
        $result = ParseClient::getInstance()->query($args);
        $list = obj2arr($result->results);
        return $list;
    }
    static function getInstallationsCounts($condition)
    {
        $args = array('className' => '_Installation', 'limit' => '0', 'count' => '1');
        if (isset($condition) && count($condition) > 0) {
            $args['query'] = $condition;
        }
        $result = ParseClient::getInstance()->query($args);
        return $result->count;
    }
    static function deleteInstallation($InstallationID)
    {
        $args = array('className' => '_Installation', 'objectId' => $InstallationID, 'object' => array('pushFlag' => 'Y'));
        if (ParseClient::getInstance()->update($args)) {
コード例 #3
0
<?php

require_once 'database/DBConfig.php';
require_once 'database/Database.php';
###################################################################
#                      INSTALL AND UNINSTALL                      #
###################################################################
$installationManager = new InstallationManager();
$installationMangerView = new InstallationManagerView();
// display menu
echo $installationMangerView->doManagerBox();
// if cliced Install button: install
if ($installationMangerView->doInstall()) {
    $installationManager->install();
}
// if cliced Uninstall button: uninstall
if ($installationMangerView->doUninstall()) {
    $installationManager->uninstall();
}
###################################################################
/**
 * MANAGER
 */
class InstallationManager
{
    // table names
    const TABLE_MEMBER = 'member';
    const TABLE_RECORDING = 'recording';
    private $m_db = null;
    public function __construct()
    {
コード例 #4
0
require_once realpath(dirname(__DIR__) . "/private/class/InstallationManager.php");
?>
<!doctype html>
<html>
  <head>
  </head>
  <body>
    <h2>PHP Modules</h2>
    <p>
      Checking to see if all required PHP modules are installed...
    </p>
    <table>
      <?php 
$ct = 0;
foreach (InstallationManager::getModuleStatus() as $mod => $installed) {
    if (!$installed) {
        $ct++;
        echo '<tr><td>' . $mod . '</td><td>' . ($installed ? "Installed" : '<span style="color:red;">Missing!</span>') . '</td></tr>';
    }
}
if ($ct == 0) {
    echo '<tr><td colspan="2">All required modules installed!</td></tr>';
}
?>
    </table>
    <br />
    <?php 
if ($ct == 0) {
    ?>
      <form method="post" action="/install/configCheck.php">
コード例 #5
0
ファイル: installations.php プロジェクト: Zyr93/DiamondMVC
    ?>
/system/installation?id=<?php 
    echo $meta;
    ?>
"><?php 
    echo $inst->getName();
    ?>
</a>
					</td>
					<td class="col-version"><?php 
    echo $inst->getVersion();
    ?>
</td>
					<td class="col-has-update">
						<?php 
    if (InstallationManager::hasUpdate($inst)) {
        ?>
							<a href="<?php 
        echo DIAMONDMVC_URL;
        ?>
/system/update?id=<?php 
        echo $meta;
        ?>
">
								<i class="fa fa-arrow-circle-o-up">&nbsp;</i>
							</a>
						<?php 
    }
    ?>
					</td>
				</tr>
コード例 #6
0
ファイル: installation.php プロジェクト: Zyr93/DiamondMVC
    ?>
			<small>
				<span class="installation-version"><?php 
    echo $meta->getVersion();
    ?>
</span><br>
				<span class="installation-copyright"><?php 
    echo $meta->getCopyright();
    ?>
</span>
			</small>
		</h3>
		<div class="clearfix"></div>
		
		<?php 
    if (InstallationManager::hasUpdate($meta)) {
        ?>
			<?php 
        echo generateNotificationHTML($lang->get('UPDATE_NOTIFICATION_TITLE', 'ControllerSystem.Installation'), str_replace('%update-link%', '<a href="' . DIAMONDMVC_URL . '/system/update?id=' . $result['id'] . '">here</a>', $lang->get('UPDATE_NOTIFICATION_BODY', 'ControllerSystem.Installation')), 'success');
        ?>
		<?php 
    }
    ?>
		
		<pre class="installation-description"><?php 
    echo $description;
    ?>
</pre>
		
		<table class="table" id="view-meta">
			<tr>
コード例 #7
0
ファイル: system.php プロジェクト: Zyr93/DiamondMVC
 protected function action_update()
 {
     if (!Permissions::has('access') or !Permissions::has('sys_installation_install')) {
         return $this->redirectForbidden();
     }
     $lang = i18n::load('diamondmvc-backend');
     if (!isset($_REQUEST['id']) or empty($_REQUEST['id'])) {
         $this->addMessage('Whoops!', $lang->get('ERROR_MISSING_ARGUMENTS'), 'error');
         $this->result = array('success' => false, 'msg' => $lang->get('ERROR_MISSING_ARGUMENTS'));
         return;
     }
     $path = jailpath(DIAMONDMVC_ROOT . DS . 'registry', $_REQUEST['id'] . '.json');
     if (!is_file($path)) {
         $this->addMessage('Whoops!', $lang->get('ERROR_NO_META', 'ControllerSystem.Installation', 'error'));
         $this->result = array('success' => false, 'msg' => $lang->get('ERROR_NO_META', 'ControllerSystem.Installation'));
         return;
     }
     try {
         $id = InstallationManager::update($path);
         $this->result = array('success' => true, 'id' => $id);
     } catch (Exception $ex) {
         $this->result = array('success' => false, 'msg' => $ex->getMessage());
         $this->addMessage('Whoops!', 'An exception occurred: ' . $ex->getMessage(), 'error');
         logMsg('DiamondMVC: failed to update installation ' . $_REQUEST['id'] . ' with exception (' . $ex->getCode() . '): ' . $ex->getMessage(), 9, false);
     }
 }