Update Data.php

added function to check if currently in command line environmen