On Windows i have the following script in a file called TrelloInt.main.php
<?php
$importData = file_get_contents("TrelloData\TrelloJsonExport.txt");
$json = json_decode($importData);
var_dump($json);
?>
all the file does is var_dump
the decoded json object to the screen.
when i open up Command Prompt i use the following script in a batch file
d:
cd "_Work\Automation\Selenium\_Selenium Server"
start call selenium
SET PATH=%PATH%;D:\_Work\Automation\Selenium\_php5.6.14;
cd ../
cls
selenium is a call to a batch file to start up selenium server but for this isn't important, the important part is SET PATH=%PATH%;D:\_Work\Automation\Selenium\_php5.6.14;
which i use so i can just use php
or phpunit
in Command Prompt from any folder
inside my php folder i have a phpunit.cmd file with the following line
@php "%~dp0phpunit.phar" %*
now from Command Prompt if i call php TrelloInt.main.php
i get my var_dump, likewise if i used phpunit TrelloInt.main.php
with the exception it complains that there is no TrelloInt.main class (expected)
however i can call my php file with phpunit trelloint.main
and it'll work fine but when i call my file with php trelloint.main
it says it can't open but it'll work just fine when i add .php at the end.
Is there a way for me to get php to ignore the extension at the end like how PHPUnit does in Windows Command Prompt