|
Alternative patch from Index: Abstract.php
===================================================================
--- Abstract.php (revision 16969)
+++ Abstract.php (working copy)
@@ -120,11 +120,14 @@
}
$profile = new Zend_Tool_Project_Profile();
-
- $parentDirectoriesArray = split(DIRECTORY_SEPARATOR, ltrim($projectDirectory, DIRECTORY_SEPARATOR));
+ $parentDirectoriesArray = split(preg_quote(DIRECTORY_SEPARATOR), ltrim($projectDirectory, DIRECTORY_SEPARATOR));
while ($parentDirectoriesArray) {
- $projectDirectoryAssembled = DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray);
+ $projectDirectoryAssembled = implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray);
+ if (DIRECTORY_SEPARATOR != "\\") { // Seems to be a windows path
+ $projectDirectoryAssembled = DIRECTORY_SEPARATOR . $projectDirectoryAssembled;
+ }
+
$profile->setAttribute('projectDirectory', $projectDirectoryAssembled);
if ($profile->isLoadableFromFile()) {
chdir($projectDirectoryAssembled);
Fixed in r17521 in trunk Hi sorry but i've just do a fresh checkout (r17563) and tried zf.bat on windows XP and it didn't worked for me : i had to edit Abstract.php on line 126 like this to make it work $projectDirectoryAssembled = implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray); regards Updating Fix Information I just checked out 1.9.1 from subversion, and this bug is still there. The second fix above works for me, but I do get the following (php 5.3.0) due to the use of the split() Deprecated: Function split() is deprecated in C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Tool\Project\Provider\Abstract.php on line 124 thanks! Same here. Just checked the 1.9.1 SVN. In abstract.php (Revision 17521) it should be fixed but still doesn't work for me. This worked for me: if (DIRECTORY_SEPARATOR == "\\") { $projectDirectoryAssembled = implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray); } else { $projectDirectoryAssembled = DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray); } inserted at line 127. thanks! guys i can't find the line: where can i find these lines to fix them ? im stuck now ... i downloaded latest version of zend framework, and i find those lines in abstract.php anyone help me please ... I'm working on ZF1.9.1 and Zend Studio 7.0. Both ZF 1.9.1 and ZS 7.0's Zend_Tool is not working properly. I cannot create neither controller nor action. Therefore ZS 7.0's code autocompletion has become maybe 5 times slower and has too many bugs like alpha or beta build. here's the error message i get: C:\Users\Administrator\Zend\workspaces\DefaultWorkspace7>"C:/Program Files/Zend/Zend Studio - 7.0.0/plugins/org.zend.php.framework.resource_7.0.0.v20090531-1639/resources/ZendFramework-1/bin//zf.bat" create action edit index Zend Framework Command Line Console Tool v1.9.1 what the hell is this ? i tried all the solutions you wrote, but without any effect ... Hi Murad - The problem is that you need to be in the project directory when you run zf create action...otherwise zf can't find the project profile cd c:\apache\htdocs\ zf create project myproject cd C:\apache\htdocs\myproject\ then zf create controller blah blah Is there any way to reopen this bug to get the source code fixed? Hi Rob, cd C:\Program Files\Zend\Apache2\htdocs\project1 although there was an existing zend framework project in that directory ... I have with ZF 1.9.1 the same problem like in the description at the top. The following code doesn't work:
With ZF 1.8.4 Patch 1 the code works. Please see |
||||||||||||||||||||||||||||||||||||||
The problem is on line 126 of Zend/Tool/Project/Provider/Abstract.php:
$projectDirectoryAssembled = DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray);
On Windows, this creates a $projectDirectoryAssembled of \C:\www\mytest for me!
Clearly the leading \ is wrong for Windows. Suggested patch:
Index: Zend/Tool/Project/Provider/Abstract.php =================================================================== --- Zend/Tool/Project/Provider/Abstract.php (revision 17369) +++ Zend/Tool/Project/Provider/Abstract.php (working copy) @@ -123,7 +123,11 @@ $parentDirectoriesArray = explode(DIRECTORY_SEPARATOR, ltrim($projectDirectory, DIRECTORY_SEPARATOR)); while ($parentDirectoriesArray) { - $projectDirectoryAssembled = DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray); + $projectDirectoryAssembled = implode(DIRECTORY_SEPARATOR, $parentDirectoriesArray); + if(substr(PHP_OS, 0, 3) != 'WIN') { + // prepend the DIRECTORY_SEPARATOR only if not on Windows + $projectDirectoryAssembled = DIRECTORY_SEPARATOR . $projectDirectoryAssembled; + } $profile->setAttribute('projectDirectory', $projectDirectoryAssembled); if ($profile->isLoadableFromFile()) {