/** * 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')); }
/** * 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')); }
/** * 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; }
/** * @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); }
/** * 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(); }
public function test_default_get() { $this->assertEquals('default', Ledger::get('non-found', 'default')); }
/** * @return array */ protected function getEngines() { return Ledger::get('templates.engines', $this->engines); }
/** * Constructor. */ public function __construct() { $loader = new Twig_Loader_Filesystem(Ledger::get('templates.path')); $this->twig = new Twig_Environment($loader, ['cache' => Ledger::get('templates.cache')]); }
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()); }