示例#1
0
 /**
  * Set reader defaults.
  */
 protected function setDefaults()
 {
     $this->setDelimiter(Ledger::get('csv.delimiter'));
     $this->setLineEnding(Ledger::get('csv.line_ending'));
     $this->setEnclosure(Ledger::get('csv.enclosure'));
     $this->setEncoding(Ledger::get('csv.encoding'));
 }
示例#2
0
 /**
  * Construct.
  */
 public function __construct()
 {
     $this->smarty = new Smarty();
     $this->smarty->setTemplateDir(Ledger::get('templates.path'));
     $this->smarty->setCompileDir(Ledger::get('templates.compile'));
     $this->smarty->setCacheDir(Ledger::get('templates.cache'));
     $this->smarty->setConfigDir(Ledger::get('templates.config'));
 }
示例#3
0
 /**
  * Make the view.
  *
  * @param string $file
  * @param array  $data
  *
  * @return $this
  */
 public function make($file, array $data = [])
 {
     // Find the template file
     $finder = new FileFinder(Ledger::get('templates.path'), $this->extension);
     // Compile the template with the PhpEngine
     $this->results = (new PhpEngine($finder))->compile($file, $data);
     return $this;
 }
示例#4
0
 /**
  * @param         $title
  * @param Closure $callback
  * @param Snappy  $driver
  */
 public function __construct($title, Closure $callback = null, Snappy $driver = null)
 {
     // Set Snappy instance
     $this->driver = $driver ?: new Snappy(Ledger::get('pdf.snappy.binary'), Ledger::get('pdf.snappy.options', []));
     if ($timeout = Ledger::get('pdf.snappy.timeout', false)) {
         $this->driver->setTimeout($timeout);
     }
     parent::__construct($title, $callback);
 }
示例#5
0
 /**
  * Resolve the factory.
  *
  * @return mixed
  */
 protected function resolveFactory()
 {
     // Mostly when using the blade factory Laravel is used,
     // so we can try to get the Laravel View factory from the ioC container
     if (function_exists('app') && method_exists(app(), 'bound') && app()->bound('view')) {
         return app('view');
     }
     // Resolve the View factor
     return (new BladeEngine(Ledger::get('templates.path'), Ledger::get('templates.cache')))->getFactory();
 }
示例#6
0
 public function test_default_get()
 {
     $this->assertEquals('default', Ledger::get('non-found', 'default'));
 }
示例#7
0
 /**
  * @return array
  */
 protected function getEngines()
 {
     return Ledger::get('templates.engines', $this->engines);
 }
示例#8
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     $loader = new Twig_Loader_Filesystem(Ledger::get('templates.path'));
     $this->twig = new Twig_Environment($loader, ['cache' => Ledger::get('templates.cache')]);
 }
示例#9
0
 public function test_render_a_template()
 {
     $engine = new BladeEngine(Ledger::get('templates.path'), Ledger::get('templates.cache'));
     $this->assertInstanceOf('Illuminate\\Contracts\\View\\Factory', $engine->getFactory());
 }