0

I have to execute a script which is in the project's root directory.

My script is instancing some classes, but unfortunately, it says that my class isn't found when I do a "PHP myscript.php".

I can try with includes, but I have several errors when a class extends another (external abstract class). Is there a way to make this script "part of the project", in order to not include each class?

I read a similar question but it does not answer exactly to my question: How do you execute a method in a class from the command line

Thanks,

Sayed Mohd Ali
  • 2,156
  • 3
  • 12
  • 28
Jojoe
  • 35
  • 7

1 Answers1

0

If you want a script that is reusable I would recommend creating a command and executing that command when needed.

See: The laravel docs

EDIT

Sorry, I falsely pressumend you were using the Laravel Framework, for Zend see: The Zend/console docs

Teun Vos
  • 584
  • 5
  • 9
  • This is what I was just looking for, but for Zend Framework it doesn't seems native like laravel or symfony – Jojoe Jul 10 '19 at 12:32