Using Craft inside Lumen / Laravel I’m trying to bootstrap Craft as a service inside of another framework (lumen). I’m requiring the bootstrap file which seems to get me up and running except that plugins and assets aren’t included in the EntryModel results.

I’m requiring Craft like this:


$craft = require_once base_path().'/../craft/app/bootstrap.php'; 
$this-&gt;app-&gt;singleton('Craft', function() use ($craft) { 
    return $craft;
 });


and then getting my EntryModel like this:


$criteria = app()-&gt;make('Craft')-&gt;elements-&gt;getCriteria(ElementType::Entry);
 $criteria-&gt;section = 'emails'; 
$criteria-&gt;slug = 'tuition-agreement-link'; 
$email = $criteria-&gt;first();


Text content returns perfectly, but asset fields return null. The one thing I can see that craft/app/index.php does differently than me is calling $app->run() (since I'm not actually trying to run the full blown app with request routing). Anyone know if there is an additional step I can take to bootstrap assets and plugins without running the full blown app? Am I trying to do the impossible?
Craig, I really don't know much directly about this, but it occurred to me to look at the ConsoleApp, which is used in one normal way to run Craft headless (from yiic on command line). It's in app/etc/console/ConsoleApp.php.

A little hunting around with PhpStorm, excellent for this sort of thing as others, turns up that ConsoleApp is loading plugins, and I think it will be loading things like Assets through the loadEditionComponents call -- edition checks out to mean Craft Edition, as Personal, Client, Pro, etc. by your license -- so that S3 might be available for Assets, and so forth.

Just what you would need to do, haven't time to go further on. You might find just calling ConsoleApp->run() would do, or may have to make a modified version of ConsoleApp, but seems it might make a good scaffold in that case.

Good fortune on this; interested to know what you work out.