summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2007-03-17 13:06:33 +0000
committerxue <>2007-03-17 13:06:33 +0000
commit4d2d3e003b56b6cb42b9025e961de9713e48924c (patch)
tree8201da2ce42e5e828ba916e1fa564dba80635f40 /framework
parentcf44ca14cdd355cca044d4653b451703206c60c5 (diff)
fixed an issue about root path.
Diffstat (limited to 'framework')
-rwxr-xr-xframework/prado-cli.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/framework/prado-cli.php b/framework/prado-cli.php
index 39201915..2e2ec044 100755
--- a/framework/prado-cli.php
+++ b/framework/prado-cli.php
@@ -244,17 +244,20 @@ class PradoCommandLineCreateProject extends PradoCommandLineAction
$rootPath = realpath(dirname(trim($dir)));
- $basePath = $rootPath.'/'.basename($dir);
+ if(basename($dir)!=='.')
+ $basePath = $rootPath.DIRECTORY_SEPARATOR.basename($dir);
+ else
+ $basePath = $rootPath;
$appName = basename($basePath);
- $assetPath = $basePath.'/assets';
- $protectedPath = $basePath.'/protected';
- $runtimePath = $basePath.'/protected/runtime';
- $pagesPath = $protectedPath.'/pages';
+ $assetPath = $basePath.DIRECTORY_SEPARATOR.'assets';
+ $protectedPath = $basePath.DIRECTORY_SEPARATOR.'protected';
+ $runtimePath = $basePath.DIRECTORY_SEPARATOR.'protected'.DIRECTORY_SEPARATOR.'runtime';
+ $pagesPath = $protectedPath.DIRECTORY_SEPARATOR.'pages';
- $indexFile = $basePath.'/index.php';
- $htaccessFile = $protectedPath.'/.htaccess';
- $configFile = $protectedPath.'/application.xml';
- $defaultPageFile = $pagesPath.'/Home.page';
+ $indexFile = $basePath.DIRECTORY_SEPARATOR.'index.php';
+ $htaccessFile = $protectedPath.DIRECTORY_SEPARATOR.'.htaccess';
+ $configFile = $protectedPath.DIRECTORY_SEPARATOR.'application.xml';
+ $defaultPageFile = $pagesPath.DIRECTORY_SEPARATOR.'Home.page';
$this->createDirectory($basePath, 0755);
$this->createDirectory($assetPath,0777);
@@ -270,14 +273,15 @@ class PradoCommandLineCreateProject extends PradoCommandLineAction
protected function renderIndexFile()
{
- $framework = realpath(dirname(__FILE__)).'/prado.php';
+ $framework = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'prado.php';
return '<?php
+
$frameworkPath=\''.$framework.'\';
-/** The directory checks may be removed if performance is required **/
+// The following directory checks may be removed if performance is required
$basePath=dirname(__FILE__);
-$assetsPath=$basePath."/assets";
-$runtimePath=$basePath."/protected/runtime";
+$assetsPath=$basePath.\'/assets\';
+$runtimePath=$basePath.\'/protected/runtime\';
if(!is_file($frameworkPath))
die("Unable to find prado framework path $frameworkPath.");