Sunday, 15 March 2015

How to run a php static function from the command line? -



How to run a php static function from the command line? -

i want run function in php script linux command line. php script looks follows:

<?php namespace mycompany\admin; class mymodel { public static function mymethod() { echo 'something'; } }

normally this: php thefile.php, since function not called anywhere, isn't run. have no thought however, how phone call function command line.

anybody?

create file run.php:

<?php require 'thefile.php'; mymodel::mymethod();

php command-line

No comments:

Post a Comment