From 4d2d3e003b56b6cb42b9025e961de9713e48924c Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 17 Mar 2007 13:06:33 +0000 Subject: fixed an issue about root path. --- framework/prado-cli.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'framework') 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 '