Commit e132a32a56a07b0f0583268f1204f6468983f1bb

  • avatar
  • p4bl0 <pablo.rauzy @gm…l.com>
  • Thu Jun 04 20:15:22 CEST 2009
  • Tree SHA1: 5c76908
  • Parent SHA1: 1357e76 (belokan.sh is a very basic tool to create an empty directory tree for a standard Belokan based application)
  • raw diff | raw patch
update belokan.sh
belokan.sh
(56 / 2)
  
1313 bok_appName=$1
1414 mkdir $bok_appName;
1515 cd $bok_appName;
16 mkdir -p cache controllers langs libs logs models var
16 mkdir cache controllers langs libs logs models var
1717 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
1922 cat >config.php <<EOF
2023<?php
2124
5757
5858\$${bok_appName} = new Belokan(realpath('../config.php'));
5959\$${bok_appName}->run();
60EOF
61 cat >controllers/Home.php <<EOF
62<?php
63
64class 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}
73EOF
74 cat >controllers/HttpErrors.php <<EOF
75<?php
76
77class 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}
86EOF
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">
99EOF
100 cat >views/_layouts/default/after.phtml <<EOF
101 </div>
102 </body>
103</html>
104EOF
105 cat >views/home/default.phtml <<EOF
106<p><?php echo \$this->message; ?></p>
107EOF
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>
60111EOF
61112}
62113