Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
ENH: Improved installation process
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Marion committed Mar 10, 2011
1 parent e4e8eac commit b21c973
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 28 deletions.
4 changes: 2 additions & 2 deletions application/configs/application.ini
@@ -1,8 +1,8 @@
[global]
;development or production
environment=development
environment=production
;name of the application
application.name=Midas
application.name=MIDAS
;language of the application (en or fr)
application.lang=en
;Optimize JS and CSS
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/InstallController.php
Expand Up @@ -38,7 +38,7 @@ function indexAction()
"simplexml" => array(false, ""),
);
$this->view->phpextension_missing=$this->Component->Utility->CheckPhpExtensions($phpextensions);
$this->view->writable=is_writable(BASE_PATH);
$this->view->writable=is_writable(BASE_PATH.'/application/configs');
$this->view->convertfound=$this->Component->Utility->IsImageMagickWorking();
$this->view->basePath=BASE_PATH;
if(!empty($_POST)&&$this->view->writable)
Expand Down Expand Up @@ -170,7 +170,7 @@ function step3Action()

$assetstrores=$this->Assetstore->getAll();
$formArray['assetstore']->addMultiOptions(array(
$assetstrores[0]->getKey() => $assetstrores[0]->getName().' Path: '.$assetstrores[0]->getPath()
$assetstrores[0]->getKey() => $assetstrores[0]->getPath()
));

$this->view->form=$formArray;
Expand Down
8 changes: 4 additions & 4 deletions application/controllers/forms/InstallForm.php
Expand Up @@ -80,8 +80,8 @@ public function createConfigForm()

$process = new Zend_Form_Element_Select('process');
$process ->addMultiOptions(array(
'onthefly' => 'On the Fly',
'cron' => 'Using an external cron job'
'onthefly' => 'On the fly',
'cron' => 'External'
));

$timezone = new Zend_Form_Element_Select('timezone');
Expand All @@ -92,8 +92,8 @@ public function createConfigForm()

$environment = new Zend_Form_Element_Select('environment');
$environment ->addMultiOptions(array(
'production' => 'Production (no errors shown, faster)' ,
'development' => 'Development (shows errors, slower)'
'production' => 'Production' ,
'development' => 'Development'
));

$name = new Zend_Form_Element_Text('name');
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion application/views/install/step2.phtml
Expand Up @@ -45,7 +45,6 @@
{$form['dbname']}
</div>
<div>
<input type='button' class='testConnection' value='Test Connexion' />
<div id='dbResult'>
<div>
<img style='display:none;' class='testLoading' alt='' src='{$this->webroot}/public/images/icons/loading.gif'/>
Expand Down
39 changes: 25 additions & 14 deletions application/views/install/step3.phtml
@@ -1,53 +1,64 @@
<link href="<?php echo $this->webroot?>/public/css/install/install.css" rel="stylesheet" type="text/css" />

<link href="<?php echo $this->webroot?>/public/css/install/install.step3.css" rel="stylesheet" type="text/css" />

<?php
$this->headScript()->appendFile($this->webroot.'/public/js/install/install.step3.js');
?>

<div class="viewMain">

<div class="viewMain">
<h3>Configuration:</h3>

<?php
echo "<form class='genericForm' method='{$this->form['method']}' action='{$this->form['action']}'>";
echo "
<div>
<div class='installName'>
<label for='name'>Application name</label>
{$this->form['name']}
</div>
<div>
<div class='installLang'>
<label for='lang'>Language</label>
{$this->form['lang']}
</div>
<div>
<div class='installEnvironment'>
<label for='environment'>Environment</label>
{$this->form['environment']}
</div>
<div>
<div class='installProcess'>
<label for='process'>Select process type</label>
{$this->form['process']}
<br/>
Windows: task manage using command: ".BASE_PATH."/library/Executable/windows/32/wget.exe -O ".BASE_PATH."/log/task.log http://localhost{$this->webroot}/task<br/>
Linux: cron job using command: wget -O ".BASE_PATH."/log/task.log http://localhost{$this->webroot}/task
</div>
<div>
<div class='installTimezone'>
<label for='environment'>Timezone</label>
{$this->form['timezone']}
</div>
<div>
<div class='installSmartoptimizer'>
<label for='smartoptimizer'>CSS and Javascript optimizer</label>
{$this->form['smartoptimizer']}
</div>
<div>
<div class='installAssetstrore'>
<label for='assetstore'>Default Assetstore</label>
{$this->form['assetstore']}
</div>
<div>
{$this->form['submit']}
</div>
</form>";
echo "</div>";
?>
</div>
<div class="viewSideBar">
<div class="sideElementFirst " >
<h1>Help</h1>
<div class="installHelp">
This page allow you to configure your installation.
</div>
</div>
</div>

</div>
<div class='hiddenProcces' style="display:none;">
<?php
echo "<br/>
Windows:".BASE_PATH."<br/>/library/Executable/windows/32/<br/>wget.exe -O <br/>".BASE_PATH."<br/>/log/task.log<br/> http://localhost{$this->webroot}/task<br/><br/>
Linux: wget -O ".BASE_PATH."<br/>/log/task.log http://localhost{$this->webroot}/task";
?>
</div>
14 changes: 13 additions & 1 deletion index.php
Expand Up @@ -20,6 +20,18 @@

define('BASE_PATH', realpath(dirname(__FILE__)));

if(!is_writable(BASE_PATH."/application/configs")||!is_writable(BASE_PATH."/log")||!is_writable(BASE_PATH."/data")||!is_writable(BASE_PATH."/tmp"))
{
echo "To use Midas, the following repertories have to be writable by apache:
<ul>
<li>".BASE_PATH."/application/configs</li>
<li>".BASE_PATH."/log</li>
<li>".BASE_PATH."/data</li>
<li>".BASE_PATH."/tmp</li>
</ul>";
exit();
}

define('START_TIME',microtime(true));

require_once 'Zend/Loader/Autoloader.php';
Expand All @@ -28,7 +40,7 @@
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('App_');

require_once(BASE_PATH . "/include.php");
require_once(BASE_PATH . "/application/include.php");

// Create application, bootstrap, and run
$application = new Zend_Application('global', CORE_CONFIG);
Expand Down
7 changes: 3 additions & 4 deletions public/css/install/install.step2.css
Expand Up @@ -6,8 +6,7 @@
}

#dbResult div{
position: absolute;
width: 400px;
left: 350px;
top: -20px;
margin-left: 203px;
margin-top:4px;
height: 30px;
}
16 changes: 16 additions & 0 deletions public/js/install/install.step3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/js/layout/jquery.treeTable.js
Expand Up @@ -124,6 +124,7 @@
$(this).removeAttr('ajax');
$(this).attr('proccessing',false);
$(this).find('td:first img.tableLoading').hide();
initialize($(this));
}


Expand Down

0 comments on commit b21c973

Please sign in to comment.