External library: {{ code.extlib }}
diff --git a/Source/assets/html/doc.twig b/Source/assets/html/doc.twig
index 0b7ef73..d40a223 100644
--- a/Source/assets/html/doc.twig
+++ b/Source/assets/html/doc.twig
@@ -1,4 +1,4 @@
-{% extends "base.twig" %}
+{% extends app.fronthtml~"/base.twig" %}
{% block content %}
Documentation
@@ -9,9 +9,9 @@
First, you need to sign up in CodeShare (link), and then go to submit page to start.
- 
+
Write the solution's name and description. Notice that in this input boxes you shouldn't type any reference of language they can be uploaded in multiple languages in the future, and there are a box for language.
- 
+
Now select language to help other users to find it easily.
If your solution use a external library you can add its name and its version in their own input boxes.
After that, introduce the Input and Output examples with the following criteria:
diff --git a/Source/assets/html/firstCodes.twig b/Source/assets/html/firstCodes.twig
index c9a3138..759ba73 100644
--- a/Source/assets/html/firstCodes.twig
+++ b/Source/assets/html/firstCodes.twig
@@ -7,7 +7,7 @@
{% endif %}
- {% include "codebox.twig" %}
+ {% include app.fronthtml~"/codebox.twig" %}
{% endfor %}
diff --git a/Source/assets/html/firstpage.twig b/Source/assets/html/firstpage.twig
index d919ce7..b236bdd 100644
--- a/Source/assets/html/firstpage.twig
+++ b/Source/assets/html/firstpage.twig
@@ -1,8 +1,8 @@
-{% extends "base.twig" %}
+{% extends app.fronthtml~"/base.twig" %}
{% block content %}
Last codes
-{% include "filter.twig" %}
+{% include app.fronthtml~"/filter.twig" %}
- {% include "firstCodes.twig" %}
+ {% include app.fronthtml~"/firstCodes.twig" %}
{% endblock %}
\ No newline at end of file
diff --git a/Source/assets/html/loginregister.twig b/Source/assets/html/loginregister.twig
index 5f10607..fa9bf0f 100644
--- a/Source/assets/html/loginregister.twig
+++ b/Source/assets/html/loginregister.twig
@@ -32,7 +32,8 @@
diff --git a/Source/assets/html/nav.twig b/Source/assets/html/nav.twig
index e23a328..5cbef69 100644
--- a/Source/assets/html/nav.twig
+++ b/Source/assets/html/nav.twig
@@ -11,16 +11,16 @@
diff --git a/Source/composer.json b/Source/composer.json
index b8bfa39..5b5b797 100644
--- a/Source/composer.json
+++ b/Source/composer.json
@@ -1,6 +1,9 @@
{
"require": {
"twig/twig": "^2.0",
- "jkanetwork/dbwrapper": "^1.4"
+ "jkanetwork/dbwrapper": "^1.4",
+ "symfony/flex": "^1.1",
+ "symfony/twig-bridge": "^4.1",
+ "silex/silex": "^2.3"
}
}
diff --git a/Source/composer.lock b/Source/composer.lock
index 2ca7c56..6cc6107 100644
--- a/Source/composer.lock
+++ b/Source/composer.lock
@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "c34d26c2711c26f871ff9ca8a4401104",
+ "content-hash": "80eef0db968dff798db6ae8ac2157e65",
"packages": [
{
"name": "jkanetwork/dbwrapper",
@@ -48,6 +48,546 @@
],
"time": "2018-05-16T15:47:31+00:00"
},
+ {
+ "name": "pimple/pimple",
+ "version": "v3.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Pimple.git",
+ "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
+ "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0",
+ "psr/container": "^1.0"
+ },
+ "require-dev": {
+ "symfony/phpunit-bridge": "^3.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Pimple": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Pimple, a simple Dependency Injection Container",
+ "homepage": "http://pimple.sensiolabs.org",
+ "keywords": [
+ "container",
+ "dependency injection"
+ ],
+ "time": "2018-01-21T07:42:36+00:00"
+ },
+ {
+ "name": "psr/container",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "time": "2017-02-14T16:28:37+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10T12:19:37+00:00"
+ },
+ {
+ "name": "silex/silex",
+ "version": "v2.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Silex.git",
+ "reference": "6bc31c1b8c4ef614a7115320fd2d3b958032f131"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Silex/zipball/6bc31c1b8c4ef614a7115320fd2d3b958032f131",
+ "reference": "6bc31c1b8c4ef614a7115320fd2d3b958032f131",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1.3",
+ "pimple/pimple": "^3.0",
+ "symfony/event-dispatcher": "^4.0",
+ "symfony/http-foundation": "^4.0",
+ "symfony/http-kernel": "^4.0",
+ "symfony/routing": "^4.0"
+ },
+ "replace": {
+ "silex/api": "self.version",
+ "silex/providers": "self.version"
+ },
+ "require-dev": {
+ "doctrine/dbal": "^2.2",
+ "monolog/monolog": "^1.4.1",
+ "swiftmailer/swiftmailer": "^5",
+ "symfony/asset": "^4.0",
+ "symfony/browser-kit": "^4.0",
+ "symfony/config": "^4.0",
+ "symfony/css-selector": "^4.0",
+ "symfony/debug": "^4.0",
+ "symfony/doctrine-bridge": "^4.0",
+ "symfony/dom-crawler": "^4.0",
+ "symfony/expression-language": "^4.0",
+ "symfony/finder": "^4.0",
+ "symfony/form": "^4.0",
+ "symfony/intl": "^4.0",
+ "symfony/monolog-bridge": "^4.0",
+ "symfony/options-resolver": "^4.0",
+ "symfony/phpunit-bridge": "^3.2",
+ "symfony/process": "^4.0",
+ "symfony/security": "^4.0",
+ "symfony/serializer": "^4.0",
+ "symfony/translation": "^4.0",
+ "symfony/twig-bridge": "^4.0",
+ "symfony/validator": "^4.0",
+ "symfony/var-dumper": "^4.0",
+ "symfony/web-link": "^4.0",
+ "twig/twig": "^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Silex\\": "src/Silex"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ }
+ ],
+ "description": "The PHP micro-framework based on the Symfony Components",
+ "homepage": "http://silex.sensiolabs.org",
+ "keywords": [
+ "microframework"
+ ],
+ "abandoned": "symfony/flex",
+ "time": "2018-04-20T05:17:01+00:00"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "47ead688f1f2877f3f14219670f52e4722ee7052"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/47ead688f1f2877f3f14219670f52e4722ee7052",
+ "reference": "47ead688f1f2877f3f14219670f52e4722ee7052",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": "<3.4"
+ },
+ "require-dev": {
+ "symfony/http-kernel": "~3.4|~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-03T11:13:38+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
+ "reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<3.4"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~3.4|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/stopwatch": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-07-26T09:10:45+00:00"
+ },
+ {
+ "name": "symfony/flex",
+ "version": "v1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/flex.git",
+ "reference": "9fb60f232af0764d58002e7872acb43a74506d25"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/flex/zipball/9fb60f232af0764d58002e7872acb43a74506d25",
+ "reference": "9fb60f232af0764d58002e7872acb43a74506d25",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0",
+ "php": "^7.0"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0.2",
+ "symfony/phpunit-bridge": "^3.2.8"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ },
+ "class": "Symfony\\Flex\\Flex"
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Flex\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien.potencier@gmail.com"
+ }
+ ],
+ "description": "Composer plugin for Symfony",
+ "time": "2018-09-03T08:17:12+00:00"
+ },
+ {
+ "name": "symfony/http-foundation",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-foundation.git",
+ "reference": "3a5c91e133b220bb882b3cd773ba91bf39989345"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a5c91e133b220bb882b3cd773ba91bf39989345",
+ "reference": "3a5c91e133b220bb882b3cd773ba91bf39989345",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "symfony/polyfill-mbstring": "~1.1"
+ },
+ "require-dev": {
+ "predis/predis": "~1.0",
+ "symfony/expression-language": "~3.4|~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpFoundation Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-27T17:47:02+00:00"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-kernel.git",
+ "reference": "33de0a1ff2e1720096189e3ced682d7a4e8f5e35"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/33de0a1ff2e1720096189e3ced682d7a4e8f5e35",
+ "reference": "33de0a1ff2e1720096189e3ced682d7a4e8f5e35",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "psr/log": "~1.0",
+ "symfony/debug": "~3.4|~4.0",
+ "symfony/event-dispatcher": "~4.1",
+ "symfony/http-foundation": "^4.1.1",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/config": "<3.4",
+ "symfony/dependency-injection": "<4.1",
+ "symfony/var-dumper": "<4.1.1",
+ "twig/twig": "<1.34|<2.4,>=2"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0"
+ },
+ "require-dev": {
+ "psr/cache": "~1.0",
+ "symfony/browser-kit": "~3.4|~4.0",
+ "symfony/config": "~3.4|~4.0",
+ "symfony/console": "~3.4|~4.0",
+ "symfony/css-selector": "~3.4|~4.0",
+ "symfony/dependency-injection": "^4.1",
+ "symfony/dom-crawler": "~3.4|~4.0",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/finder": "~3.4|~4.0",
+ "symfony/process": "~3.4|~4.0",
+ "symfony/routing": "~3.4|~4.0",
+ "symfony/stopwatch": "~3.4|~4.0",
+ "symfony/templating": "~3.4|~4.0",
+ "symfony/translation": "~3.4|~4.0",
+ "symfony/var-dumper": "^4.1.1"
+ },
+ "suggest": {
+ "symfony/browser-kit": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/var-dumper": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpKernel\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpKernel Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-28T06:17:42+00:00"
+ },
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
@@ -165,6 +705,173 @@
],
"time": "2018-08-06T14:22:27+00:00"
},
+ {
+ "name": "symfony/routing",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/routing.git",
+ "reference": "a5784c2ec4168018c87b38f0e4f39d2278499f51"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/a5784c2ec4168018c87b38f0e4f39d2278499f51",
+ "reference": "a5784c2ec4168018c87b38f0e4f39d2278499f51",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3"
+ },
+ "conflict": {
+ "symfony/config": "<3.4",
+ "symfony/dependency-injection": "<3.4",
+ "symfony/yaml": "<3.4"
+ },
+ "require-dev": {
+ "doctrine/annotations": "~1.0",
+ "psr/log": "~1.0",
+ "symfony/config": "~3.4|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/http-foundation": "~3.4|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
+ },
+ "suggest": {
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/dependency-injection": "For loading routes from a service",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/http-foundation": "For using a Symfony Request object",
+ "symfony/yaml": "For using the YAML loader"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Routing\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Routing Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "router",
+ "routing",
+ "uri",
+ "url"
+ ],
+ "time": "2018-08-03T07:58:40+00:00"
+ },
+ {
+ "name": "symfony/twig-bridge",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/twig-bridge.git",
+ "reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
+ "reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "twig/twig": "^1.35|^2.4.4"
+ },
+ "conflict": {
+ "symfony/console": "<3.4",
+ "symfony/form": "<4.1.2"
+ },
+ "require-dev": {
+ "symfony/asset": "~3.4|~4.0",
+ "symfony/console": "~3.4|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/finder": "~3.4|~4.0",
+ "symfony/form": "^4.1.2",
+ "symfony/http-foundation": "~3.4|~4.0",
+ "symfony/http-kernel": "~3.4|~4.0",
+ "symfony/polyfill-intl-icu": "~1.0",
+ "symfony/routing": "~3.4|~4.0",
+ "symfony/security": "~3.4|~4.0",
+ "symfony/security-acl": "~2.8|~3.0",
+ "symfony/stopwatch": "~3.4|~4.0",
+ "symfony/templating": "~3.4|~4.0",
+ "symfony/translation": "~3.4|~4.0",
+ "symfony/var-dumper": "~3.4|~4.0",
+ "symfony/web-link": "~3.4|~4.0",
+ "symfony/workflow": "~3.4|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/asset": "For using the AssetExtension",
+ "symfony/expression-language": "For using the ExpressionExtension",
+ "symfony/finder": "",
+ "symfony/form": "For using the FormExtension",
+ "symfony/http-kernel": "For using the HttpKernelExtension",
+ "symfony/routing": "For using the RoutingExtension",
+ "symfony/security": "For using the SecurityExtension",
+ "symfony/stopwatch": "For using the StopwatchExtension",
+ "symfony/templating": "For using the TwigEngine",
+ "symfony/translation": "For using the TranslationExtension",
+ "symfony/var-dumper": "For using the DumpExtension",
+ "symfony/web-link": "For using the WebLinkExtension",
+ "symfony/yaml": "For using the YamlExtension"
+ },
+ "type": "symfony-bridge",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Bridge\\Twig\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Twig Bridge",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-14T15:48:59+00:00"
+ },
{
"name": "twig/twig",
"version": "v2.5.0",
diff --git a/Source/config/packages/dev/routing.yaml b/Source/config/packages/dev/routing.yaml
new file mode 100644
index 0000000..4116679
--- /dev/null
+++ b/Source/config/packages/dev/routing.yaml
@@ -0,0 +1,3 @@
+framework:
+ router:
+ strict_requirements: true
diff --git a/Source/config/packages/routing.yaml b/Source/config/packages/routing.yaml
new file mode 100644
index 0000000..368bc7f
--- /dev/null
+++ b/Source/config/packages/routing.yaml
@@ -0,0 +1,3 @@
+framework:
+ router:
+ strict_requirements: ~
diff --git a/Source/config/packages/test/routing.yaml b/Source/config/packages/test/routing.yaml
new file mode 100644
index 0000000..4116679
--- /dev/null
+++ b/Source/config/packages/test/routing.yaml
@@ -0,0 +1,3 @@
+framework:
+ router:
+ strict_requirements: true
diff --git a/Source/config/routes.yaml b/Source/config/routes.yaml
new file mode 100644
index 0000000..c3283aa
--- /dev/null
+++ b/Source/config/routes.yaml
@@ -0,0 +1,3 @@
+#index:
+# path: /
+# controller: App\Controller\DefaultController::index
diff --git a/Source/index.php b/Source/index.php
index 502d367..a80d27a 100644
--- a/Source/index.php
+++ b/Source/index.php
@@ -1,8 +1,10 @@
run();
diff --git a/Source/src/Config.php b/Source/src/Config.php
index 042d054..6b71dd2 100644
--- a/Source/src/Config.php
+++ b/Source/src/Config.php
@@ -16,7 +16,7 @@ class Config
*/
public static function init(){
if(!Config::initialized()) {
- $file = file_get_contents("data/project.json");
+ $file = file_get_contents(__DIR__."/../data/project.json");
Config::$config = json_decode($file, true);
Config::$in=true;
}
diff --git a/Source/src/DB.php b/Source/src/DB.php
index 16e867f..3da18e4 100644
--- a/Source/src/DB.php
+++ b/Source/src/DB.php
@@ -132,7 +132,7 @@ class DB
*/
public function loadDiff($id, $lang)
{
- $query = "SELECT Lang,Code,Version FROM Sources NATURAL JOIN Codes WHERE IDC='$id' AND Lang<>'$lang' AND Version = (SELECT MAX(Version) FROM Sources NATURAL JOIN Codes WHERE IDC='$id' AND Lang<>'$lang')";
+ $query = "SELECT Lang,Code,Version FROM Sources NATURAL JOIN Codes WHERE IDC=$id AND Lang<>'$lang' AND Version = (SELECT MAX(Version) FROM Sources NATURAL JOIN Codes WHERE IDC=$id AND Lang<>'$lang')";
$code = dbw_query($this->conn, $query);
return $code;
}
@@ -286,7 +286,8 @@ class DB
$version++;
$modification = time();
- $query = "INSERT INTO Sources (`IDC`,`Lang`,`Version`,`Modification`,`Code`,`UseExtLib`,`UseExtLibVer`,`IDU`) VALUES ('$IDC','$lang',$version,$modification,'$code','$lib','$libV','$IDU')";
+
+ $query = "INSERT INTO Sources (`IDC`,`Lang`,`Version`,`Modification`,`Code`,`UseExtLib`,`UseExtLibVer`,`IDU`) VALUES ('$IDC','$lang',$version,$modification,'$code','$lib','$libV','$IDU')";
//echo $query . ';';
dbw_query($this->conn, $query);
return $version;
@@ -324,8 +325,8 @@ class DB
$arr = $this->loadAll($IDC, $lang, $this->getLastVersion($IDC, $lang));
$codewrite = $arr["Code"];
$version = 0;
- if ($code != $codewrite) {
- $version = $this->addSource($IDC, $lang, $_code, $IDU, $extlib, $extlibver);
+ if ($_code != dbw_escape_string($this->conn,$codewrite)) {
+ $version = $this->addSource($IDC, $lang, $_code, $IDU, $extlib, $extlibver,$codewrite);
} else if ($extlib != $arr["UseExtLib"] || $extlibver != $arr["UseExtLibVer"]) {
$query = "UPDATE Sources SET `UseExtLib`='$extlib', `UseExtLibVer`='$extlibver' WHERE IDC=$IDC AND Lang='$arr[Lang]' AND Version=$arr[Version]";
diff --git a/Source/src/app.php b/Source/src/app.php
index eddb7d9..177e37c 100644
--- a/Source/src/app.php
+++ b/Source/src/app.php
@@ -3,8 +3,8 @@ if(isset($_COOKIE['cookieconsent_status'])) {
session_start(); //Start session in app, before loading vars ($_SESSION)
}
-require_once __DIR__ . '/../vendor/autoload.php';
-//require_once __DIR__ . '/dbwrapper.php';
+require_once __DIR__ .'/../vendor/autoload.php';
+
require_once __DIR__ . '/Config.php';
require 'functions.php';
require 'DB.php';
@@ -12,370 +12,97 @@ require 'dbToTable.php';
require 'users.php';
-$path = array(
- "html" => "assets/html/",
- "css" => "assets/css/",
- "js" => "assets/js/",
- "img" => "assets/img/",
-);
+$app = new Silex\Application();
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+$app['debug'] = true;
+$app->register(new Silex\Provider\TwigServiceProvider(), array(
+ 'twig.path' => __DIR__.'/../',
+));
+
+
+$app['url'] = '/';
+
+$app['front'] = $app['url'] . 'assets';
+$valores = array('js', 'img', 'css', 'fonts', 'html');
+foreach($valores as $asset){
+ $app['front'.$asset] = $app['front'].'/'.$asset;
+}
+
$string = file_get_contents(__DIR__."/../data/supported.json");
-$supported = json_decode($string, true);
-$loader = new Twig_Loader_Filesystem($path['html']);
-$twig = new Twig_Environment($loader);
-$user = array();
-$db=null;
+$app["supported"] = json_decode($string, true);
+
+$app['db']=null;
try {
- $db = new DB();
+ $app['db'] = new DB();
}catch (Exception $ex){
- sendHTTPError(503);
exit();
}
-function run(){
- global $user;
- if(isset($_SESSION['sessionID'])){
- global $db;
- if($db->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
- $user = $db->loadProfile($_SESSION['sessionID']);
- }
- }
- if (isset($_POST["search"])){
- firstPage(false,true);
- }
- else if ($_GET) {
- if ($_GET["page"]) {
- switch ($_GET["page"]) {
- case "code":
- codeViewer();
- break;
- case "index":
- firstPage();
- break;
- case "register":
- case "login":
- loginRegister($_GET['page']);
- break;
- case "logout":
- logout();
- header("Location: index.php");
- break;
- case "about":
- about();
- break;
- case "add":
- add();
- break;
- case "doc":
- doc();
- break;
- case "tos":
- tos();
- break;
- case "user":
- user();
- break;
- case "error":
- sendHTTPError($_GET['error']);
- /*case "del":
- deleteSource();*/
- break;
- default:
- sendHTTPError(404);
- }
- } else {
- sendHTTPError(404);
- }
- } else {
- //header("CodeShare");
- firstPage();
- }
-}
+$app->boot();
-function sendHTTPError($code){
- global $twig, $path,$user;
- $page = array("title" => $code."");
+/* Basics */
+$app->get('/', function (Request $request) use($app) {
- header($code."");
- switch($code){
- case 401:
- $text = "Unauthorized user";
- break;
- case 403:
- $text = "Forbidden page";
- break;
- case 404:
- $text = "Page not found";
- break;
- case 503:
- $text = "Database unavailable";
- break;
- case 500:
- $text = "Internal server error";
- break;
- default:
- $text = "Please, return to home page";
- $code = "Internal error";
- break;
- }
-
- $error = array("number" => $code."","text"=>$text);
- echo $twig->render('error.twig',array("page" => $page, "path" => $path, "user" => $user,"error" => $error));
-}
+ $query = $app['db']->loadLast();
+ $last = lastToArray($app["db"],$query,$app['supported']);
-/**
- * Index page
- *
- * @param bool $filter if filters are enabled (when ajax)
- * @param bool $globalSearch if filters are in nav-bar search box
- */
-function firstPage($filter=false,$globalSearch=false){
- global $supported,$twig,$path,$user;
- global $db;
- //var_dump($_POST);
- if(!$filter and !$globalSearch) //Common index
- if(isset($_GET["p"])) //If page (not 0)
- $query = $db->loadLast($_GET["p"]);
- else
- $query = $db->loadLast();
- else
- $query = $db->loadFilter($_POST,$globalSearch);
- $last = lastToArray($db,$query,$supported);
- $page = array(
- "title" => "CodeShare",
- "description" => "Sharing your solution with all",
- "last" => $last,
- "supported" => $supported,
- "page" => "home",
- "grouped" => groupByCategory($supported)
- );
- if(!$filter)
- echo $twig->render("firstpage.twig",array("page" => $page, "path" => $path, "user" => $user));
- else
- echo $twig->render("firstCodes.twig",array("page" => $page, "path" => $path, "user" => $user));
- $db->close();
-}
+ return $app['twig']->render($app['fronthtml'] . '/firstpage.twig' ,array(
+ 'page' => array('title' => "CodeShare",
+ "description" => "Sharing your solutions with all",
+ "last" => $last,
+ "supported" => $app["supported"],
+ "page" => "home",
+ "grouped" => groupByCategory($app["supported"]))
+ ));
+})->bind('home');
-function doc(){
- global $twig,$path,$user;
+$app->get('/doc', function (Request $request) use($app){
$page = array(
"title" => "Documentation",
"description" => "All documentation about how to upload code in CodeShare",
"page" => "doc"
);
- echo $twig->render("doc.twig",array("page" => $page, "path" => $path, "user" => $user));
-}
+ return $app['twig']->render($app['fronthtml'].'/doc.twig', array("page" => $page));
+})->bind('doc');
-function add(){
- global $twig,$path,$user,$supported;
- if(!isset($user['IDU'])){
- header("Location: ?page=login");
- }
- if(isset($_POST['name'])){
- $db=new DB();
- $extlib = isset($_POST['extlib']) ? $_POST['extlib'] : null;
- $extlibver = isset($_POST['extlibver']) ? $_POST['extlibver'] : null;
- $db->addOrModifyCodes(
- 0,
- $_POST['name'],
- $_POST['description'],
- htmlentities($_POST['input']),
- htmlentities($_POST['output']),
- $_POST['lang'],
- htmlentities($_POST['code']),
- $user['IDU'],
- $extlib,
- $extlibver);
- //die();
- $idc=$db->getLastIDC();
- header("Location: ?page=code&id=$idc&lang=$_POST[lang]&version=1");
- }
- $page=array(
- "title" => "Add your own solution",
- "description" => "Share now your snippet",
- "page" => "add",
- );
- echo $twig->render("add.twig",array("page" => $page,"path" => $path, "user" => $user, "supported" => $supported));
-
-}
-
-function codeViewer(){
- global $supported,$twig,$path,$user;
- global $db;
-
- if(isset($_POST['lang'])){
- $db->addSource($_GET['id'],$_POST['lang'],htmlentities($_POST['code']),$user["IDU"]);
- $db->close();
- header("Location: ?page=code&id=$_GET[id]&lang=$_POST[lang]&version=1");
- }else if(isset($_POST['name'])){
- $extlib = isset($_POST['extlib']) ? $_POST['extlib'] : null;
- $extlibver = isset($_POST['extlibver']) ? $_POST['extlibver'] : null;
- $version=$db->addOrModifyCodes(
- $_GET['id'],
- $_POST['name'],
- $_POST['description'],
- htmlentities($_POST['input']),
- htmlentities($_POST['output']),
- $_GET['lang'],
- htmlentities($_POST['code']),
- $user['IDU'],
- $extlib,
- $extlibver);
- //die();
- $db->close();
- if($version!=0){
- header("Location: ?page=code&id=$_GET[id]&lang=$_GET[lang]&version=$version");
- }else{
- header('Refresh:0');
- }
- }else if(isset($_POST['code'])){
- $version=$db->addSource($_GET['id'],$_GET['lang'],htmlentities($_POST['code']),$user['IDU'],$_POST['extlib'],$_POST['extlibver']);
- $db->close();
- header("Location: ?page=code&id=$_GET[id]&lang=$_GET[lang]&version=$version");
- }
-
- if (!$_GET['lang'] || !$_GET['id']) {
- sendHTTPError(404);
- }elseif($_GET['version']){
- $array = $db->loadAll($_GET['id'],$_GET['lang'],$_GET['version']);
- if($array){
- $page = array(
- "title" => "$array[Name] by $array[nick]",
- "description" => "$array[Name] by $array[nick] in ".$supported[$_GET['lang']][0],
- "otherV" => false,
- "otherI" => false,
- "existedLangs" => $db->loadLangs($_GET['id']),
- "original" => $db->loadOriginalAuthor($_GET['id']),
- );
- $code = allCodeToArray($array,$supported);
- if($array['Version']!=1){
- $page['otherV'] = true;
- }
- $diff = $db->loadDiff($_GET["id"],$_GET["lang"]);
- if (dbw_fetch_array($db->conn, $diff)) {
- $page['otherI'] = true;
- }
- dbw_query_goto($db->conn,$diff);
- $otherImplementation = otherImplementationToArray($db,$diff,$supported);
- echo $twig->render("code.twig", array(
- "page" => $page,
- "code" => $code,
- "otherImplementation" => $otherImplementation,
- "path" => $path,
- "user" => $user,
- "supported" => $supported,
- ));
- }else{
- sendHTTPError(404);
- }
- }else{
- $query = $db->loadOtherVersion($_GET['id'], $_GET['lang']);
- $other = otherVersionToArray($db,$query,$supported);
- $name = $other[0]['name'];
- $page = array(
- "title" => "Other versions of $name",
- "description" => "All differents version of $name uploaded in CodeShare",
- "last" => $other,
- "page" => ""
- );
- echo $twig->render("otherVersion.twig",array(
- "page" => $page,
- "path" => $path,
- "user" => $user
- ));
- }
-
-}
-
-function loginRegister($default){
- global $twig,$path;
-
- $bool=false;
-
- $page = array(
- "title" => ucfirst($default),
- "description" => "Start now in CodeShare",
- "page" => $default,
- "state" => 0, //0=no logged, 1 login fail, 2 register fail, 3 all correct (render home)
- );
-
- if(array_key_exists('email',$_POST) or array_key_exists('emailre',$_POST)){
- if($_POST["email"]){
- $bool=checklogin($_POST['email'],$_POST['pwd']);
- if(!$bool){
- $page['state']=1;
- }
- }else{
- $bool=register($_POST["emailre"],$_POST["pwdre"],$_POST["name"]);
- if(!$bool){
- $page['state']=2;
- }
- }
- }
-
- if($bool) {
- header("Location: index.php");
- }else
- echo $twig->render("loginregister.twig", array("page" => $page, "path" => $path ));
-}
-
-function about(){
- global $twig, $path, $user;
+$app->get('/about', function (Request $request) use($app){
$page = array(
"title" => "About CodeShare",
"description" => "Developed by JKA Network's Team",
"page" => "about",
);
- echo $twig->render("about.twig",array("page" => $page, "path" => $path,"user" => $user));
-}
+ return $app['twig']->render($app['fronthtml'].'/about.twig', array("page" => $page));
+})->bind('about');
-function tos(){
- global $twig, $path, $user;
+/* Codes */
+$app->get('/code/{idc}/{lang}/{version}', function (Request $request, $idc, $lang, $version) use($app){
+
+ $array = $app['db']->loadAll($idc,$lang,$version);
$page = array(
- "title" => "Terms of service",
- "description" => "Terms of services and privacy policies"
+ "page" => 'code',
+ "title" => "$array[Name] by $array[nick]",
+ "description" => "$array[Name] by $array[nick] in ".$app['supported'][$lang][0],
+ "otherV" => false,
+ "otherI" => false,
+ "existedLangs" => $app['db']->loadLangs($idc),
+ "original" => $app['db']->loadOriginalAuthor($idc),
);
- echo $twig->render("TOS.twig",array("page" => $page, "path" => $path, "user" => $user));
-}
-
-function user(){
- global $twig,$path,$user;
-
- if($user['nick']) {
- $status=0;
- if(array_key_exists("passact",$_POST)){
- $passact = $_POST["passact"];
- $newpass = $_POST["newpass"];
- //echo "EEEEEOOO";
- global $db;
- if($db->checkPass($user['email'],$passact)){
- $status=1;
- $db->updatePass($user['IDU'],$newpass);
- }else
- $status=2;
- $db->close();
- }
- $page = array(
- "title" => "$user[nick]",
- "description" => "NOT RELEVANT",
- "status" => $status
- );
- echo $twig->render("user.twig",array("page"=>$page,"path"=>$path, "user"=>$user));
- }else{
- sendHTTPError(403);
+ $code = allCodeToArray($array,$app['supported']);
+ if($array['Version']!=1)
+ $page['otherV'] = true;
+ $diff = $app['db']->loadDiff($idc,$lang);
+ if(dbw_fetch_array($app['db']->conn,$diff)){
+ $page['otherI'] = true;
}
-}
-
-/*function deleteSource(){
- global $user;
- if(array_key_exists('ROLE',$user)){
- if($user['ROLE']==3){
- $db = new DB();
- $db->deleteSource($_GET['id'],$_GET['lang'],$_GET['version']);
- $db->close();
- header('Location: index.php');
- }else
- sendHTTPError(403);
- }else{
- sendHTTPError(403);
- }
-}*/
+ dbw_query_goto($app['db']->conn,$diff);
+ $otherImplementation = otherImplementationToArray($app['db'],$diff,$app['supported']);
+ return $app['twig']->render($app['fronthtml'].'/code.twig', array(
+ "page" => $page,
+ "code" => $code,
+ "otherImplementation" => $otherImplementation,
+ "supported" => $app['supported'],
+ ));
+})->bind('code');
\ No newline at end of file
diff --git a/Source/src/appOld.php b/Source/src/appOld.php
new file mode 100644
index 0000000..7d1ffc4
--- /dev/null
+++ b/Source/src/appOld.php
@@ -0,0 +1,382 @@
+ "assets/html/",
+ "css" => "assets/css/",
+ "js" => "assets/js/",
+ "img" => "assets/img/",
+);
+$string = file_get_contents(__DIR__."/../data/supported.json");
+$supported = json_decode($string, true);
+$loader = new Twig_Loader_Filesystem($path['html']);
+$twig = new Twig_Environment($loader);
+$user = array();
+$db=null;
+try {
+ $db = new DB();
+}catch (Exception $ex){
+ sendHTTPError(503);
+ exit();
+}
+
+function run(){
+ global $user;
+ if(isset($_SESSION['sessionID'])){
+ global $db;
+ if($db->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
+ $user = $db->loadProfile($_SESSION['sessionID']);
+ }
+ }
+ if (isset($_POST["search"])){
+ firstPage(false,true);
+ }
+ else if ($_GET) {
+ if ($_GET["page"]) {
+ switch ($_GET["page"]) {
+ case "code":
+ codeViewer();
+ break;
+ case "index":
+ firstPage();
+ break;
+ case "register":
+ case "login":
+ loginRegister($_GET['page']);
+ break;
+ case "logout":
+ logout();
+ header("Location: index.php");
+ break;
+ case "about":
+ about();
+ break;
+ case "add":
+ add();
+ break;
+ case "doc":
+ doc();
+ break;
+ case "tos":
+ tos();
+ break;
+ case "user":
+ user();
+ break;
+ case "error":
+ sendHTTPError($_GET['error']);
+ /*case "del":
+ deleteSource();*/
+ break;
+ default:
+ sendHTTPError(404);
+ }
+ } else {
+ sendHTTPError(404);
+ }
+ } else {
+ //header("CodeShare");
+ firstPage();
+ }
+}
+
+function sendHTTPError($code){
+ global $twig, $path,$user;
+ $page = array("title" => $code."");
+
+ header($code."");
+ switch($code){
+ case 401:
+ $text = "Unauthorized user";
+ break;
+ case 403:
+ $text = "Forbidden page";
+ break;
+ case 404:
+ $text = "Page not found";
+ break;
+ case 503:
+ $text = "Database unavailable";
+ break;
+ case 500:
+ $text = "Internal server error";
+ break;
+ default:
+ $text = "Please, return to home page";
+ $code = "Internal error";
+ break;
+ }
+
+ $error = array("number" => $code."","text"=>$text);
+ echo $twig->render('error.twig',array("page" => $page, "path" => $path, "user" => $user,"error" => $error));
+}
+
+/**
+ * Index page
+ *
+ * @param bool $filter if filters are enabled (when ajax)
+ * @param bool $globalSearch if filters are in nav-bar search box
+ */
+function firstPage($filter=false,$globalSearch=false){
+ global $supported,$twig,$path,$user;
+ global $db;
+ //var_dump($_POST);
+ if(!$filter and !$globalSearch) //Common index
+ if(isset($_GET["p"])) //If page (not 0)
+ $query = $db->loadLast($_GET["p"]);
+ else
+ $query = $db->loadLast();
+ else
+ $query = $db->loadFilter($_POST,$globalSearch);
+ $last = lastToArray($db,$query,$supported);
+ $page = array(
+ "title" => "CodeShare",
+ "description" => "Sharing your solution with all",
+ "last" => $last,
+ "supported" => $supported,
+ "page" => "home",
+ "grouped" => groupByCategory($supported)
+ );
+ if(!$filter)
+ echo $twig->render("firstpage.twig",array("page" => $page, "path" => $path, "user" => $user));
+ else
+ echo $twig->render("firstCodes.twig",array("page" => $page, "path" => $path, "user" => $user));
+ $db->close();
+}
+
+function doc(){
+ global $twig,$path,$user;
+ $page = array(
+ "title" => "Documentation",
+ "description" => "All documentation about how to upload code in CodeShare",
+ "page" => "doc"
+ );
+ echo $twig->render("doc.twig",array("page" => $page, "path" => $path, "user" => $user));
+}
+
+function add(){
+ global $twig,$path,$user,$supported;
+ if(!isset($user['IDU'])){
+ header("Location: ?page=login");
+ }
+ if(isset($_POST['name'])){
+ $db=new DB();
+ $extlib = isset($_POST['extlib']) ? $_POST['extlib'] : null;
+ $extlibver = isset($_POST['extlibver']) ? $_POST['extlibver'] : null;
+ $db->addOrModifyCodes(
+ 0,
+ $_POST['name'],
+ $_POST['description'],
+ htmlentities($_POST['input']),
+ htmlentities($_POST['output']),
+ $_POST['lang'],
+ htmlentities($_POST['code']),
+ $user['IDU'],
+ $extlib,
+ $extlibver);
+ //die();
+ $idc=$db->getLastIDC();
+ header("Location: ?page=code&id=$idc&lang=$_POST[lang]&version=1");
+ }
+ $page=array(
+ "title" => "Add your own solution",
+ "description" => "Share now your snippet",
+ "page" => "add",
+ );
+ echo $twig->render("add.twig",array("page" => $page,"path" => $path, "user" => $user, "supported" => $supported));
+
+}
+
+function codeViewer(){
+ global $supported,$twig,$path,$user;
+ global $db;
+
+ if(isset($_POST['lang'])){
+ $extlib = isset($_POST['extlib']) ? $_POST['extlib'] : null;
+ $extlibver = isset($_POST['extlibver']) ? $_POST['extlibver'] : null;
+ $db->addSource($_GET['id'],$_POST['lang'],htmlentities($_POST['code']),$user["IDU"],$extlib,$extlibver);
+ $db->close();
+ header("Location: ?page=code&id=$_GET[id]&lang=$_POST[lang]&version=1");
+ }else if(isset($_POST['name'])){
+ $extlib = isset($_POST['extlib']) ? $_POST['extlib'] : null;
+ $extlibver = isset($_POST['extlibver']) ? $_POST['extlibver'] : null;
+ $version=$db->addOrModifyCodes(
+ $_GET['id'],
+ $_POST['name'],
+ $_POST['description'],
+ htmlentities($_POST['input']),
+ htmlentities($_POST['output']),
+ $_GET['lang'],
+ htmlentities($_POST['code']),
+ $user['IDU'],
+ $extlib,
+ $extlibver);
+ //die();
+ $db->close();
+ if($version!=0){
+ header("Location: ?page=code&id=$_GET[id]&lang=$_GET[lang]&version=$version");
+ }else{
+ header('Refresh:0');
+ }
+ }else if(isset($_POST['code'])){
+ $version=$db->addSource($_GET['id'],$_GET['lang'],htmlentities($_POST['code']),$user['IDU'],$_POST['extlib'],$_POST['extlibver']);
+ $db->close();
+ header("Location: ?page=code&id=$_GET[id]&lang=$_GET[lang]&version=$version");
+ }
+
+ if (!$_GET['lang'] || !$_GET['id']) {
+ sendHTTPError(404);
+ }elseif($_GET['version']){
+ $array = $db->loadAll($_GET['id'],$_GET['lang'],$_GET['version']);
+ if($array){
+ $page = array(
+ "title" => "$array[Name] by $array[nick]",
+ "description" => "$array[Name] by $array[nick] in ".$supported[$_GET['lang']][0],
+ "otherV" => false,
+ "otherI" => false,
+ "existedLangs" => $db->loadLangs($_GET['id']),
+ "original" => $db->loadOriginalAuthor($_GET['id']),
+ );
+ $code = allCodeToArray($array,$supported);
+ if($array['Version']!=1){
+ $page['otherV'] = true;
+ }
+ $diff = $db->loadDiff($_GET["id"],$_GET["lang"]);
+ if (dbw_fetch_array($db->conn, $diff)) {
+ $page['otherI'] = true;
+ }
+ dbw_query_goto($db->conn,$diff);
+ $otherImplementation = otherImplementationToArray($db,$diff,$supported);
+ echo $twig->render("code.twig", array(
+ "page" => $page,
+ "code" => $code,
+ "otherImplementation" => $otherImplementation,
+ "path" => $path,
+ "user" => $user,
+ "supported" => $supported,
+ ));
+ }else{
+ sendHTTPError(404);
+ }
+ }else{
+ $query = $db->loadOtherVersion($_GET['id'], $_GET['lang']);
+ $other = otherVersionToArray($db,$query,$supported);
+ $name = $other[0]['name'];
+ $page = array(
+ "title" => "Other versions of $name",
+ "description" => "All differents version of $name uploaded in CodeShare",
+ "last" => $other,
+ "page" => ""
+ );
+ echo $twig->render("otherVersion.twig",array(
+ "page" => $page,
+ "path" => $path,
+ "user" => $user
+ ));
+ }
+
+}
+
+function loginRegister($default){
+ global $twig,$path;
+
+ $bool=false;
+
+ $page = array(
+ "title" => ucfirst($default),
+ "description" => "Start now in CodeShare",
+ "page" => $default,
+ "state" => 0, //0=no logged, 1 login fail, 2 register fail, 3 all correct (render home)
+ );
+
+ if(array_key_exists('email',$_POST) or array_key_exists('emailre',$_POST)){
+ if($_POST["email"]){
+ $bool=checklogin($_POST['email'],$_POST['pwd']);
+ if(!$bool){
+ $page['state']=1;
+ }
+ }else{
+ $bool=register($_POST["emailre"],$_POST["pwdre"],$_POST["name"]);
+ if(!$bool){
+ $page['state']=2;
+ }
+ }
+ }
+
+ if($bool) {
+ header("Location: index.php");
+ }else
+ echo $twig->render("loginregister.twig", array("page" => $page, "path" => $path ));
+}
+
+function about(){
+ global $twig, $path, $user;
+ $page = array(
+ "title" => "About CodeShare",
+ "description" => "Developed by JKA Network's Team",
+ "page" => "about",
+ );
+ echo $twig->render("about.twig",array("page" => $page, "path" => $path,"user" => $user));
+}
+
+function tos(){
+ global $twig, $path, $user;
+ $page = array(
+ "title" => "Terms of service",
+ "description" => "Terms of services and privacy policies"
+ );
+ echo $twig->render("TOS.twig",array("page" => $page, "path" => $path, "user" => $user));
+}
+
+function user(){
+ global $twig,$path,$user;
+
+ if($user['nick']) {
+ $status=0;
+ if(array_key_exists("passact",$_POST)){
+ $passact = $_POST["passact"];
+ $newpass = $_POST["newpass"];
+ global $db;
+ if($db->checkPass($user['email'],$passact)){
+ $status=1;
+ $db->updatePass($user['IDU'],$newpass);
+ }else
+ $status=2;
+ $db->close();
+ }
+ $page = array(
+ "title" => "$user[nick]",
+ "description" => "NOT RELEVANT",
+ "status" => $status
+ );
+ echo $twig->render("user.twig",array("page"=>$page,"path"=>$path, "user"=>$user));
+ }else{
+ sendHTTPError(403);
+ }
+}
+
+/*function deleteSource(){
+ global $user;
+ if(array_key_exists('ROLE',$user)){
+ if($user['ROLE']==3){
+ $db = new DB();
+ $db->deleteSource($_GET['id'],$_GET['lang'],$_GET['version']);
+ $db->close();
+ header('Location: index.php');
+ }else
+ sendHTTPError(403);
+ }else{
+ sendHTTPError(403);
+ }
+}*/
diff --git a/Source/src/dbToTable.php b/Source/src/dbToTable.php
index 9f8bf51..8b7aa7d 100644
--- a/Source/src/dbToTable.php
+++ b/Source/src/dbToTable.php
@@ -11,7 +11,7 @@
* Methods to get an array to send to twig
*/
-function lastToArray($db,&$query,&$supported){
+function lastToArray($db,&$query,$supported){
$last = array();
while($var = dbw_fetch_array($db->conn,$query)){
$array = array
@@ -29,7 +29,7 @@ function lastToArray($db,&$query,&$supported){
return $last;
}
-function allCodeToArray(&$query,&$supported){
+function allCodeToArray(&$query,$supported){
$code = array(
"idc" => $query['IDC'],
"lang" => $query['Lang'],
@@ -50,7 +50,7 @@ function allCodeToArray(&$query,&$supported){
}
-function otherImplementationToArray($db,&$query,&$supported){
+function otherImplementationToArray($db,&$query,$supported){
$other = array();
while($var = dbw_fetch_array($db->conn,$query)){
$array = array
diff --git a/Source/src/functions.php b/Source/src/functions.php
index 4a6d4cb..af032f1 100644
--- a/Source/src/functions.php
+++ b/Source/src/functions.php
@@ -54,7 +54,7 @@ function ksonParse($path){
/**
* Group by $supported
*/
-function groupByCategory(&$supported){
+function groupByCategory($supported){
$grouped = Array();
foreach($supported as $key => $val){
if(!array_key_exists($val[1],$grouped)){
diff --git a/Source/src/users.php b/Source/src/users.php
index 1768992..e8e0e1d 100644
--- a/Source/src/users.php
+++ b/Source/src/users.php
@@ -55,4 +55,14 @@ function register($email,$pass,$nick){
*/
function logout(){
session_destroy(); //Logout
+}
+
+function getUser($app){
+ $user=null;
+ if(isset($_SESSION['sessionID'])){
+ if($app['db']->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
+ $user = $db->loadProfile($_SESSION['sessionID']);
+ }
+ }
+ return $user;
}
\ No newline at end of file
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..c83ad60
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,8 @@
+{
+ "require": {
+ "silex/silex": "~1.3",
+ "twig/twig": "~1.23",
+ "symfony/twig-bridge": "^4.1",
+ "jkanetwork/dbwrapper": "^1.5"
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..92ecc8c
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,990 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "2f1e425874f2052e4cdae6c9b1fe7800",
+ "packages": [
+ {
+ "name": "ircmaxell/password-compat",
+ "version": "v1.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ircmaxell/password_compat.git",
+ "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
+ "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
+ "shasum": ""
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/password.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Anthony Ferrara",
+ "email": "ircmaxell@php.net",
+ "homepage": "http://blog.ircmaxell.com"
+ }
+ ],
+ "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
+ "homepage": "https://github.com/ircmaxell/password_compat",
+ "keywords": [
+ "hashing",
+ "password"
+ ],
+ "time": "2014-11-20T16:49:30+00:00"
+ },
+ {
+ "name": "jkanetwork/dbwrapper",
+ "version": "1.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://gitlab.com/CodeSolutionsProject/DBWrapper.git",
+ "reference": "1bc58622f2f520286f5de7058fc5b9a97921003b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://gitlab.com/api/v4/projects/CodeSolutionsProject%2FDBWrapper/repository/archive.zip?sha=1bc58622f2f520286f5de7058fc5b9a97921003b",
+ "reference": "1bc58622f2f520286f5de7058fc5b9a97921003b",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/dbwrapper.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "authors": [
+ {
+ "name": "Kevin Puertas Ruiz",
+ "email": "kevin01010@gmail.com"
+ }
+ ],
+ "description": "MySQL, PgSQL and SQLite wrapper",
+ "keywords": [
+ "mysql",
+ "pgsql",
+ "sqlite",
+ "wrapper"
+ ],
+ "time": "2018-05-16T15:47:31+00:00"
+ },
+ {
+ "name": "pimple/pimple",
+ "version": "v1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Pimple.git",
+ "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
+ "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Pimple": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
+ "homepage": "http://pimple.sensiolabs.org",
+ "keywords": [
+ "container",
+ "dependency injection"
+ ],
+ "time": "2013-11-22T08:30:29+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10T12:19:37+00:00"
+ },
+ {
+ "name": "silex/silex",
+ "version": "v1.3.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/silexphp/Silex.git",
+ "reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/silexphp/Silex/zipball/ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136",
+ "reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9",
+ "pimple/pimple": "~1.0",
+ "symfony/event-dispatcher": "~2.3|3.0.*",
+ "symfony/http-foundation": "~2.3|3.0.*",
+ "symfony/http-kernel": "~2.3|3.0.*",
+ "symfony/routing": "~2.3|3.0.*"
+ },
+ "require-dev": {
+ "doctrine/dbal": "~2.2",
+ "monolog/monolog": "^1.4.1",
+ "swiftmailer/swiftmailer": "~5",
+ "symfony/browser-kit": "~2.3|3.0.*",
+ "symfony/config": "~2.3|3.0.*",
+ "symfony/css-selector": "~2.3|3.0.*",
+ "symfony/debug": "~2.3|3.0.*",
+ "symfony/dom-crawler": "~2.3|3.0.*",
+ "symfony/finder": "~2.3|3.0.*",
+ "symfony/form": "~2.3|3.0.*",
+ "symfony/intl": "~2.3|3.0.*",
+ "symfony/monolog-bridge": "~2.3|3.0.*",
+ "symfony/options-resolver": "~2.3|3.0.*",
+ "symfony/phpunit-bridge": "~2.7",
+ "symfony/process": "~2.3|3.0.*",
+ "symfony/security": "~2.3|3.0.*",
+ "symfony/serializer": "~2.3|3.0.*",
+ "symfony/translation": "~2.3|3.0.*",
+ "symfony/twig-bridge": "~2.3|3.0.*",
+ "symfony/validator": "~2.3|3.0.*",
+ "twig/twig": "~1.28|~2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Silex\\": "src/Silex"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ }
+ ],
+ "description": "The PHP micro-framework based on the Symfony Components",
+ "homepage": "http://silex.sensiolabs.org",
+ "keywords": [
+ "microframework"
+ ],
+ "abandoned": "symfony/flex",
+ "time": "2017-04-30T16:26:54+00:00"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v2.8.45",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "cbb8a5f212148964efbc414838c527229f9951b7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/cbb8a5f212148964efbc414838c527229f9951b7",
+ "reference": "cbb8a5f212148964efbc414838c527229f9951b7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/class-loader": "~2.2|~3.0.0",
+ "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-03T09:45:57+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v2.8.45",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "84ae343f39947aa084426ed1138bb96bf94d1f12"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/84ae343f39947aa084426ed1138bb96bf94d1f12",
+ "reference": "84ae343f39947aa084426ed1138bb96bf94d1f12",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "^2.0.5|~3.0.0",
+ "symfony/dependency-injection": "~2.6|~3.0.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
+ "symfony/stopwatch": "~2.3|~3.0.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-07-26T09:03:18+00:00"
+ },
+ {
+ "name": "symfony/http-foundation",
+ "version": "v2.8.45",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-foundation.git",
+ "reference": "dc02e684171d0696edb6d4266e9d93af5e3f44d3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/dc02e684171d0696edb6d4266e9d93af5e3f44d3",
+ "reference": "dc02e684171d0696edb6d4266e9d93af5e3f44d3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9",
+ "symfony/polyfill-mbstring": "~1.1",
+ "symfony/polyfill-php54": "~1.0",
+ "symfony/polyfill-php55": "~1.0"
+ },
+ "require-dev": {
+ "symfony/expression-language": "~2.4|~3.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpFoundation\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpFoundation Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-27T15:52:41+00:00"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "v2.8.45",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/http-kernel.git",
+ "reference": "5424d38f10dc62752e655740224681a478d9f5bb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5424d38f10dc62752e655740224681a478d9f5bb",
+ "reference": "5424d38f10dc62752e655740224681a478d9f5bb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9",
+ "psr/log": "~1.0",
+ "symfony/debug": "^2.6.2",
+ "symfony/event-dispatcher": "^2.6.7|~3.0.0",
+ "symfony/http-foundation": "~2.7.36|~2.8.29|~3.1.6",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/config": "<2.7",
+ "twig/twig": "<1.34|<2.4,>=2"
+ },
+ "require-dev": {
+ "symfony/browser-kit": "~2.3|~3.0.0",
+ "symfony/class-loader": "~2.1|~3.0.0",
+ "symfony/config": "~2.8",
+ "symfony/console": "~2.3|~3.0.0",
+ "symfony/css-selector": "^2.0.5|~3.0.0",
+ "symfony/dependency-injection": "~2.8|~3.0.0",
+ "symfony/dom-crawler": "^2.0.5|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/finder": "^2.0.5|~3.0.0",
+ "symfony/process": "^2.0.5|~3.0.0",
+ "symfony/routing": "~2.8|~3.0.0",
+ "symfony/stopwatch": "~2.3|~3.0.0",
+ "symfony/templating": "~2.2|~3.0.0",
+ "symfony/translation": "^2.0.5|~3.0.0",
+ "symfony/var-dumper": "~2.6|~3.0.0"
+ },
+ "suggest": {
+ "symfony/browser-kit": "",
+ "symfony/class-loader": "",
+ "symfony/config": "",
+ "symfony/console": "",
+ "symfony/dependency-injection": "",
+ "symfony/finder": "",
+ "symfony/var-dumper": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\HttpKernel\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpKernel Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-27T17:33:38+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
+ "reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ },
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "time": "2018-08-06T14:22:27+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
+ "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2018-08-06T14:22:27+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php54",
+ "version": "v1.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php54.git",
+ "reference": "412977e090c6a8472dc39d50d1beb7d59495a965"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/412977e090c6a8472dc39d50d1beb7d59495a965",
+ "reference": "412977e090c6a8472dc39d50d1beb7d59495a965",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php54\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2018-08-06T14:22:27+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php55",
+ "version": "v1.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php55.git",
+ "reference": "578b8528da843de0fc65ec395900fa3181f2ead7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/578b8528da843de0fc65ec395900fa3181f2ead7",
+ "reference": "578b8528da843de0fc65ec395900fa3181f2ead7",
+ "shasum": ""
+ },
+ "require": {
+ "ircmaxell/password-compat": "~1.0",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php55\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2018-08-06T14:22:27+00:00"
+ },
+ {
+ "name": "symfony/routing",
+ "version": "v2.8.45",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/routing.git",
+ "reference": "e26f791e8669603e9dc0a601e75a50f914eaa144"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/e26f791e8669603e9dc0a601e75a50f914eaa144",
+ "reference": "e26f791e8669603e9dc0a601e75a50f914eaa144",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "conflict": {
+ "symfony/config": "<2.7"
+ },
+ "require-dev": {
+ "doctrine/annotations": "~1.0",
+ "psr/log": "~1.0",
+ "symfony/config": "~2.7|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/http-foundation": "~2.3|~3.0.0",
+ "symfony/yaml": "^2.0.5|~3.0.0"
+ },
+ "suggest": {
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/dependency-injection": "For loading routes from a service",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/http-foundation": "For using a Symfony Request object",
+ "symfony/yaml": "For using the YAML loader"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Routing\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Routing Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "router",
+ "routing",
+ "uri",
+ "url"
+ ],
+ "time": "2018-07-26T11:13:39+00:00"
+ },
+ {
+ "name": "symfony/twig-bridge",
+ "version": "v4.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/twig-bridge.git",
+ "reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
+ "reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1.3",
+ "twig/twig": "^1.35|^2.4.4"
+ },
+ "conflict": {
+ "symfony/console": "<3.4",
+ "symfony/form": "<4.1.2"
+ },
+ "require-dev": {
+ "symfony/asset": "~3.4|~4.0",
+ "symfony/console": "~3.4|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/expression-language": "~3.4|~4.0",
+ "symfony/finder": "~3.4|~4.0",
+ "symfony/form": "^4.1.2",
+ "symfony/http-foundation": "~3.4|~4.0",
+ "symfony/http-kernel": "~3.4|~4.0",
+ "symfony/polyfill-intl-icu": "~1.0",
+ "symfony/routing": "~3.4|~4.0",
+ "symfony/security": "~3.4|~4.0",
+ "symfony/security-acl": "~2.8|~3.0",
+ "symfony/stopwatch": "~3.4|~4.0",
+ "symfony/templating": "~3.4|~4.0",
+ "symfony/translation": "~3.4|~4.0",
+ "symfony/var-dumper": "~3.4|~4.0",
+ "symfony/web-link": "~3.4|~4.0",
+ "symfony/workflow": "~3.4|~4.0",
+ "symfony/yaml": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/asset": "For using the AssetExtension",
+ "symfony/expression-language": "For using the ExpressionExtension",
+ "symfony/finder": "",
+ "symfony/form": "For using the FormExtension",
+ "symfony/http-kernel": "For using the HttpKernelExtension",
+ "symfony/routing": "For using the RoutingExtension",
+ "symfony/security": "For using the SecurityExtension",
+ "symfony/stopwatch": "For using the StopwatchExtension",
+ "symfony/templating": "For using the TwigEngine",
+ "symfony/translation": "For using the TranslationExtension",
+ "symfony/var-dumper": "For using the DumpExtension",
+ "symfony/web-link": "For using the WebLinkExtension",
+ "symfony/yaml": "For using the YamlExtension"
+ },
+ "type": "symfony-bridge",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Bridge\\Twig\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Twig Bridge",
+ "homepage": "https://symfony.com",
+ "time": "2018-08-14T15:48:59+00:00"
+ },
+ {
+ "name": "twig/twig",
+ "version": "v1.35.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/twigphp/Twig.git",
+ "reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
+ "reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/polyfill-ctype": "^1.8"
+ },
+ "require-dev": {
+ "psr/container": "^1.0",
+ "symfony/debug": "^2.7",
+ "symfony/phpunit-bridge": "^3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.35-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Twig_": "lib/"
+ },
+ "psr-4": {
+ "Twig\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
+ },
+ {
+ "name": "Armin Ronacher",
+ "email": "armin.ronacher@active-4.com",
+ "role": "Project Founder"
+ },
+ {
+ "name": "Twig Team",
+ "homepage": "https://twig.symfony.com/contributors",
+ "role": "Contributors"
+ }
+ ],
+ "description": "Twig, the flexible, fast, and secure template language for PHP",
+ "homepage": "https://twig.symfony.com",
+ "keywords": [
+ "templating"
+ ],
+ "time": "2018-07-13T07:12:17+00:00"
+ }
+ ],
+ "packages-dev": [],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": []
+}
|