From 93fd4692f6eb753cae16358131c8049d84cfbb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 22 Jan 2015 08:30:07 +0100 Subject: symfony is there --- app/config/config.inc.default.php | 4 +- app/config/config.inc.php | 78 +++++++++++++++++++++++++++++++++++++++ app/config/config.yml | 73 ++++++++++++++++++++++++++++++++++++ app/config/config_dev.yml | 48 ++++++++++++++++++++++++ app/config/config_prod.yml | 25 +++++++++++++ app/config/config_test.yml | 16 ++++++++ app/config/global.inc.php | 2 +- app/config/parameters.yml.dist | 20 ++++++++++ app/config/routing.yml | 3 ++ app/config/routing_dev.yml | 22 +++++++++++ app/config/security.yml | 52 ++++++++++++++++++++++++++ app/config/services.yml | 9 +++++ 12 files changed, 349 insertions(+), 3 deletions(-) create mode 100644 app/config/config.inc.php create mode 100644 app/config/config.yml create mode 100644 app/config/config_dev.yml create mode 100644 app/config/config_prod.yml create mode 100644 app/config/config_test.yml create mode 100644 app/config/parameters.yml.dist create mode 100644 app/config/routing.yml create mode 100644 app/config/routing_dev.yml create mode 100644 app/config/security.yml create mode 100644 app/config/services.yml (limited to 'app/config') diff --git a/app/config/config.inc.default.php b/app/config/config.inc.default.php index c837b810..bbce4eab 100755 --- a/app/config/config.inc.default.php +++ b/app/config/config.inc.default.php @@ -13,7 +13,7 @@ @define ('STORAGE', 'sqlite'); # postgres, mysql or sqlite -@define ('STORAGE_SQLITE', ROOT . '/app/db/poche.sqlite'); # if you are using sqlite, where me database file is located +@define ('STORAGE_SQLITE', ROOT . '/data/db/poche.sqlite'); # if you are using sqlite, where me database file is located # only for postgres & mysql @define ('STORAGE_SERVER', 'localhost'); @@ -62,7 +62,7 @@ @define ('SHOW_PRINTLINK', '1'); // display or not percent of read in article view. Affects only default theme. @define ('SHOW_READPERCENT', '1'); -@define ('ABS_PATH', ROOT . '/app/assets/'); +@define ('ABS_PATH', ROOT . '/data/assets/'); @define ('DEFAULT_THEME', 'baggy'); diff --git a/app/config/config.inc.php b/app/config/config.inc.php new file mode 100644 index 00000000..405b9537 --- /dev/null +++ b/app/config/config.inc.php @@ -0,0 +1,78 @@ + + * @copyright 2013 + * @license http://opensource.org/licenses/MIT see COPYING file + */ + +@define ('SALT', 'ThisTokenIsNotSoSecretChangeIt'); # put a strong string here +@define ('LANG', 'en_EN.utf8'); + +@define ('STORAGE', 'sqlite'); # postgres, mysql or sqlite + +@define ('STORAGE_SQLITE', ROOT . '/data/db/poche.sqlite'); # if you are using sqlite, where me database file is located + +# only for postgres & mysql +@define ('STORAGE_SERVER', 'localhost'); +@define ('STORAGE_DB', 'poche'); +@define ('STORAGE_USER', 'poche'); +@define ('STORAGE_PASSWORD', 'poche'); + +################################################################################# +# Do not trespass unless you know what you are doing +################################################################################# +// Change this if http is running on nonstandard port - i.e is behind cache proxy +@define ('HTTP_PORT', 80); + +// Change this if not using the standart port for SSL - i.e you server is behind sslh +@define ('SSL_PORT', 443); + +@define ('MODE_DEMO', FALSE); +@define ('DEBUG_POCHE', FALSE); + +//default level of error reporting in application. Developers should override it in their config.inc.php: set to E_ALL. +@define ('ERROR_REPORTING', E_ALL & ~E_NOTICE); + +@define ('DOWNLOAD_PICTURES', FALSE); # This can slow down the process of adding articles +@define ('REGENERATE_PICTURES_QUALITY', 75); +@define ('CONVERT_LINKS_FOOTNOTES', FALSE); +@define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE); +@define ('SHARE_TWITTER', TRUE); +@define ('SHARE_MAIL', TRUE); +@define ('SHARE_SHAARLI', FALSE); +@define ('SHAARLI_URL', 'http://myshaarliurl.com'); +@define ('SHARE_DIASPORA', FALSE); +@define ('DIASPORA_URL', 'http://diasporapod.com'); # Don't add a / at the end +@define ('FLATTR', TRUE); +@define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url='); +@define ('NOT_FLATTRABLE', '0'); +@define ('FLATTRABLE', '1'); +@define ('FLATTRED', '2'); +@define ('CARROT', FALSE); + +// ebook +@define ('EPUB', TRUE); +@define ('MOBI', FALSE); +@define ('PDF', FALSE); + +// display or not print link in article view +@define ('SHOW_PRINTLINK', '1'); +// display or not percent of read in article view. Affects only default theme. +@define ('SHOW_READPERCENT', '1'); +@define ('ABS_PATH', ROOT . '/data/assets/'); + +@define ('DEFAULT_THEME', 'baggy'); + +@define ('THEME', ROOT . '/src/Wallabag/Wallabag/Resources/views'); +@define ('LOCALE', ROOT . '/src/Wallabag/Wallabag/Resources/translations'); +@define ('CACHE', ROOT . '/app/cache'); + +@define ('PAGINATION', '12'); + +//limit for download of articles during import +@define ('IMPORT_LIMIT', 5); +//delay between downloads (in sec) +@define ('IMPORT_DELAY', 5); diff --git a/app/config/config.yml b/app/config/config.yml new file mode 100644 index 00000000..25f66471 --- /dev/null +++ b/app/config/config.yml @@ -0,0 +1,73 @@ +imports: + - { resource: parameters.yml } + - { resource: security.yml } + - { resource: services.yml } + +framework: + #esi: ~ + #translator: { fallback: "%locale%" } + secret: "%secret%" + router: + resource: "%kernel.root_dir%/config/routing.yml" + strict_requirements: ~ + form: ~ + csrf_protection: ~ + validation: { enable_annotations: true } + templating: + engines: ['twig'] + #assets_version: SomeVersionScheme + default_locale: "%locale%" + trusted_hosts: ~ + trusted_proxies: ~ + session: + # handler_id set to null will use default session handler from php.ini + handler_id: ~ + fragments: ~ + http_method_override: true + +# Twig Configuration +twig: + debug: "%kernel.debug%" + strict_variables: "%kernel.debug%" + +# Assetic Configuration +assetic: + debug: "%kernel.debug%" + use_controller: false + bundles: [ ] + #java: /usr/bin/java + filters: + cssrewrite: ~ + #closure: + # jar: "%kernel.root_dir%/Resources/java/compiler.jar" + #yui_css: + # jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar" + +# Doctrine Configuration +doctrine: + dbal: + driver: "%database_driver%" + host: "%database_host%" + port: "%database_port%" + dbname: "%database_name%" + user: "%database_user%" + password: "%database_password%" + charset: UTF8 + # if using pdo_sqlite as your database driver: + # 1. add the path in parameters.yml + # e.g. database_path: "%kernel.root_dir%/data/data.db3" + # 2. Uncomment database_path in parameters.yml.dist + # 3. Uncomment next line: + # path: "%database_path%" + + orm: + auto_generate_proxy_classes: "%kernel.debug%" + auto_mapping: true + +# Swiftmailer Configuration +swiftmailer: + transport: "%mailer_transport%" + host: "%mailer_host%" + username: "%mailer_user%" + password: "%mailer_password%" + spool: { type: memory } diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml new file mode 100644 index 00000000..efaf396e --- /dev/null +++ b/app/config/config_dev.yml @@ -0,0 +1,48 @@ +imports: + - { resource: config.yml } + +framework: + router: + resource: "%kernel.root_dir%/config/routing_dev.yml" + strict_requirements: true + profiler: { only_exceptions: false } + +web_profiler: + toolbar: true + intercept_redirects: false + +monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + console: + type: console + bubble: false + verbosity_levels: + VERBOSITY_VERBOSE: INFO + VERBOSITY_VERY_VERBOSE: DEBUG + channels: ["!doctrine"] + console_very_verbose: + type: console + bubble: false + verbosity_levels: + VERBOSITY_VERBOSE: NOTICE + VERBOSITY_VERY_VERBOSE: NOTICE + VERBOSITY_DEBUG: DEBUG + channels: ["doctrine"] + # uncomment to get logging in your browser + # you may have to allow bigger header sizes in your Web server configuration + #firephp: + # type: firephp + # level: info + #chromephp: + # type: chromephp + # level: info + +assetic: + use_controller: true + +#swiftmailer: +# delivery_address: me@example.com diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml new file mode 100644 index 00000000..342837a0 --- /dev/null +++ b/app/config/config_prod.yml @@ -0,0 +1,25 @@ +imports: + - { resource: config.yml } + +#framework: +# validation: +# cache: apc + +#doctrine: +# orm: +# metadata_cache_driver: apc +# result_cache_driver: apc +# query_cache_driver: apc + +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + console: + type: console diff --git a/app/config/config_test.yml b/app/config/config_test.yml new file mode 100644 index 00000000..2f6d9250 --- /dev/null +++ b/app/config/config_test.yml @@ -0,0 +1,16 @@ +imports: + - { resource: config_dev.yml } + +framework: + test: ~ + session: + storage_id: session.storage.mock_file + profiler: + collect: false + +web_profiler: + toolbar: false + intercept_redirects: false + +swiftmailer: + disable_delivery: true diff --git a/app/config/global.inc.php b/app/config/global.inc.php index 59db5aa1..8e62818b 100755 --- a/app/config/global.inc.php +++ b/app/config/global.inc.php @@ -22,4 +22,4 @@ if (!ini_get('date.timezone') || !@date_default_timezone_set(ini_get('date.timez if (defined('ERROR_REPORTING')) { error_reporting(ERROR_REPORTING); -} \ No newline at end of file +} diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist new file mode 100644 index 00000000..1da778f4 --- /dev/null +++ b/app/config/parameters.yml.dist @@ -0,0 +1,20 @@ +# This file is a "template" of what your parameters.yml file should look like +parameters: + database_driver: pdo_mysql + database_host: 127.0.0.1 + database_port: ~ + database_name: symfony + database_user: root + database_password: ~ + # You should uncomment this if you want use pdo_sqlite + # database_path: "%kernel.root_dir%/data.db3" + + mailer_transport: smtp + mailer_host: 127.0.0.1 + mailer_user: ~ + mailer_password: ~ + + locale: en + + # A secret key that's used to generate certain security-related tokens + secret: ThisTokenIsNotSoSecretChangeIt diff --git a/app/config/routing.yml b/app/config/routing.yml new file mode 100644 index 00000000..a748d532 --- /dev/null +++ b/app/config/routing.yml @@ -0,0 +1,3 @@ +app: + resource: @WallabagBundle/Controller/ + type: annotation diff --git a/app/config/routing_dev.yml b/app/config/routing_dev.yml new file mode 100644 index 00000000..99130058 --- /dev/null +++ b/app/config/routing_dev.yml @@ -0,0 +1,22 @@ +_wdt: + resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" + prefix: /_wdt + +_profiler: + resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" + prefix: /_profiler + +_configurator: + resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" + prefix: /_configurator + +_errors: + resource: "@TwigBundle/Resources/config/routing/errors.xml" + prefix: /_error + +_main: + resource: routing.yml + +# AcmeDemoBundle routes (to be removed) +_acme_demo: + resource: "@AcmeDemoBundle/Resources/config/routing.yml" \ No newline at end of file diff --git a/app/config/security.yml b/app/config/security.yml new file mode 100644 index 00000000..a28b1db9 --- /dev/null +++ b/app/config/security.yml @@ -0,0 +1,52 @@ +# you can read more about security in the related section of the documentation +# http://symfony.com/doc/current/book/security.html +security: + # http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password + encoders: + Symfony\Component\Security\Core\User\User: plaintext + + # http://symfony.com/doc/current/book/security.html#hierarchical-roles + role_hierarchy: + ROLE_ADMIN: ROLE_USER + ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] + + # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers + providers: + in_memory: + memory: + users: + user: { password: userpass, roles: [ 'ROLE_USER' ] } + admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] } + + # the main part of the security, where you can set up firewalls + # for specific sections of your app + firewalls: + # disables authentication for assets and the profiler, adapt it according to your needs + dev: + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + # the login page has to be accessible for everybody + demo_login: + pattern: ^/demo/secured/login$ + security: false + + # secures part of the application + demo_secured_area: + pattern: ^/demo/secured/ + # it's important to notice that in this case _demo_security_check and _demo_login + # are route names and that they are specified in the AcmeDemoBundle + form_login: + check_path: _demo_security_check + login_path: _demo_login + logout: + path: _demo_logout + target: _demo + #anonymous: ~ + #http_basic: + # realm: "Secured Demo Area" + + # with these settings you can restrict or allow access for different parts + # of your application based on roles, ip, host or methods + # http://symfony.com/doc/current/cookbook/security/access_control.html + access_control: + #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https } \ No newline at end of file diff --git a/app/config/services.yml b/app/config/services.yml new file mode 100644 index 00000000..5c76fc59 --- /dev/null +++ b/app/config/services.yml @@ -0,0 +1,9 @@ +# Learn more about services, parameters and containers at +# http://symfony.com/doc/current/book/service_container.html +parameters: +# parameter_name: value + +services: +# service_name: +# class: AppBundle\Directory\ClassName +# arguments: ["@another_service_name", "plain_value", "%parameter_name%"] -- cgit v1.2.3