From e62dfb1a310aff5efa285e8bde018314e6f70b50 Mon Sep 17 00:00:00 2001
From: Ludovic Pouzenc
Date: Thu, 2 Aug 2012 12:12:19 +0000
Subject: Application Blog fonctionnelle avec repertoire du framework separé et
mod-rewrite utilisé (donc le index.php à la racine ne sert pas, c'est le
app/webroot/index.php qui sert)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: file:///var/svn/2012-php-weave/trunk@9 d972a294-176a-4cf9-8ea1-fcd5b0c30f5c
---
.../src/workdir/in/app/View/Elements/empty | 0
.../workdir/in/app/View/Emails/html/default.ctp | 25 +++
.../workdir/in/app/View/Emails/text/default.ctp | 19 +++
.../src/workdir/in/app/View/Errors/error400.ctp | 31 ++++
.../src/workdir/in/app/View/Errors/error500.ctp | 28 +++
.../src/workdir/in/app/View/Helper/AppHelper.php | 34 ++++
.../in/app/View/Layouts/Emails/html/default.ctp | 29 ++++
.../in/app/View/Layouts/Emails/text/default.ctp | 21 +++
.../src/workdir/in/app/View/Layouts/ajax.ctp | 19 +++
.../src/workdir/in/app/View/Layouts/default.ctp | 61 +++++++
.../src/workdir/in/app/View/Layouts/error.ctp | 61 +++++++
.../src/workdir/in/app/View/Layouts/flash.ctp | 37 ++++
.../src/workdir/in/app/View/Layouts/js/default.ctp | 2 +
.../workdir/in/app/View/Layouts/rss/default.ctp | 14 ++
.../workdir/in/app/View/Layouts/xml/default.ctp | 1 +
.../src/workdir/in/app/View/Pages/home.ctp | 188 +++++++++++++++++++++
.../src/workdir/in/app/View/Posts/add.ctp | 7 +
.../src/workdir/in/app/View/Posts/edit.ctp | 8 +
.../src/workdir/in/app/View/Posts/index.ctp | 33 ++++
.../src/workdir/in/app/View/Posts/view.ctp | 6 +
.../src/workdir/in/app/View/Scaffolds/empty | 0
21 files changed, 624 insertions(+)
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Elements/empty
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/html/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/text/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error400.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error500.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Helper/AppHelper.php
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/Emails/html/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/Emails/text/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/ajax.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/error.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/flash.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/js/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/rss/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/xml/default.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Pages/home.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp
create mode 100644 poc/poc02-compiling-cake/src/workdir/in/app/View/Scaffolds/empty
(limited to 'poc/poc02-compiling-cake/src/workdir/in/app/View')
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Elements/empty b/poc/poc02-compiling-cake/src/workdir/in/app/View/Elements/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/html/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/html/default.ctp
new file mode 100644
index 0000000..0eb7f57
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/html/default.ctp
@@ -0,0 +1,25 @@
+
+ ' . $line . "
\n";
+endforeach;
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/text/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/text/default.ctp
new file mode 100644
index 0000000..56be8c1
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Emails/text/default.ctp
@@ -0,0 +1,19 @@
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error400.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error400.ctp
new file mode 100644
index 0000000..6d50860
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error400.ctp
@@ -0,0 +1,31 @@
+
+
+
+ :
+ '{$url}'"
+ ); ?>
+
+ 0 ):
+ echo $this->element('exception_stack_trace');
+endif;
+?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error500.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error500.ctp
new file mode 100644
index 0000000..4e1f36e
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Errors/error500.ctp
@@ -0,0 +1,28 @@
+
+
+
+ :
+
+
+ 0 ):
+ echo $this->element('exception_stack_trace');
+endif;
+?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Helper/AppHelper.php b/poc/poc02-compiling-cake/src/workdir/in/app/View/Helper/AppHelper.php
new file mode 100644
index 0000000..0fddaea
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Helper/AppHelper.php
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+ This email was sent using the CakePHP Framework
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/Emails/text/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/Emails/text/default.ctp
new file mode 100644
index 0000000..94ed222
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/Emails/text/default.ctp
@@ -0,0 +1,21 @@
+
+
+
+This email was sent using the CakePHP Framework, http://cakephp.org.
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/ajax.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/ajax.ctp
new file mode 100644
index 0000000..c0da850
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/ajax.ctp
@@ -0,0 +1,19 @@
+
+fetch('content'); ?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/default.ctp
new file mode 100644
index 0000000..39704bf
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/default.ctp
@@ -0,0 +1,61 @@
+
+
+
+
+ Html->charset(); ?>
+
+ :
+
+
+ Html->meta('icon');
+
+ echo $this->Html->css('cake.generic');
+
+ echo $this->fetch('meta');
+ echo $this->fetch('css');
+ echo $this->fetch('script');
+ ?>
+
+
+
+
+
+
+ Session->flash(); ?>
+
+ fetch('content'); ?>
+
+
+
+ element('sql_dump'); ?>
+
+
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/error.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/error.ctp
new file mode 100644
index 0000000..4947734
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/error.ctp
@@ -0,0 +1,61 @@
+
+
+
+
+ Html->charset(); ?>
+
+ :
+
+
+ Html->meta('icon');
+
+ echo $this->Html->css('cake.generic');
+
+ echo $this->fetch('meta');
+ echo $this->fetch('css');
+ echo $this->fetch('script');
+ ?>
+
+
+
+
+
+
+ Session->flash(); ?>
+
+ fetch('content'); ?>
+
+
+
+ element('sql_dump'); ?>
+
+
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/flash.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/flash.ctp
new file mode 100644
index 0000000..76fae34
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/flash.ctp
@@ -0,0 +1,37 @@
+
+
+
+
+Html->charset(); ?>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/js/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/js/default.ctp
new file mode 100644
index 0000000..7239b5d
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/js/default.ctp
@@ -0,0 +1,2 @@
+
+
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/rss/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/rss/default.ctp
new file mode 100644
index 0000000..077de61
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/rss/default.ctp
@@ -0,0 +1,14 @@
+Rss->document(
+ $this->Rss->channel(
+ array(), $channel, $this->fetch('content')
+ )
+);
+?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/xml/default.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/xml/default.ctp
new file mode 100644
index 0000000..fbd5ee0
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Layouts/xml/default.ctp
@@ -0,0 +1 @@
+fetch('content'); ?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Pages/home.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Pages/home.ctp
new file mode 100644
index 0000000..9a22923
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Pages/home.ctp
@@ -0,0 +1,188 @@
+
+
+
+
+ 0):
+ Debugger::checkSecurityKeys();
+endif;
+?>
+
+
+ 1) Help me configure it
+ 2) I don't / can't use URL rewriting
+
+
+=')):
+ echo '';
+ echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.');
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.');
+ echo '';
+ endif;
+?>
+
+
+ ';
+ echo __d('cake_dev', 'Your tmp directory is writable.');
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'Your tmp directory is NOT writable.');
+ echo '';
+ endif;
+ ?>
+
+
+ ';
+ echo __d('cake_dev', 'The %s is being used for core caching. To change the config edit APP/Config/core.php ', ''. $settings['engine'] . 'Engine');
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'Your cache is NOT working. Please check the settings in APP/Config/core.php');
+ echo '';
+ endif;
+ ?>
+
+
+ ';
+ echo __d('cake_dev', 'Your database configuration file is present.');
+ $filePresent = true;
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'Your database configuration file is NOT present.');
+ echo '
';
+ echo __d('cake_dev', 'Rename APP/Config/database.php.default to APP/Config/database.php');
+ echo '';
+ endif;
+ ?>
+
+
+
+ isConnected()):
+ echo '';
+ echo __d('cake_dev', 'Cake is able to connect to the database.');
+ echo '';
+ else:
+ echo '';
+ echo __d('cake_dev', 'Cake is NOT able to connect to the database.');
+ echo '
';
+ echo $connectionError->getMessage();
+ echo '';
+ endif;
+ ?>
+
+
+';
+ echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');
+ echo '
';
+ echo __d('cake_dev', 'Recompile PCRE with Unicode support by adding --enable-unicode-properties
when configuring');
+ echo '';
+ }
+?>
+
+
+
+To change its layout, edit: APP/View/Layouts/default.ctp.
+You can also add some CSS styles for your pages at: APP/webroot/css.');
+?>
+
+
+
+
+ Html->link(
+ sprintf('%s %s', __d('cake_dev', 'New'), __d('cake_dev', 'CakePHP 2.0 Docs')),
+ 'http://book.cakephp.org/2.0/en/',
+ array('target' => '_blank', 'escape' => false)
+ );
+ ?>
+
+
+ Html->link(
+ __d('cake_dev', 'The 15 min Blog Tutorial'),
+ 'http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/blog.html',
+ array('target' => '_blank', 'escape' => false)
+ );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp
new file mode 100644
index 0000000..c36d35e
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/add.ctp
@@ -0,0 +1,7 @@
+Add Post
+Form->create('Post');
+echo $this->Form->input('title');
+echo $this->Form->input('body', array('rows' => '3'));
+echo $this->Form->end('Save Post');
+?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp
new file mode 100644
index 0000000..221d85a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/edit.ctp
@@ -0,0 +1,8 @@
+Edit Post
+Form->create('Post', array('action' => 'edit'));
+ echo $this->Form->input('title');
+ echo $this->Form->input('body', array('rows' => '3'));
+ echo $this->Form->input('id', array('type' => 'hidden'));
+ echo $this->Form->end('Save Post');
+?>
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp
new file mode 100644
index 0000000..754b378
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/index.ctp
@@ -0,0 +1,33 @@
+Blog posts
+Html->link('Add Post', array('action' => 'add')); ?>
+
+
+ Id |
+ Title |
+ Actions |
+ Created |
+
+
+
+
+
+
+ |
+
+ Html->link($post['Post']['title'], array('action' => 'view', $post['Post']['id'])); ?>
+ |
+
+ Form->postLink(
+ 'Delete',
+ array('action' => 'delete', $post['Post']['id']),
+ array('confirm' => 'Are you sure?'));
+ ?>
+ Html->link('Edit', array('action' => 'edit', $post['Post']['id'])); ?>
+ |
+
+
+ |
+
+
+
+
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp
new file mode 100644
index 0000000..4fb6556
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/workdir/in/app/View/Posts/view.ctp
@@ -0,0 +1,6 @@
+
+
+Created:
+
+
+
diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/View/Scaffolds/empty b/poc/poc02-compiling-cake/src/workdir/in/app/View/Scaffolds/empty
new file mode 100644
index 0000000..e69de29
--
cgit v1.2.3