<?php
namespace App\PromemoriaBundle;
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
class PromemoriaBundle extends AbstractPimcoreBundle
{
public static function getConfig()
{
$config = [];
$file = \Pimcore\Config::locateConfigFile("promemoria.php");
if (file_exists($file)) {
$config = include $file;
}
return $config;
}
public function getInstaller()
{
$db = \Pimcore\Db::get();
$sql = "CREATE TABLE IF NOT EXISTS `promemoria_shorturl` (`id` int(11) NOT NULL AUTO_INCREMENT,
`jwtToken` text NOT NULL,`shortToken` varchar(16) NOT NULL,`insertDate` datetime NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
$db->query($sql);
}
public function getJsPaths()
{
$result = [];
foreach (glob(dirname(__FILE__) . "/Resources/public/js/*.js") as $filename) {
$result[] = '/bundles/promemoria/js/' . basename($filename);
}
return $result;
}
}