Commit e132a32a56a07b0f0583268f1204f6468983f1bb
- Diff rendering mode:
- inline
- side by side
belokan.sh
(56 / 2)
|   | |||
| 13 | 13 | bok_appName=$1 | |
| 14 | 14 | mkdir $bok_appName; | |
| 15 | 15 | cd $bok_appName; | |
| 16 | mkdir -p cache controllers langs libs logs models var | ||
| 16 | mkdir cache controllers langs libs logs models var | ||
| 17 | 17 | mkdir -p public/{js,img,css,files} views/_{layouts/default,plugins} | |
| 18 | touch config.php public/index.php views/_layouts/default/{before,after}.phtml | ||
| 18 | touch config.php public/index.php controllers/{Home,HttpErrors}.php | ||
| 19 | touch views/_layouts/default/{before,after}.phtml | ||
| 20 | mkdir views/{home,httperrors} | ||
| 21 | touch views/home/default.phtml views/httperrors/e404.phtml | ||
| 19 | 22 | cat >config.php <<EOF | |
| 20 | 23 | <?php | |
| 21 | 24 | ||
| … | … | ||
| 57 | 57 | ||
| 58 | 58 | \$${bok_appName} = new Belokan(realpath('../config.php')); | |
| 59 | 59 | \$${bok_appName}->run(); | |
| 60 | EOF | ||
| 61 | cat >controllers/Home.php <<EOF | ||
| 62 | <?php | ||
| 63 | |||
| 64 | class HomeController extends Belokan_Controller { | ||
| 65 | |||
| 66 | public function defaultAction () | ||
| 67 | { | ||
| 68 | \$this->_view->title = '${bok_appName}'; | ||
| 69 | \$this->_view->message = 'Hello, World!'; | ||
| 70 | } | ||
| 71 | |||
| 72 | } | ||
| 73 | EOF | ||
| 74 | cat >controllers/HttpErrors.php <<EOF | ||
| 75 | <?php | ||
| 76 | |||
| 77 | class HttpErrorsController extends Belokan_Controller { | ||
| 78 | |||
| 79 | public function e404 () | ||
| 80 | { | ||
| 81 | header('HTTP/1.1 404 Not Found'); | ||
| 82 | \$this->_view->title = 'Error: 404 Not Found'; | ||
| 83 | } | ||
| 84 | |||
| 85 | } | ||
| 86 | EOF | ||
| 87 | cat >views/_layouts/default/before.phtml <<EOF | ||
| 88 | <?xml version="1.0" encoding="utf-8"?> | ||
| 89 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | ||
| 90 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | ||
| 91 | <html dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
| 92 | <head> | ||
| 93 | <title><?php echo \$this->title; ?></title> | ||
| 94 | <meta http-equiv="Content-type" content="application/xhtml+xml; charset=utf-8" /> | ||
| 95 | </head> | ||
| 96 | <body> | ||
| 97 | <h1><?php echo \$this->title; ?></h1> | ||
| 98 | <div id="main"> | ||
| 99 | EOF | ||
| 100 | cat >views/_layouts/default/after.phtml <<EOF | ||
| 101 | </div> | ||
| 102 | </body> | ||
| 103 | </html> | ||
| 104 | EOF | ||
| 105 | cat >views/home/default.phtml <<EOF | ||
| 106 | <p><?php echo \$this->message; ?></p> | ||
| 107 | EOF | ||
| 108 | cat >views/httperrors/e404.phtml <<EOF | ||
| 109 | <p>Sorry, this page does not exists!</p> | ||
| 110 | <p>You could go to the <a href="/">home page</a> or contact us if you believe this is a problem.</p> | ||
| 60 | 111 | EOF | |
| 61 | 112 | } | |
| 62 | 113 |

