Commit eb6a14be authored by Julien Neuhart's avatar Julien Neuhart
Browse files

first commit

parents
# Gotenberg demo
## Quick start
```bash
$ docker-compose up -d
```
Go to http://gotenberg-demo.localhost/vendor/mouf/mouf and configure your Mouf instance.
Voilà :metal:
vendor
\ No newline at end of file
<IfModule !mod_rewrite.c>
# Use an error page as index file. It makes sure a proper error is displayed if
# mod_rewrite is not available. Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex vendor/mouf/mvc.splash/src/rewrite_missing.php
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# .htaccess RewriteBase related tips courtesy of Symfony 2's skeleton app.
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
# resolution of the base directory and to redirect to the correct URI. It will
# work in environments without path prefix as well, providing a safe, one-size
# fits all solution. But as you do not need it in this case, you can comment
# the following 2 lines to eliminate the overhead.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
# If the requested filename exists, and has an allowed extension, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .*((\.(js|ico|gif|jpg|png|css|woff|ttf|svg|eot|map)$)|^vendor) - [L]
# Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/vendor/mouf/mvc.splash/src/splash.php [L]
</IfModule>
\ No newline at end of file
{
"require": {
"mouf/mouf": "^2.0",
"mouf/mvc.splash": "^8.2",
"http-interop/http-middleware": "^0.4",
"mouf/database.tdbm": "^5",
"mouf/database.patcher": "^2.5",
"php-http/guzzle6-adapter": "^1.1",
"thecodingmachine/gotenberg-php-client": "^2.0.1",
"mouf/html.widgets.messageservice": "^3"
},
"prefer-stable": true,
"minimum-stability": "dev",
"autoload": {
"psr-4": { "GotenbergDemo\\": "src/" }
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
/**
* This is a file automatically generated by the Mouf framework. Do not put any code except 'define' operations
* as it could be overwritten.
* Instead, use the Mouf User Interface to set all your constants: http://[server]/vendor/mouf/mouf/mouf/config
*/
/**
* Set to true to enable debug/development mode.
*/
define('DEBUG', getenv('DEBUG') !== false?getenv('DEBUG'):true);
/**
* A random string. It should be different for any application deployed.
*/
define('SECRET', getenv('SECRET') !== false?getenv('SECRET'):'uEN1cRdnhytVnMUg9MJh');
/**
* The database host (the IP address or URL of the database server).
*/
define('DB_HOST', getenv('DB_HOST') !== false?getenv('DB_HOST'):'mysql');
/**
* The database port (the port of the database server, keep empty to use default port).
*/
define('DB_PORT', getenv('DB_PORT') !== false?getenv('DB_PORT'):'3306');
/**
* The name of your database.
*/
define('DB_NAME', getenv('DB_NAME') !== false?getenv('DB_NAME'):'gotenberg_demo');
/**
* The username to access the database.
*/
define('DB_USERNAME', getenv('DB_USERNAME') !== false?getenv('DB_USERNAME'):'demo');
/**
* The password to access the database.
*/
define('DB_PASSWORD', getenv('DB_PASSWORD') !== false?getenv('DB_PASSWORD'):'demo');
DROP TABLE document;
\ No newline at end of file
CREATE TABLE document (id INT AUTO_INCREMENT NOT NULL, file LONGBLOB NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
\ No newline at end of file
<?php
define('ROOT_PATH', realpath(__DIR__.'/..').DIRECTORY_SEPARATOR);
require_once __DIR__.'/../config.php';
if (defined('ROOT_URL')) {
define('MOUF_URL', ROOT_URL.'vendor/mouf/mouf/');
}
require_once __DIR__.'/../vendor/autoload.php';
require_once 'MoufComponents.php';
?>
\ No newline at end of file
<?php
/**
* This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.
*/
use Mouf\MoufManager;
use Interop\Container\ContainerInterface;
MoufManager::initMoufManager();
$moufManager = MoufManager::getMoufManager();
$moufManager->getConfigManager()->setConstantsDefinitionArray(array (
'DEBUG' =>
array (
'defaultValue' => true,
'type' => 'bool',
'comment' => 'Set to true to enable debug/development mode.',
'fetchFromEnv' => true,
),
'SECRET' =>
array (
'defaultValue' => '6U5xNhMa6i9sV2teDicd',
'type' => 'string',
'comment' => 'A random string. It should be different for any application deployed.',
'fetchFromEnv' => true,
),
'DB_HOST' =>
array (
'defaultValue' => 'localhost',
'type' => 'string',
'comment' => 'The database host (the IP address or URL of the database server).',
'fetchFromEnv' => true,
),
'DB_PORT' =>
array (
'defaultValue' => '',
'type' => 'int',
'comment' => 'The database port (the port of the database server, keep empty to use default port).',
'fetchFromEnv' => true,
),
'DB_NAME' =>
array (
'defaultValue' => '',
'type' => 'string',
'comment' => 'The name of your database.',
'fetchFromEnv' => true,
),
'DB_USERNAME' =>
array (
'defaultValue' => '',
'type' => 'string',
'comment' => 'The username to access the database.',
'fetchFromEnv' => true,
),
'DB_PASSWORD' =>
array (
'defaultValue' => '',
'type' => 'string',
'comment' => 'The password to access the database.',
'fetchFromEnv' => true,
),
));
$moufManager->setAllVariables(array (
'splashDefaultControllersNamespace' => 'GotenbergDemo\\Controllers\\',
'splashDefaultViewsDirectory' => 'views/',
'tdbmDefaultDaoNamespace_tdbmService' => 'GotenbergDemo\\Dao',
'tdbmDefaultBeanNamespace_tdbmService' => 'GotenbergDemo\\Dao\\Bean',
'tdbmDefaultDaoFactoryName_tdbmService' => '',
'tdbmDefaultDaoFactoryInstanceName_tdbmService' => '',
'tdbmDefaultStoreInUtc_tdbmService' => 0,
'tdbmDefaultUseCustomComposer_tdbmService' => false,
'tdbmDefaultComposerFile_tdbmService' => '',
'tdbmDefaultDaoNamespace' => 'GotenbergDemo\\Dao',
'tdbmDefaultBeanNamespace' => 'GotenbergDemo\\Dao\\Bean',
'tdbmDefaultDaoFactoryName' => '',
'tdbmDefaultDaoFactoryInstanceName' => '',
'tdbmDefaultStoreInUtc' => 0,
'tdbmDefaultUseCustomComposer' => false,
'tdbmDefaultComposerFile' => '',
));
$moufManager->addComponentInstances(array (
'Mouf\\Database\\TDBM\\Utils\\MoufDiListener' =>
array (
'class' => 'Mouf\\Database\\TDBM\\Utils\\MoufDiListener',
'external' => false,
'weak' => false,
),
'Mouf\\Mvc\\Splash\\Controllers\\HttpErrorsController' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Controllers\\HttpErrorsController',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' => 'bootstrapTemplate',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
1 =>
array (
'value' => 'block.content',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
2 =>
array (
'value' => 'DEBUG',
'parametertype' => 'primitive',
'type' => 'config',
'metadata' =>
array (
),
),
),
),
'Mouf\\Mvc\\Splash\\Routers\\ExceptionRouter' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Routers\\ExceptionRouter',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Controllers\\HttpErrorsController',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
1 =>
array (
'value' => 'psr.errorLogLogger',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'Mouf\\Mvc\\Splash\\Routers\\NotFoundRouter' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Routers\\NotFoundRouter',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Controllers\\HttpErrorsController',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
1 =>
array (
'value' => 'psr.errorLogLogger',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'Mouf\\Mvc\\Splash\\Routers\\PhpVarsCheckRouter' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Routers\\PhpVarsCheckRouter',
'external' => false,
'weak' => false,
),
'Mouf\\Mvc\\Splash\\Routers\\SplashDefaultRouter' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Routers\\SplashDefaultRouter',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' => 'return $container;',
'parametertype' => 'primitive',
'type' => 'php',
'metadata' =>
array (
),
),
1 =>
array (
'value' =>
array (
0 => 'Mouf\\Mvc\\Splash\\Services\\MoufExplorerUrlProvider',
),
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
2 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Services\\ParameterFetcherRegistry',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
3 =>
array (
'value' => 'splashCachePool',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
4 =>
array (
'value' => 'psr.errorLogLogger',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
5 =>
array (
'value' => 'strict',
'parametertype' => 'primitive',
'type' => 'string',
'metadata' =>
array (
),
),
6 =>
array (
'value' => 'DEBUG',
'parametertype' => 'primitive',
'type' => 'config',
'metadata' =>
array (
),
),
7 =>
array (
'value' => 'return ROOT_URL;',
'parametertype' => 'primitive',
'type' => 'php',
'metadata' =>
array (
),
),
),
'setterBinds' =>
array (
'setHttp400Handler' => 'Mouf\\Mvc\\Splash\\Controllers\\HttpErrorsController',
),
),
'Mouf\\Mvc\\Splash\\Services\\ControllerAnalyzer' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\ControllerAnalyzer',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' => 'return $container;',
'parametertype' => 'primitive',
'type' => 'php',
'metadata' =>
array (
),
),
1 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Services\\ParameterFetcherRegistry',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
2 =>
array (
'value' => 'annotationReader',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'Mouf\\Mvc\\Splash\\Services\\ControllerRegistry' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\ControllerRegistry',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Services\\ControllerAnalyzer',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
1 =>
array (
'value' =>
array (
),
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
2 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Services\\MoufControllerExplorer',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'Mouf\\Mvc\\Splash\\Services\\MoufControllerExplorer' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\MoufControllerExplorer',
'external' => false,
'weak' => false,
),
'Mouf\\Mvc\\Splash\\Services\\MoufExplorerUrlProvider' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\MoufExplorerUrlProvider',
'external' => false,
'weak' => false,
),
'Mouf\\Mvc\\Splash\\Services\\ParameterFetcherRegistry' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\ParameterFetcherRegistry',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' =>
array (
0 => 'Mouf\\Mvc\\Splash\\Services\\SplashRequestFetcher',
1 => 'Mouf\\Mvc\\Splash\\Services\\SplashRequestParameterFetcher',
),
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'Mouf\\Mvc\\Splash\\Services\\SplashRequestFetcher' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\SplashRequestFetcher',
'external' => false,
'weak' => false,
),
'Mouf\\Mvc\\Splash\\Services\\SplashRequestParameterFetcher' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Services\\SplashRequestParameterFetcher',
'external' => false,
'weak' => false,
),
'Mouf\\Mvc\\Splash\\SplashMiddleware' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\SplashMiddleware',
'external' => false,
'weak' => false,
'constructor' =>
array (
0 =>
array (
'value' =>
array (
0 => '__anonymous__2e32_486887514',
1 => '__anonymous__2e32_156024690',
2 => '__anonymous__2e32_1010053997',
3 => '__anonymous__2e32_93010772',
4 => '__anonymous__2e32_1716763376',
5 => '__anonymous__2e32_526446919',
),
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'Psr7Middlewares\\Middleware\\Payload' =>
array (
'class' => 'Psr7Middlewares\\Middleware\\Payload',
'external' => false,
'weak' => false,
),
'__anonymous__2e32_1010053997' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Routers\\Router',
'external' => false,
'anonymous' => true,
'weak' => true,
'constructor' =>
array (
0 =>
array (
'value' => 'Mouf\\Mvc\\Splash\\Routers\\PhpVarsCheckRouter',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'__anonymous__2e32_1331138354' =>
array (
'class' => 'Mouf\\Utils\\Patcher\\Commands\\RevertPatchCommand',
'external' => false,
'anonymous' => true,
'weak' => true,
'constructor' =>
array (
0 =>
array (
'value' => 'patchService',
'parametertype' => 'object',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'__anonymous__2e32_1379206165' =>
array (
'class' => 'Mouf\\Console\\Command\\MoufRewriteCommand',
'external' => false,
'anonymous' => true,
'weak' => true,
'constructor' =>
array (
0 =>
array (
'value' => 'mouf:rewrite',
'parametertype' => 'primitive',
'type' => 'string',
'metadata' =>
array (
),
),
),
),
'__anonymous__2e32_156024690' =>
array (
'class' => 'Mouf\\Mvc\\Splash\\Routers\\Router',
'external' => false,
'anonymous' => true,
'weak' => true,
'constructor' =>
array (
0 =>
array (
'value' => 'return $container->get(\'whoopsMiddleware\');',
'parametertype' => 'primitive',
'type' => 'php',
'metadata' =>
array (
),
),
1 =>
array (
'value' => NULL,
'parametertype' => 'primitive',
'type' => 'string',
'metadata' =>
array