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->app->singleton('Craft', function() use ($craft)
{
return $craft;
});
and then getting my EntryModel like this:
$criteria = app()->make('Craft')->elements->getCriteria(ElementType::Entry);
$criteria->section = 'emails';
$criteria->slug = 'tuition-agreement-link';
$email = $criteria->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?