Exemplo n.º 1
0
	static protected function getManager()
	{
		return Service::getService('user_manager');
	}
Exemplo n.º 2
0
	static protected function getManager()
	{
		return Service::getService('document_manager');
	}
Exemplo n.º 3
0
	public function getSignature()
	{
		foreach(Log::getForItemId($this->getId()) as $log) {
			
			if (ItemStatus::UNREGISTER == $log['value']['logType']) {
				$ass = Log::find($log['id'])->getAttachments();
				if (array_key_exists('signature.png', $ass)) {
					
					/* 
					 * Store the file with prefix 'signature_' appending the
					 * item ID for this specific Log with extension 'png' if 
					 * it does not already exist in our Cache 
					 * $log['key']['0'] == item id for this log
					 */
					$filename = 'signature_'.$log['id'] . '.png';
					if (!Service::getService('cache')->exists($filename)) 
					{
						$config = Service::getService('config');
						Service::getService('cache')->writeRaw($filename, 
							$ass[$config['img.state.delivered']]->getRawData());
					}
					return Service::getService('cache')->getPath($filename);
				}
			}
		}
		return false;
	}
Exemplo n.º 4
0
$app['document_manager'] = OdmFactory::createOdm(
	$app['config']['db.database'],
	$app['config']['db.server'],
	$app['config']['db.port'],
	'roadrunner', 'roadrunner'
);
$app['user_manager'] = OdmFactory::createOdm(
	$app['config']['db.user_database'],
	$app['config']['db.server'],
	$app['config']['db.port'],
	'roadrunner', 'roadrunner'
);
$app['cache'] = new Cache();

// twig
$app->register(new TwigExtension(), array(
    'twig.path'       => __DIR__.'/../views',
    'twig.class_path' => __DIR__.'/../vendor/Twig/lib',
));

// logger
$app['log'] = new Logger('roadrunner');
$app['log']->pushHandler(new StreamHandler(
	'file://' . __DIR__ . '/../log/error.log',
	Logger::ERROR
));

// register service provider
Service::registerProvider($app);

return $app;