Annotation of /branches/mambo5/app/controllers/main_controller.php
Parent Directory
|
Revision Log
Revision 2 - (view) (download)
| 1 : | enjoyman | 2 | <?php |
| 2 : | /** | ||
| 3 : | * @package Mambo | ||
| 4 : | * @author Mambo Foundation Inc see README.php | ||
| 5 : | * @copyright (C) 2000 - 2009 Mambo Foundation Inc. | ||
| 6 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 7 : | * @license GNU/GPL Version 2, see http://www.opensource.org/licenses/gpl-2.0.php | ||
| 8 : | * | ||
| 9 : | * Redistributions of files must retain the above copyright notice. | ||
| 10 : | * | ||
| 11 : | * Mambo is free software; you can redistribute it and/or | ||
| 12 : | * modify it under the terms of the GNU General Public License | ||
| 13 : | * as published by the Free Software Foundation; version 2 of the License. | ||
| 14 : | */ | ||
| 15 : | |||
| 16 : | /** | ||
| 17 : | * This class is in no way finished! It is simply here to show off the installer for now. | ||
| 18 : | * More to come... | ||
| 19 : | * | ||
| 20 : | */ | ||
| 21 : | |||
| 22 : | class MainController extends AppController { | ||
| 23 : | |||
| 24 : | public $name = 'Main'; | ||
| 25 : | public $uses = array('Content'); | ||
| 26 : | //public $uses = null; works too | ||
| 27 : | public $helpers = array('Html', 'Form'); | ||
| 28 : | |||
| 29 : | function index() { | ||
| 30 : | //Run installation check | ||
| 31 : | $this->installCheck(); | ||
| 32 : | |||
| 33 : | //Find 1 article to use as a sample for now to show the db is working... | ||
| 34 : | $this->set('sample', $this->Content->find("id=15")); | ||
| 35 : | } | ||
| 36 : | |||
| 37 : | function administrator_index() { | ||
| 38 : | |||
| 39 : | } | ||
| 40 : | |||
| 41 : | private function installCheck() { | ||
| 42 : | //Check for a valid install and redirect if one does not exist | ||
| 43 : | if (@!file_exists(CONFIGS.'database.php') || filesize(CONFIGS.'database.php')===0 || | ||
| 44 : | @!file_exists(CONFIGS.'configuration.xml') || filesize(CONFIGS.'configuration.xml')===0) { | ||
| 45 : | $this->redirect('/installation/index'); | ||
| 46 : | exit; | ||
| 47 : | } else if (@file_exists(VENDORS.'mambo')) { | ||
| 48 : | $this->redirect('/main/offline'); | ||
| 49 : | exit; | ||
| 50 : | } | ||
| 51 : | } | ||
| 52 : | |||
| 53 : | function offline() { | ||
| 54 : | $this->set('install_dir', VENDORS.'mambo'); | ||
| 55 : | } | ||
| 56 : | |||
| 57 : | } | ||
| 58 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

