Package: cakephp-scripts
Version: 1.1.16.5421-1
Having just installed cakephp and cakephp-scripts, I followed the advice
of /usr/share/doc/cakephp/README.Debian and ran bake.php . It wasn't
clear if there was a specific Debian way to setup the directories for a
new app, so I just took the default option at the first question asked
by bake.php "New App Directory: /usr/share/php/app" "Look okay?
(y/n/q)". This caused a lot of warnings because I was not running the
script as root, so I ran it again as root and the script completed,
creating /usr/share/php/app .
Unfortunately this directory was not known to Apache, and so I spent a
long time using the online manual trying to change cakephp and Apache
configuration files. I kept searching for a simpler method, though, and
eventually found that bake.php would produce an instantly usable app
directory if the first question was answered with "n" and then
"/var/www/app" .
I have thus created a patched version of bake.php with defaults that I
believe are more intuitive. Below is a patch:
----------------------------------------------------------------------
--- bake.php 2007-07-13 07:21:37.000000000 +0100
+++ bakenew.php 2007-09-07 22:59:44.000000000 +0100
@@ -36,6 +36,9 @@
ini_set('max_execution_time',0);
}
+ // Modification for Debian systems: suggest a more suitable root
directory for new apps
+ define('DEBIAN_DEFAULT_APP_ROOT', DS . 'var'. DS . 'www' . DS);
+
$app = null;
$root = '/usr/share/php';
$core = null;
@@ -100,7 +103,7 @@
if (!$rootDir) {
$rootDir = $root;
- $projectPath = $root.DS.$appDir;
+ $projectPath = DEBIAN_DEFAULT_APP_ROOT.$appDir;
}
define ('ROOT', $rootDir);
@@ -2314,12 +2317,12 @@
$this->main();
exit();
} else {
- $projectPath =
$this->getInput("What is the full path for this app including the app
directory name?\nExample: ".ROOT.DS."myapp", null, ROOT.DS.'myapp');
+ $projectPath =
$this->getInput("What is the full path for this app including the app
directory name?\nExample: ".DEBIAN_DEFAULT_APP_ROOT."myapp", null,
DEBIAN_DEFAULT_APP_ROOT.'myapp');
}
}
} else {
while ($projectPath == '') {
- $projectPath = $this->getInput("What is
the full path for this app including the app directory name?\nExample:
".ROOT.DS."myapp", null, ROOT.DS.'myapp');
+ $projectPath = $this->getInput("What is
the full path for this app including the app directory name?\nExample:
".DEBIAN_DEFAULT_APP_ROOT."myapp", null, DEBIAN_DEFAULT_APP_ROOT.'myapp');
if ($projectPath == '') {
$this->stdout('The directory
path you supplied was empty. Please try again.');
@@ -2373,7 +2376,7 @@
} else {
while ($skel == '') {
- $skel = $this->getInput("What is the
full path for the cake install app directory?\nExample: ", null,
ROOT.'myapp'.DS);
+ $skel = $this->getInput("What is the
full path for the cake install app directory?\nExample: ", null,
DEBIAN_DEFAULT_APP_ROOT.'myapp'.DS);
if ($skel == '') {
$this->stdout('The directory
path you supplied was empty. Please try again.');
----------------------------------------------------------------------
Let me know if that needs improvement.
Edwin Taylor
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]