Marcel Stäheli Posted June 14, 2018 Share Posted June 14, 2018 We recently got the Visual Studio 2017 plugin PHP Tools for Visual Studio by Devense for php development. Unfortunately the plugin does not recognize processwire. I imported all website files into the PHP-Project so there is no file missing. But files are not being prepended, variables like $page are undefined. The plugin works fine with regular PHP code. I'm not sure where the error lies. Do I have to configure PW specifically or are the two simply incompatible? Has anybody experience with this plugin? Link to comment Share on other sites More sharing options...
dragan Posted June 14, 2018 Share Posted June 14, 2018 You might want to use the functions API (just literally discovered it myself seconds ago...) https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api 2 Link to comment Share on other sites More sharing options...
Marcel Stäheli Posted June 14, 2018 Author Share Posted June 14, 2018 It now displays the function information (phpdocs) correctly. But I still get errors when debugging that the functions are undefined. Thanks for that link though, I didn't know about that. Link to comment Share on other sites More sharing options...
Marcel Stäheli Posted June 25, 2018 Author Share Posted June 25, 2018 I found a solution. In case someone else has this problem in the future: One has to explicitly use an apache server for it to work. Processwire requires "mod_rewrite" which is not present in php build-in and it seems neither it is with IIS-express. So in the "project settings->server" choose "custom" as server and enter the project url. I used xampp to run the apache server and mysql database. Make sure xdebug is installed in the php-installation of xampp. Now php tools reads all PW variables and functions properly, no need for page() (still good to know that it exists). 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now