Netbeans PHP - how to run all the files in a directory - php

I am running PHP files in my NetBeans with a shell script command. So far so good. I can run individual files without any problem. Sometimes, however, I would like to run all the files in a directory (and it's subdirectories). I tried selecting the directory and hitting the shortcut for "Run" but nothing happens. If I select multiple files and hit "Run" only the last one selected will be run.
I am using the latest NetBeans 7.0.1 on MacOS 10.6. Thanks.

Never heard of such a feature. What I'd do with NetBeans is create a php application and in the main file write some code calling each php file... it will look ugly but I think it's the only way

Related

change working directory from cli php script

I wrote a simple project boostraper using bash.
It asks simple questions such as the parent folder to create the project inside, the type of the project (cli, web php, web symfony, web npm, etc…), the required dependencies, bootstrap everything, init git, and so on.
Then it returns the terminal to the user after changing the working directory to the freshly bootstraped one.
Fine.
I decided to rewrite the whole script using php in order to have a more user friendly cli interface (nice menus, progress bars, etc…) and to be able to pack the whole script in one and only binary (phar).
I struggle with the last part of the script: The one which was the simpliest part of the previous bash script:
cd $newprojectpath
exit 0;
For a reason I can't really figure out, I cannot do the same using a php script.
chdir allows me to change the working directory for the current php process but as soon as it is over, I'm back to working directory from where I invoked the php script (the one from where I spawned the php interpreter sub-process, obviously).
The only way I found in order to achieve this very simple move is to spawn a new shell sub-process from the php script itself.
It works, but I don't like it.
chdir($project->path);
pcntl_exec(getenv('SHELL'));
Did I miss a more simple way to change working directory using PHP cli ?

Netbeans 12.3 copies files to proc folder in Linux

I've recently been wanting to start writing PHP websites again and installed Netbeans onto Linux Mint.
So I set up the project folder and the Web root as I would have done in netbeans 8.2, the last version I used.
It seems this time the files don't get copied to /var/www/html but instead get copied to /proc/12424/var/www/html.
I have tried so many combinations to try and get it to copy correctly but it does not.
So I installed Netbeans 8.2 to see if I have forgotten something in the project creation process. In 8.2 the copy process works perfectly. So what is the deal with 12.3? Does anyone know why it is copying to the proc folder and how I can change it?
Numerous Google searches has yielded no results.

PhpStorm 2016.3.1 - run single page in the browser quickly

Since recently I use PhpStorm 2016.3.1 for my php projects. XAMPP works in the background and is connected to the IDE. It's a great IDE but I'm searching for a solution to run a single file in the browser.
The index file of Laravel loads over the run command perfectly. But an individual file makes a problem.
Everytime I want to open the file the browser gets me an error back that the directory to the file is wrong or the classes not found.
How can I setup that for a better workflow?

MAMP moodle project

I am working on a moodle based project, which I inherited from someone else. Having copied the files into htdocs folder and started MAMP, the files still don't show in the browser. Instead, the browser automatically initiates a download. I might be required to change the config file, however, since I do not have much experience with php and SQL I am not sure what exactly. My part of the project is to develop html and css, but need to be able to run it locally first.
What do I need to do to get the files run locally? The route I use is localhost:8888/whatever/whatever/index.php
In case someone else runs into the same problem - Apache downloads php files instead of reading them - here is what helped me.
.htaccess file may need changes if the application has changed servers.
Delete (at least rename if you don't want to remove it) config.php and run the application through the browser. It should initiate install automatically.
To run php and SQL I used MAMP.

Using gulp livereload with XAMPP

I been using gulp for front-end development lately and I find it very helpful.
I use XAMPP in windows for making PHP website some of which sometime include database operations.
Now, I have used gulp-livereload and gulp-connect for starting a server for front-end but then it won't process the PHP files.
All I want to do is, PHP livereload with database access. Like livereloading but via XAMPP's server(since it can process PHP).
yes, I have found a temporary solution for now.
See, it's just temporary but as long as you write PHP correct, you will get the work done. Let me tell you how I do it.
Though right off the start I want to tell you that this is not a proper way to approach this, you should use some MVC framework.
Anyway,
I have XAMPP installed under Windows 8.1 and XAMPP's htdocs is in my "C" Drive.
I then create a folder inside "htdocs" in which I put all my frontend + backend code.Basically, gulpfile.js is at the root, then there is a components folder in which all front-end sources reside. There is another folder at root called "www" inside which I put my index.php.
Then I load gulp-livereload instead of gulp-connect and I add the livereload.listen(); method and Tags in all the php files I want to reload.
Works very fine except when PHP throws an error, untill you correct that error, you have keep reloading the page manually.

Categories