1

I have two separate projects in one server. one of them is a Zend Console application called "importer" and the other one is a complete Zend Framework 2 application called "VAP".

I want to call one of my functions in VAP from my console application. I have this function as a function in my model in VAP and also as a controller's Action (reachable with URL).

is such a thing possible at all ? if yes, how ?

I have already tried cURL to reach to that URL and call that action, but as my application is working only for logged-in users, it seems not working.

Amir Koklan
  • 897
  • 2
  • 12
  • 32
  • What kind of authentication your application `VAP` is using? I believe `cURL` supports some of them. – D4V1D Mar 25 '15 at 10:18

2 Answers2

1

although Rest or SOAP are the best options here, they are quite hard to implement and time consuming.

You can use basic authorization of cURL as mentioned here: HTTP Basic Authentication - what's the expected browser experience?

Community
  • 1
  • 1
Daniel
  • 26
  • 6
0

You need to write web service in your application VAP, So it can be consumed by console app. You can opt either for REST or SOAP. REST is easier and may not require big efforts. You just need to Study RestfulController in ZF2. Build services + apply authentication via token ( if required ).

You can found lot of web links for rest applications in ZF2. like

http://hounddog.github.io/blog/getting-started-with-rest-and-zend-framework-2/

kuldeep.kamboj
  • 2,566
  • 3
  • 26
  • 63