Applies To:
[ Zend Studio 7.0.0 ]
[ All operating systems ]
Symptom
When importing Zend Studio for Eclipse 6.x projects into the workspace of Zend Studio 7.0.0, the standard PHP functions, such as print_r(), explode(), count(), etc. are not recognized as valid functions. Warnings appear in Problems view and in the annotation bar: "Call to undefined function".
Technical Details
This happens because Zend Studio 7.0.0 fails to create a full set of files that define the behavior of a PHP Project. Specifically, the file called '.buildpath' must reside in the project root. This file defines which code libraries are loaded for the project in question. The library that is responsible for built-in PHP functions is called PHP Language Library. In a "healthy" PHP Project this library is displayed in PHP Explorer view:
The projects imported from Zend Studio for Eclipse 6.x don't have this library, or the library entry is displayed empty.
This problem will be fixed in the next version of Zend Studio.
Resolution / Workaround
To workaround this problem the user needs to manually add relevant content into the '.buildpath' file.
- Close the project (Project | Close Project).
- Open the '.buildpath' file that resides in the project's root directory with a text editor. If the file does not exist, create it.
- Paste the correct contents into the '.buildpath' file:
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
<buildpathentry kind="con" path="org.zend.php.framework.CONTAINER"/>
</buildpath>
- Save the file.
- Open your project (Project | Open Project).
- Rebuild the project (Project | Clean).
After the build process finishes, you should see no warnings for standard PHP functions.
Excerpt: When importing Zend Studio for Eclipse 6.x projects into the workspace of Zend Studio 7.0.0, the standard PHP functions, such as print_r(), explode(), count(), etc. are not recognized as valid functions. This article provides a workaround for this problem.
Original Post Date: 2009-12-25 18:29:13
Alternative Description:
When importing Zend Studio for Eclipse 6.x projects into the workspace of Zend Studio 7.0.0, the standard PHP functions, such as print_r(), explode(), count(), etc. are not recognized as valid functions. This article provides a workaround for this problem.
Comments