How to run a cmd on a php file inside Phalcon

For example: i have a php file that contains the following code

namespace Res\Helper
use Engine\Helper;

class MyClass extends Helper
{
   public function __construct()
   {}

   public function testme()
   {
      return 'WORKS';
   }
}

When i run in cmd php MyClass.php it says that the class Engine is not found!



29.9k

Well, this is not so mysterious: how will php knows anything about Engine\Helper ???

More generally, phalcon run as a framework, wich has to be instanciated before running any action => what you're trying to do will never work

You should have a look at http://docs.phalconphp.com/en/latest/reference/cli.html for command line task with phalcon.



1.7k

Well i've tried that code it doesn't work ...i use phalconeye