mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-13 16:41:32 +01:00
3
.env
Normal file
3
.env
Normal file
@@ -0,0 +1,3 @@
|
||||
# This file is a "template" of which env vars need to be defined for your application
|
||||
# Copy this file to .env file for development, create environment variables when deploying to production
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
||||
3
.env.dist
Normal file
3
.env.dist
Normal file
@@ -0,0 +1,3 @@
|
||||
# This file is a "template" of which env vars need to be defined for your application
|
||||
# Copy this file to .env file for development, create environment variables when deploying to production
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
||||
3
Source/.env
Normal file
3
Source/.env
Normal file
@@ -0,0 +1,3 @@
|
||||
# This file is a "template" of which env vars need to be defined for your application
|
||||
# Copy this file to .env file for development, create environment variables when deploying to production
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
||||
@@ -1,56 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ page.title }}</title>
|
||||
<link type="text/css" rel="stylesheet" href="{{ path.css }}/bootstrap-paper.css"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
|
||||
<link type="text/css" rel="stylesheet" href="{{ path.css }}/main.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ path.css }}/codeStyles/vs.css"/>
|
||||
{#<link rel="shortcut icon" href="{{ path.img }}favicon.ico" type="image/x-icon"/>#}
|
||||
{% block css %}{% endblock %}
|
||||
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="description" content="{{ page.description }}"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<script src="{{ path.js }}/highlight.pack.js"></script>
|
||||
<script src="{{ path.js }}/jquery-3.2.1.min.js"></script>
|
||||
<script src="{{ path.js }}/bootstrap.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<script src="{{ path.js }}/functions.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% include 'nav.twig' %}
|
||||
{% include 'header.twig' %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
{% include "footer.twig" %}
|
||||
|
||||
{% block js %}
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
{% endblock %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
|
||||
<script>
|
||||
window.addEventListener("load", function(){
|
||||
window.cookieconsent.initialise({
|
||||
"palette": {
|
||||
"popup": {
|
||||
"background": "#2196f3",
|
||||
"text": "#b2dbfb"
|
||||
},
|
||||
"button": {
|
||||
"background": "transparent",
|
||||
"text": "#b2dbfb",
|
||||
"border": "#b2dbfb"
|
||||
}
|
||||
},
|
||||
"content": {
|
||||
"href": "?page=tos#cookiePolicy",
|
||||
"message": "This website uses cookies to ensure you get the best experience on on our website. If you don't accept any cookie won't be install on your browser.",
|
||||
"dismiss": "I accept it"
|
||||
}
|
||||
})});
|
||||
</script>
|
||||
</body>
|
||||
@@ -8,7 +8,7 @@
|
||||
<td><strong>Author:</strong> {{ code.nick }} <strong> Version: </strong>{{ code.version }} <strong>
|
||||
Lang: </strong>{{ code.lLang }}</td>
|
||||
</tr>
|
||||
{% if code.extlib is defined %}
|
||||
{% if code.extlib is defined and code.extlib != "" %}
|
||||
<tr>
|
||||
<td>
|
||||
<strong>External library:</strong> {{ code.extlib }}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"twig/twig": "^2.0",
|
||||
"jkanetwork/dbwrapper": "^1.4",
|
||||
"symfony/flex": "^1.1",
|
||||
"symfony/twig-bridge": "^4.1",
|
||||
"silex/silex": "^2.3"
|
||||
"symfony/twig-bridge": "3.0.4",
|
||||
"silex/silex": "~1.3",
|
||||
"doctrine/dbal": "^2.5"
|
||||
}
|
||||
}
|
||||
|
||||
576
Source/composer.lock
generated
576
Source/composer.lock
generated
@@ -1,11 +1,239 @@
|
||||
{
|
||||
"_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": "80eef0db968dff798db6ae8ac2157e65",
|
||||
"content-hash": "1d57e016803e2095db2110462e070da3",
|
||||
"packages": [
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "v1.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "d768d58baee9a4862ca783840eca1b9add7a7f57"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57",
|
||||
"reference": "d768d58baee9a4862ca783840eca1b9add7a7f57",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~7.1"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/common": ">2.2,<2.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"alcaeus/mongo-php-adapter": "^1.1",
|
||||
"doctrine/coding-standard": "^4.0",
|
||||
"mongodb/mongodb": "^1.1",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"predis/predis": "~1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.8.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Caching library offering an object-oriented API for many cache backends",
|
||||
"homepage": "https://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching"
|
||||
],
|
||||
"time": "2018-08-21T18:01:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
"version": "v2.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/dbal.git",
|
||||
"reference": "5140a64c08b4b607b9bedaae0cedd26f04a0e621"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/5140a64c08b4b607b9bedaae0cedd26f04a0e621",
|
||||
"reference": "5140a64c08b4b607b9bedaae0cedd26f04a0e621",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/cache": "^1.0",
|
||||
"doctrine/event-manager": "^1.0",
|
||||
"ext-pdo": "*",
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^4.0",
|
||||
"jetbrains/phpstorm-stubs": "^2018.1.2",
|
||||
"phpstan/phpstan": "^0.10.1",
|
||||
"phpunit/phpunit": "^7.1.2",
|
||||
"phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5",
|
||||
"symfony/console": "^2.0.5|^3.0|^4.0",
|
||||
"symfony/phpunit-bridge": "^3.4.5|^4.0.5"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||
},
|
||||
"bin": [
|
||||
"bin/doctrine-dbal"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.8.x-dev",
|
||||
"dev-develop": "3.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\DBAL\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Database Abstraction Layer",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"database",
|
||||
"dbal",
|
||||
"persistence",
|
||||
"queryobject"
|
||||
],
|
||||
"time": "2018-07-13T03:16:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/event-manager",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/event-manager.git",
|
||||
"reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/a520bc093a0170feeb6b14e9d83f3a14452e64b3",
|
||||
"reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/common": "<2.9@dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^4.0",
|
||||
"phpunit/phpunit": "^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\": "lib/Doctrine/Common"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Marco Pivetta",
|
||||
"email": "ocramius@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Doctrine Event Manager component",
|
||||
"homepage": "https://www.doctrine-project.org/projects/event-manager.html",
|
||||
"keywords": [
|
||||
"event",
|
||||
"eventdispatcher",
|
||||
"eventmanager"
|
||||
],
|
||||
"time": "2018-06-11T11:59:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jkanetwork/dbwrapper",
|
||||
"version": "1.5.1",
|
||||
@@ -50,34 +278,30 @@
|
||||
},
|
||||
{
|
||||
"name": "pimple/pimple",
|
||||
"version": "v3.2.3",
|
||||
"version": "v1.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/silexphp/Pimple.git",
|
||||
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
|
||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
|
||||
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
|
||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"psr/container": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^3.2"
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2.x-dev"
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Pimple": "src/"
|
||||
"Pimple": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@@ -90,62 +314,13 @@
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Pimple, a simple Dependency Injection Container",
|
||||
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
||||
"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"
|
||||
"time": "2013-11-22T08:30:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
@@ -196,62 +371,53 @@
|
||||
},
|
||||
{
|
||||
"name": "silex/silex",
|
||||
"version": "v2.3.0",
|
||||
"version": "v1.3.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/silexphp/Silex.git",
|
||||
"reference": "6bc31c1b8c4ef614a7115320fd2d3b958032f131"
|
||||
"reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/silexphp/Silex/zipball/6bc31c1b8c4ef614a7115320fd2d3b958032f131",
|
||||
"reference": "6bc31c1b8c4ef614a7115320fd2d3b958032f131",
|
||||
"url": "https://api.github.com/repos/silexphp/Silex/zipball/ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136",
|
||||
"reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136",
|
||||
"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"
|
||||
"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",
|
||||
"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"
|
||||
"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": "2.3.x-dev"
|
||||
"dev-master": "1.3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -279,36 +445,36 @@
|
||||
"microframework"
|
||||
],
|
||||
"abandoned": "symfony/flex",
|
||||
"time": "2018-04-20T05:17:01+00:00"
|
||||
"time": "2017-04-30T16:26:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v4.1.5",
|
||||
"version": "v3.4.17",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "b4a0b67dee59e2cae4449a8f8eabc508d622fd33"
|
||||
"reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/b4a0b67dee59e2cae4449a8f8eabc508d622fd33",
|
||||
"reference": "b4a0b67dee59e2cae4449a8f8eabc508d622fd33",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
|
||||
"reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": "^5.5.9|>=7.0.8",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/http-kernel": "<3.4"
|
||||
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/http-kernel": "~3.4|~4.0"
|
||||
"symfony/http-kernel": "~2.8|~3.0|~4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "3.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -335,34 +501,31 @@
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-09-22T19:04:12+00:00"
|
||||
"time": "2018-10-02T16:33:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v4.1.5",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e"
|
||||
"reference": "54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
|
||||
"reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00",
|
||||
"reference": "54da3ff63dec3c9c0e32ec3f95a7d94ef64baa00",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/dependency-injection": "<3.4"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"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"
|
||||
"symfony/config": "~2.8|~3.0",
|
||||
"symfony/dependency-injection": "~2.8|~3.0",
|
||||
"symfony/expression-language": "~2.8|~3.0",
|
||||
"symfony/stopwatch": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
@@ -371,7 +534,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -398,7 +561,7 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-07-26T09:10:45+00:00"
|
||||
"time": "2016-07-19T10:44:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/flex",
|
||||
@@ -449,30 +612,29 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v4.1.5",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-foundation.git",
|
||||
"reference": "2ce66353d0a6ea96bc54bc9ecf8bcea4eaf5896c"
|
||||
"reference": "49ba00f8ede742169cb6b70abe33243f4d673f82"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/2ce66353d0a6ea96bc54bc9ecf8bcea4eaf5896c",
|
||||
"reference": "2ce66353d0a6ea96bc54bc9ecf8bcea4eaf5896c",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82",
|
||||
"reference": "49ba00f8ede742169cb6b70abe33243f4d673f82",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": ">=5.5.9",
|
||||
"symfony/polyfill-mbstring": "~1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"predis/predis": "~1.0",
|
||||
"symfony/expression-language": "~3.4|~4.0"
|
||||
"symfony/expression-language": "~2.8|~3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -499,67 +661,62 @@
|
||||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-09-30T03:47:35+00:00"
|
||||
"time": "2016-07-17T13:54:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
"version": "v4.1.5",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-kernel.git",
|
||||
"reference": "74b1d37bf9a1cddc38093530c0a931a310994ea5"
|
||||
"reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/74b1d37bf9a1cddc38093530c0a931a310994ea5",
|
||||
"reference": "74b1d37bf9a1cddc38093530c0a931a310994ea5",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3",
|
||||
"reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": ">=5.5.9",
|
||||
"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"
|
||||
"symfony/debug": "~2.8|~3.0",
|
||||
"symfony/event-dispatcher": "~2.8|~3.0",
|
||||
"symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2"
|
||||
},
|
||||
"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"
|
||||
"symfony/config": "<2.8"
|
||||
},
|
||||
"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"
|
||||
"symfony/browser-kit": "~2.8|~3.0",
|
||||
"symfony/class-loader": "~2.8|~3.0",
|
||||
"symfony/config": "~2.8|~3.0",
|
||||
"symfony/console": "~2.8|~3.0",
|
||||
"symfony/css-selector": "~2.8|~3.0",
|
||||
"symfony/dependency-injection": "~2.8|~3.0",
|
||||
"symfony/dom-crawler": "~2.8|~3.0",
|
||||
"symfony/expression-language": "~2.8|~3.0",
|
||||
"symfony/finder": "~2.8|~3.0",
|
||||
"symfony/process": "~2.8|~3.0",
|
||||
"symfony/routing": "~2.8|~3.0",
|
||||
"symfony/stopwatch": "~2.8|~3.0",
|
||||
"symfony/templating": "~2.8|~3.0",
|
||||
"symfony/translation": "~2.8|~3.0",
|
||||
"symfony/var-dumper": "~2.8|~3.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": "4.1-dev"
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -586,7 +743,7 @@
|
||||
],
|
||||
"description": "Symfony HttpKernel Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-09-30T05:05:39+00:00"
|
||||
"time": "2016-07-30T09:10:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
@@ -707,34 +864,32 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/routing",
|
||||
"version": "v4.1.5",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/routing.git",
|
||||
"reference": "d998113cf6db1e8262fdd8d5db9774c9a7be33b0"
|
||||
"reference": "9038984bd9c05ab07280121e9e10f61a7231457b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/routing/zipball/d998113cf6db1e8262fdd8d5db9774c9a7be33b0",
|
||||
"reference": "d998113cf6db1e8262fdd8d5db9774c9a7be33b0",
|
||||
"url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b",
|
||||
"reference": "9038984bd9c05ab07280121e9e10f61a7231457b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3"
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<3.4",
|
||||
"symfony/dependency-injection": "<3.4",
|
||||
"symfony/yaml": "<3.4"
|
||||
"symfony/config": "<2.8"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/annotations": "~1.0",
|
||||
"doctrine/common": "~2.2",
|
||||
"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"
|
||||
"symfony/config": "~2.8|~3.0",
|
||||
"symfony/expression-language": "~2.8|~3.0",
|
||||
"symfony/http-foundation": "~2.8|~3.0",
|
||||
"symfony/yaml": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/annotations": "For using the annotation loader",
|
||||
@@ -747,7 +902,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -780,50 +935,42 @@
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2018-09-08T13:24:10+00:00"
|
||||
"time": "2016-06-29T05:40:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/twig-bridge",
|
||||
"version": "v4.1.5",
|
||||
"version": "v3.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/twig-bridge.git",
|
||||
"reference": "4a8426ab5e00c34ac8a7bf1a2bfd5a75165edadb"
|
||||
"reference": "856a0b75f634fa907cdc0fbce5bf2eb667a1673d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/4a8426ab5e00c34ac8a7bf1a2bfd5a75165edadb",
|
||||
"reference": "4a8426ab5e00c34ac8a7bf1a2bfd5a75165edadb",
|
||||
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/856a0b75f634fa907cdc0fbce5bf2eb667a1673d",
|
||||
"reference": "856a0b75f634fa907cdc0fbce5bf2eb667a1673d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"twig/twig": "^1.35|^2.4.4"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/console": "<3.4",
|
||||
"symfony/form": "<4.1.2"
|
||||
"php": ">=5.5.9",
|
||||
"twig/twig": "~1.23|~2.0"
|
||||
},
|
||||
"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.5",
|
||||
"symfony/http-foundation": "~3.4|~4.0",
|
||||
"symfony/http-kernel": "~3.4|~4.0",
|
||||
"symfony/asset": "~2.8|~3.0",
|
||||
"symfony/console": "~2.8|~3.0",
|
||||
"symfony/expression-language": "~2.8|~3.0",
|
||||
"symfony/finder": "~2.8|~3.0",
|
||||
"symfony/form": "~3.0.4",
|
||||
"symfony/http-kernel": "~2.8|~3.0",
|
||||
"symfony/polyfill-intl-icu": "~1.0",
|
||||
"symfony/routing": "~3.4|~4.0",
|
||||
"symfony/security": "~3.4|~4.0",
|
||||
"symfony/routing": "~2.8|~3.0",
|
||||
"symfony/security": "~2.8|~3.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"
|
||||
"symfony/stopwatch": "~2.8|~3.0",
|
||||
"symfony/templating": "~2.8|~3.0",
|
||||
"symfony/translation": "~2.8|~3.0",
|
||||
"symfony/var-dumper": "~2.8|~3.0",
|
||||
"symfony/yaml": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/asset": "For using the AssetExtension",
|
||||
@@ -837,13 +984,12 @@
|
||||
"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"
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -870,7 +1016,7 @@
|
||||
],
|
||||
"description": "Symfony Twig Bridge",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-09-18T16:38:01+00:00"
|
||||
"time": "2016-03-28T06:29:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
|
||||
@@ -87,6 +87,18 @@ class Config
|
||||
return dbw_connect($DB["SGBD"], $DB["path"], $DB["db"], $DB["user"], $DB["password"]);
|
||||
}
|
||||
|
||||
public static function getDBalConexion(){
|
||||
if(!Config::initialized())
|
||||
Config::init();
|
||||
$DB = Config::$config["database"];
|
||||
return array(
|
||||
'dbname' => $DB['db'],
|
||||
'user' => $DB['user'],
|
||||
'password' => $DB['password'],
|
||||
'host' => $DB['path'],
|
||||
'driver' => "pdo_".$DB['SGBD']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get options of project if exists
|
||||
*
|
||||
|
||||
@@ -10,57 +10,41 @@ class DB
|
||||
/**
|
||||
* @var bool connection with database
|
||||
*/
|
||||
public $conn;
|
||||
private $conn;
|
||||
|
||||
/**
|
||||
* DB constructor
|
||||
*/
|
||||
function __construct()
|
||||
function __construct($db)
|
||||
{
|
||||
$this->conn = Config::getDBConexion();
|
||||
$this->conn = $db;
|
||||
$this->createTable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the connection
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
dbw_close($this->conn);
|
||||
/*Base methods*/
|
||||
public function newQueryBuilder(){
|
||||
$queryBuilder = new \Doctrine\DBAL\Query\QueryBuilder($this->conn);
|
||||
return $queryBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first array of a query result
|
||||
*
|
||||
* @param $query sql query
|
||||
* @return array array
|
||||
*/
|
||||
private function getQuery($query)
|
||||
{
|
||||
return dbw_fetch_array($this->conn, dbw_query($this->conn, $query));
|
||||
public function execute($queryBuilder){
|
||||
$query = $queryBuilder->execute();
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total of codes in database
|
||||
*
|
||||
* @return int total of codes
|
||||
*/
|
||||
private function numOfCodes()
|
||||
{
|
||||
return $this->getQuery("SELECT COUNT(*) FROM Sources")[0];
|
||||
public function getData($queryBuilder){
|
||||
|
||||
return $this->execute($queryBuilder)->fetchAll();
|
||||
}
|
||||
/*End methods*/
|
||||
|
||||
|
||||
/**
|
||||
* Create table if not exist in deploy (Database must be exist).
|
||||
*/
|
||||
private function createTable()
|
||||
{
|
||||
$query = "SET NAMES utf8; SET time_zone = '+00:00'; CREATE TABLE IF NOT EXISTS `Users`( `IDU` int(11) NOT NULL AUTO_INCREMENT, `email` varchar(64) NOT NULL, `pass` varchar(64) NOT NULL, `nick` varchar(40) NOT NULL, `token` varchar(50) DEFAULT NULL, `ROLE` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`IDU`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `Codes` ( `IDC` int(11) NOT NULL AUTO_INCREMENT, `UserCreator` int(11) NOT NULL, `Name` varchar(80) NOT NULL, `Description` text NOT NULL, `Input` text NOT NULL, `Output` text NOT NULL, PRIMARY KEY (`IDC`), KEY `UserCreator` (`UserCreator`), CONSTRAINT `Codes_ibfk_1` FOREIGN KEY (`UserCreator`) REFERENCES `Users` (`IDU`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `Sources` ( `IDC` int(11) NOT NULL, `IDU` int(11) NOT NULL, `Lang` varchar(15) NOT NULL, `Version` int(11) NOT NULL, `Modification` int(11) NOT NULL, `Code` text NOT NULL, `UseExtLib` text, `UseExtLibVer` varchar(55) DEFAULT NULL, PRIMARY KEY (`IDC`,`Lang`,`Version`), KEY `IDU` (`IDU`), CONSTRAINT `Sources_ibfk_1` FOREIGN KEY (`IDU`) REFERENCES `Users` (`IDU`), CONSTRAINT `Sources_ibfk_2` FOREIGN KEY (`IDC`) REFERENCES `Codes` (`IDC`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8";
|
||||
$query = explode(";",$query);
|
||||
foreach ($query as $queryPart){
|
||||
dbw_query($this->conn,$queryPart);
|
||||
}
|
||||
//dbw_multi_query($this->conn, $query);
|
||||
/*TODO*/
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -77,8 +61,16 @@ class DB
|
||||
*/
|
||||
public function loadOriginalAuthor($IDC)
|
||||
{
|
||||
$query = "SELECT UserCreator FROM Codes WHERE IDC='$IDC'";
|
||||
return $this->getQuery($query)[0];
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('UserCreator')
|
||||
->from('Codes')
|
||||
->where($queryBuilder->expr()->eq(
|
||||
'IDC','?'
|
||||
))
|
||||
->setParameter(0,$IDC);
|
||||
return $this->getData($queryBuilder)[0];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,9 +83,29 @@ class DB
|
||||
*/
|
||||
public function loadAll($id, $lang, $version)
|
||||
{
|
||||
$query = "SELECT * FROM Users NATURAL JOIN Sources NATURAL JOIN Codes WHERE IDC=$id AND Lang='$lang' AND Version=$version";
|
||||
$code = $this->getQuery($query);
|
||||
return $code;
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('*')
|
||||
->from('Users','u')
|
||||
->join('u','Sources','s',
|
||||
$queryBuilder->expr()->eq(
|
||||
'u.IDU','s.IDU'
|
||||
))
|
||||
->join('s','Codes','c',
|
||||
$queryBuilder->expr()->eq(
|
||||
's.IDC','c.IDC'
|
||||
))
|
||||
->where($queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('c.IDC','?'),
|
||||
$queryBuilder->expr()->eq('s.Lang','?'),
|
||||
$queryBuilder->expr()->eq('s.Version','?')
|
||||
))
|
||||
->setParameter(0,$id)
|
||||
->setParameter(1,$lang)
|
||||
->setParameter(2,$version);
|
||||
$data = $this->getData($queryBuilder)[0];
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,11 +115,40 @@ class DB
|
||||
*/
|
||||
public function loadLast($page = 0)
|
||||
{
|
||||
$page=$page*10;
|
||||
$query = "SELECT IDC,Name,nick,Lang,Description,Code,Version FROM Users NATURAL JOIN Sources as S NATURAL JOIN Codes WHERE Version = (SELECT MAX(Version) FROM Sources WHERE S.Lang = Lang AND S.IDC = IDC) ORDER BY Modification DESC LIMIT $page, 10";
|
||||
//echo $query;
|
||||
$code = dbw_query($this->conn, $query);
|
||||
return $code;
|
||||
$each=10;
|
||||
$page=$page*$each;
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$subQuery = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select("c.IDC","Name","nick","Lang","Description","Code","Version")
|
||||
->from('Users','u')
|
||||
->join('u','Sources','s',
|
||||
$queryBuilder->expr()->eq(
|
||||
'u.IDU','s.IDU'
|
||||
))
|
||||
->join('s','Codes','c',
|
||||
$queryBuilder->expr()->eq(
|
||||
's.IDC','c.IDC'
|
||||
))
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
's.Version','('.
|
||||
$subQuery
|
||||
->select('MAX(Version)')
|
||||
->from('Sources')
|
||||
->where(
|
||||
$subQuery->expr()->andX(
|
||||
$subQuery->expr()->eq('s.Lang','Lang'),
|
||||
$subQuery->expr()->eq('s.IDC','IDC')
|
||||
))
|
||||
->getSql()
|
||||
.')'
|
||||
))
|
||||
->orderBy('Modification','DESC')
|
||||
->setFirstResult($page)
|
||||
->setMaxResults(10);
|
||||
|
||||
return $this->execute($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,8 +160,22 @@ class DB
|
||||
*/
|
||||
public function loadOtherVersion($id, $lang)
|
||||
{
|
||||
$query = "SELECT * FROM Users NATURAL JOIN Sources NATURAL JOIN Codes WHERE IDC='$id' AND Lang='$lang' ORDER BY Version ASC";
|
||||
return dbw_query($this->conn, $query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('*')
|
||||
->from('Users','u')
|
||||
->join('u','Sources','s',
|
||||
$queryBuilder->expr()->eq('u.IDU','s.IDU'))
|
||||
->join('s','Codes','c',
|
||||
$queryBuilder->expr()->eq('s.IDC','c.IDC'))
|
||||
->where($queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('c.IDC','?'),
|
||||
$queryBuilder->expr()->eq('s.Lang','?')
|
||||
))
|
||||
->orderBy('Version','ASC')
|
||||
->setParameter(0,$id)
|
||||
->setParameter(1,$lang);
|
||||
return $this->execute($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,10 +187,26 @@ class DB
|
||||
*/
|
||||
public function loadDiff($id, $lang)
|
||||
{
|
||||
$lang=dbw_escape_string($this->conn,$lang);
|
||||
$query = "SELECT Lang,Code,Version FROM Sources WHERE IDC=$id AND Lang<>'$lang' AND Version = (SELECT MAX(Version) FROM Sources WHERE IDC=$id AND Lang='$lang')";
|
||||
$code = dbw_query($this->conn, $query);
|
||||
return $code;
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$subQueryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('s.Lang','s.Code','s.Version')
|
||||
->from('Sources','s')
|
||||
->where($queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->neq('s.Lang','?'),
|
||||
$queryBuilder->expr()->eq('s.IDC','?'),
|
||||
$queryBuilder->expr()->eq('s.Version','('.
|
||||
$subQueryBuilder
|
||||
->select('MAX(su.Version)')
|
||||
->from('Sources','su')
|
||||
->where($subQueryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('su.IDC','?'),
|
||||
$queryBuilder->expr()->eq('su.Lang','?')
|
||||
))->getSQL().')'
|
||||
)
|
||||
))
|
||||
->setParameters(array($lang,$id,$id,$lang));
|
||||
return $this->getData($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,10 +217,15 @@ class DB
|
||||
*/
|
||||
public function loadLangs($IDC)
|
||||
{
|
||||
$query = "SELECT DISTINCT Lang FROM Sources WHERE IDC='$IDC'";
|
||||
$toFetch = dbw_query($this->conn, $query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('DISTINCT Lang')
|
||||
->from('Sources')
|
||||
->where($queryBuilder->expr()->eq('IDC','?'))
|
||||
->setParameter(0,$IDC);
|
||||
$query = $this->getData($queryBuilder);
|
||||
$toReturn = array();
|
||||
while ($var = dbw_fetch_array($this->conn, $toFetch)) {
|
||||
foreach ($query as $var) {
|
||||
array_push($toReturn, $var["Lang"]);
|
||||
}
|
||||
return $toReturn;
|
||||
@@ -164,8 +240,17 @@ class DB
|
||||
*/
|
||||
public function getLastVersion($IDC, $lang)
|
||||
{
|
||||
$query = "SELECT MAX(Version) FROM Sources WHERE IDC='$IDC' AND Lang='$lang'";
|
||||
return $this->getQuery($query)[0];
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('MAX(Version)')
|
||||
->from('Sources')
|
||||
->where($queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('IDC','?'),
|
||||
$queryBuilder->expr()->eq('Lang','?')
|
||||
))
|
||||
->setParameter(0,$IDC)
|
||||
->setParameter(1,$lang);
|
||||
return $this->getData($queryBuilder)[0]['MAX(Version)'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,8 +260,13 @@ class DB
|
||||
*/
|
||||
public function getLastIDC($name)
|
||||
{
|
||||
$query = "SELECT MAX(IDC) FROM Codes WHERE name='$name'";
|
||||
return $this->getQuery($query)[0];
|
||||
$queryBuiler = $this->newQueryBuilder();
|
||||
$queryBuiler
|
||||
->select('MAX(IDC)')
|
||||
->from('Codes')
|
||||
->where($queryBuiler->expr()->eq('name','?'))
|
||||
->setParameter(0,$name);
|
||||
return $this->getData($queryBuiler)[0]['MAX(IDC)'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,8 +277,13 @@ class DB
|
||||
*/
|
||||
public function loadCode($idc)
|
||||
{
|
||||
$query = "SELECT * FROM Codes WHERE IDC=" . $idc;
|
||||
return $this->getQuery($query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('*')
|
||||
->from('Codes')
|
||||
->where($queryBuilder->expr()->eq('IDC','?'))
|
||||
->setParameter(0,$idc);
|
||||
return $this->getData($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,35 +294,54 @@ class DB
|
||||
*/
|
||||
public function loadFilter($array,$global_search)
|
||||
{
|
||||
$query = "SELECT IDC,Name,nick,Lang,Description,Code,Version FROM Users NATURAL JOIN Sources as S NATURAL JOIN Codes ";
|
||||
$where = "WHERE (";
|
||||
$count = false;
|
||||
foreach ($array as $key => $value) {
|
||||
if ($key != "search" and $key != "o") {
|
||||
if ($count) {
|
||||
$where = $where . "OR S.Lang='$value' ";
|
||||
} else {
|
||||
$where = $where . "S.Lang='$value' ";
|
||||
$count = !$count;
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('c.IDC','c.Name','u.nick','s.Lang','c.Description','s.Code','s.Version')
|
||||
->from('Users','u')
|
||||
->join('u','Sources','s',
|
||||
$queryBuilder->expr()->eq('u.IDU','s.IDU'))
|
||||
->join('s','Codes','c',
|
||||
$queryBuilder->expr()->eq('s.IDC','c.IDC'));
|
||||
|
||||
if($global_search){
|
||||
$queryBuilder
|
||||
->where('TRUE');
|
||||
}
|
||||
else{
|
||||
$count = false;
|
||||
foreach ($array as $key => $value) {
|
||||
if ($key != "search" and $key != "o") {
|
||||
if ($count) {
|
||||
$queryBuilder
|
||||
->orWhere($queryBuilder->expr()->eq('s.Lang',"'$value'"));
|
||||
} else {
|
||||
$queryBuilder->where($queryBuilder->expr()->eq('s.Lang',"'$value'"));
|
||||
$count = !$count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//var_dump($global_search);
|
||||
if ($global_search){
|
||||
$where = "WHERE (TRUE";
|
||||
}
|
||||
|
||||
if (array_key_exists("o",$array))
|
||||
$first = $array["o"] * 10;
|
||||
else
|
||||
$first = 0;
|
||||
if(array_key_exists("search",$array))
|
||||
$search = $this->search($array["search"]);
|
||||
else
|
||||
$search = "";
|
||||
$queryLast = ") AND Version = (SELECT MAX(Version) FROM Sources WHERE S.Lang = Lang AND S.IDC = IDC)" . $search . " ORDER BY Modification DESC LIMIT $first, 10";
|
||||
//echo $query.$where.$queryLast;
|
||||
return dbw_query($this->conn, $query . $where . $queryLast);
|
||||
$queryBuilder = $this->search($queryBuilder,$array["search"]);
|
||||
$subQuery = $this->newQueryBuilder();
|
||||
$queryBuilder->andWhere(
|
||||
$queryBuilder->expr()->eq('s.Version','('.
|
||||
$subQuery
|
||||
->select('MAX(su.Version)')
|
||||
->from('Sources','su')
|
||||
->where($subQuery->expr()->andX(
|
||||
$subQuery->expr()->eq('s.Lang','su.Lang'),
|
||||
$subQuery->expr()->eq('s.IDC','su.IDC'))
|
||||
)->getSQL().')'
|
||||
))
|
||||
->orderBy('Modification','DESC')
|
||||
->setFirstResult($first)
|
||||
->setMaxResults(10);
|
||||
return $this->execute($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,26 +350,24 @@ class DB
|
||||
* @param $text input by user
|
||||
* @return string sql query fragment
|
||||
*/
|
||||
public function search($text)
|
||||
public function search(Doctrine\DBAL\Query\QueryBuilder $queryBuilder, $text)
|
||||
{
|
||||
$text = dbw_escape_string($this->conn, $text);
|
||||
$subWhere = "";
|
||||
if ($text != "") {
|
||||
$query = "";
|
||||
$textExplode = explode(" ", $text);
|
||||
$value = true;
|
||||
$value = 0;
|
||||
foreach ($textExplode as $find) {
|
||||
if ($find != "") {
|
||||
if ($value) {
|
||||
$query = $query . "AND (Description LIKE '%" . $find . "%' OR Name LIKE '%" . $find . "%'";
|
||||
$value = false;
|
||||
} else {
|
||||
$query = $query . "AND Description LIKE '%" . $find . "%' OR Name LIKE '%" . $find . "%'";
|
||||
if ($value != 0) {
|
||||
$subWhere .= " AND ";
|
||||
}
|
||||
$subWhere.="c.Description LIKE ".$queryBuilder->getConnection()->quote("%$find%")." OR c.Name LIKE ".$queryBuilder->getConnection()->quote("%$find%");
|
||||
$value++;
|
||||
}
|
||||
}
|
||||
return $query . ")";
|
||||
return $queryBuilder->andWhere($subWhere);
|
||||
} else {
|
||||
return "";
|
||||
return $queryBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,13 +398,24 @@ class DB
|
||||
$version = 0;
|
||||
$version++;
|
||||
$modification = time();
|
||||
|
||||
|
||||
$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);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->insert('Sources')
|
||||
->values(
|
||||
array(
|
||||
'IDC' => '?',
|
||||
'Lang' => '?',
|
||||
'Version' => '?',
|
||||
'Modification' => '?',
|
||||
'Code' => '?',
|
||||
'UseExtLib' => '?',
|
||||
'UseExtLibVer' => '?',
|
||||
'IDU' => '?'
|
||||
)
|
||||
)
|
||||
->setParameters(array($IDC,$lang,$version,$modification,$code,$lib,$libV,$IDU));
|
||||
$this->execute($queryBuilder);
|
||||
return $version;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,34 +435,58 @@ class DB
|
||||
*/
|
||||
public function addOrModifyCodes($IDC, $name, $description, $input, $output, $lang, $code, $IDU, $extlib = null, $extlibver = null)
|
||||
{
|
||||
$in = dbw_escape_string($this->conn, $input);
|
||||
$out = dbw_escape_string($this->conn, $output);
|
||||
$_code = dbw_escape_string($this->conn, $code);
|
||||
if ($IDC == 0) {
|
||||
$query = "INSERT INTO Codes (`UserCreator`,`Name`,`Description`,`Input`,`Output`) VALUES ('$IDU','$name','$description','$in','$out') ";
|
||||
//echo $query.';';
|
||||
//die();
|
||||
dbw_query($this->conn, $query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->insert('Codes')
|
||||
->values(array(
|
||||
'UserCreator' => '?',
|
||||
'Name' => '?',
|
||||
'Description' => '?',
|
||||
'Input' => '?',
|
||||
'Output' => '?'
|
||||
))
|
||||
->setParameters(array($IDU,$name,$description,$input,$output));
|
||||
//$query = "INSERT INTO Codes (`UserCreator`,`Name`,`Description`,`Input`,`Output`) VALUES ('$IDU','$name','$description','$in','$out') ";
|
||||
$this->execute($queryBuilder);
|
||||
$myID = $this->getLastIDC($name);
|
||||
$this->addSource($myID, $lang, $_code, $IDU, $extlib, $extlibver);
|
||||
$this->addSource($myID, $lang, $code, $IDU, $extlib, $extlibver);
|
||||
return $myID;
|
||||
} else {
|
||||
$arr = $this->loadAll($IDC, $lang, $this->getLastVersion($IDC, $lang));
|
||||
$codewrite = $arr["Code"];
|
||||
$version = 0;
|
||||
if ($_code != dbw_escape_string($this->conn,$codewrite)) {
|
||||
$version = $this->addSource($IDC, $lang, $_code, $IDU, $extlib, $extlibver,$codewrite);
|
||||
if ($code != $codewrite) {
|
||||
$version = $this->addSource($IDC, $lang, $code, $IDU, $extlib, $extlibver);
|
||||
} 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]";
|
||||
//echo $query.';';
|
||||
dbw_query($this->conn, $query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->update('Sources')
|
||||
->set('UseExtLib','?')
|
||||
->set('UseExtLibVer','?')
|
||||
->where($queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('IDC','?'),
|
||||
$queryBuilder->expr()->eq('Lang','?'),
|
||||
$queryBuilder->expr()->eq('Version','?')
|
||||
))
|
||||
->setParameter(0,$extlib)
|
||||
->setParameter(1,$extlibver)
|
||||
->setParameter(2,$IDC)
|
||||
->setParameter(3,$arr['Lang'])
|
||||
->setParameter(4,$arr['Version']);
|
||||
$this->execute($queryBuilder);
|
||||
}
|
||||
|
||||
$query = "UPDATE Codes SET `Name`='$name', `Description`='$description', `Input`='$in', `Output`='$out' WHERE IDC='$IDC'";
|
||||
|
||||
//echo $query.';';
|
||||
dbw_query($this->conn, $query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->update('Codes')
|
||||
->set('Name','?')
|
||||
->set('Description','?')
|
||||
->set('Input','?')
|
||||
->set('Output','?')
|
||||
->where($queryBuilder->expr()->eq('IDC','?'))
|
||||
->setParameters(array($name,$description,$input,$output,$IDC));
|
||||
$this->execute($queryBuilder);
|
||||
return $version;
|
||||
}
|
||||
}
|
||||
@@ -372,8 +519,13 @@ class DB
|
||||
*/
|
||||
public function loadProfile($id)
|
||||
{
|
||||
$query = "SELECT * FROM Users WHERE IDU=" . $id;
|
||||
return $this->getQuery($query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('*')
|
||||
->from('Users','u')
|
||||
->where($queryBuilder->expr()->eq('u.IDU','?'))
|
||||
->setParameter(0,$id);
|
||||
return $this->getData($queryBuilder)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -384,8 +536,13 @@ class DB
|
||||
*/
|
||||
public function loadIDU($field,$mode='email')
|
||||
{
|
||||
$query = "SELECT IDU FROM Users WHERE $mode='" . $field . "'";
|
||||
return $this->getQuery($query)["IDU"];
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('IDU')
|
||||
->from('Users')
|
||||
->where($queryBuilder->expr()->eq($mode,'?'))
|
||||
->setParameter(0,$field);
|
||||
return $this->getData($queryBuilder)[0]['IDU'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -397,7 +554,13 @@ class DB
|
||||
*/
|
||||
public function checkCookie($IDU, $token)
|
||||
{
|
||||
$tokenDB = $this->getQuery("SELECT token FROM Users WHERE IDU=" . $IDU)["token"];
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select('token')
|
||||
->from('Users')
|
||||
->where($queryBuilder->expr()->eq('IDU','?'))
|
||||
->setParameter(0,$IDU);
|
||||
$tokenDB = $this->getData($queryBuilder)[0]["token"];
|
||||
if ($tokenDB == $token)
|
||||
return true;
|
||||
else
|
||||
@@ -413,8 +576,13 @@ class DB
|
||||
*/
|
||||
public function checkPass($email, $pass)
|
||||
{
|
||||
$query = "SELECT pass FROM Users WHERE email='$email'";
|
||||
$passDB = $this->getQuery($query)["pass"];
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->select("pass")
|
||||
->from("Users")
|
||||
->where($queryBuilder->expr()->eq('email','?'))
|
||||
->setParameter(0,$email);
|
||||
$passDB = $this->getData($queryBuilder)[0]["pass"];
|
||||
if ($passDB == hash('sha256', $pass))
|
||||
return true;
|
||||
else
|
||||
@@ -439,7 +607,16 @@ class DB
|
||||
return 'NICK_IN_USE';
|
||||
else {
|
||||
$password = hash('sha256', $pass);
|
||||
dbw_query($this->conn, "INSERT INTO Users (`email`,`pass`,`nick`) VALUES ('$email','$password','$nick')");
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->insert('Users')
|
||||
->values(array(
|
||||
'email' => '?',
|
||||
'pass' => '?',
|
||||
'nick' => '?'
|
||||
))
|
||||
->setParameters(array($email,$password,$nick));
|
||||
$this->execute($queryBuilder);
|
||||
return 'CORRECT';
|
||||
}
|
||||
}
|
||||
@@ -452,7 +629,14 @@ class DB
|
||||
*/
|
||||
public function setToken($IDU, $token)
|
||||
{
|
||||
dbw_query($this->conn, "UPDATE Users SET token='$token' WHERE IDU='$IDU'");
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->update('Users')
|
||||
->set('token','?')
|
||||
->where($queryBuilder->expr()->eq('IDU','?'))
|
||||
->setParameter(0,$token)
|
||||
->setParameter(1,$IDU);
|
||||
$this->execute($queryBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -463,7 +647,13 @@ class DB
|
||||
*/
|
||||
public function updatePass($idu, $pass)
|
||||
{
|
||||
$query = "UPDATE Users SET pass='" . hash('sha256', $pass) . "' WHERE IDU='$idu'";
|
||||
dbw_query($this->conn, $query);
|
||||
$queryBuilder = $this->newQueryBuilder();
|
||||
$queryBuilder
|
||||
->update('Users')
|
||||
->set('pass','?')
|
||||
->where($queryBuilder->expr()->eq('IDU','?'))
|
||||
->setParameter(0,hash('sha256',$pass))
|
||||
->setParameter(1,$idu);
|
||||
$this->execute($queryBuilder);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
$app['debug'] = true;
|
||||
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
|
||||
$app->register(new Silex\Provider\TwigServiceProvider(), array(
|
||||
'twig.path' => __DIR__.'/../',
|
||||
));
|
||||
@@ -34,16 +35,11 @@ foreach($valores as $asset){
|
||||
$string = file_get_contents(__DIR__."/../data/supported.json");
|
||||
$app["supported"] = json_decode($string, true);
|
||||
|
||||
$app['db']=null;
|
||||
function connectDB(){
|
||||
global $app;
|
||||
try {
|
||||
$app['db'] = new DB();
|
||||
}catch (Exception $ex){
|
||||
$app->abort('503','ERROR en la Base de Datos');
|
||||
|
||||
}
|
||||
}
|
||||
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
|
||||
'db.options' => Config::getDBalConexion()
|
||||
));
|
||||
|
||||
$app['data'] = new DB($app['db']);
|
||||
|
||||
/* Security */
|
||||
$app['security.role_hierarchy'] = array(
|
||||
@@ -56,9 +52,8 @@ $app->boot();
|
||||
|
||||
/* Basics */
|
||||
$app->get('/', function (Request $request) use($app) {
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
$last = array();
|
||||
$ajax=false;
|
||||
if($request->getMethod()=="POST"){
|
||||
if($request->get('globalSearch')!=null){
|
||||
@@ -69,11 +64,11 @@ $app->get('/', function (Request $request) use($app) {
|
||||
$type=false;
|
||||
$ajax=true;
|
||||
}
|
||||
$last = $app['db']->loadFilter($data,$type);
|
||||
$last = lastToArray($app['db'],$last,$app['supported']);
|
||||
$last = $app['data']->loadFilter($data,$type);
|
||||
$last = lastToArray($last,$app['supported']);
|
||||
}else{
|
||||
$query = $app['db']->loadLast();
|
||||
$last = lastToArray($app["db"],$query,$app['supported']);
|
||||
$query = $app['data']->loadLast();
|
||||
$last = lastToArray($query,$app['supported']);
|
||||
}
|
||||
$page = array( 'title' => "CodeShare",
|
||||
"description" => "Sharing your solutions with all",
|
||||
@@ -96,7 +91,7 @@ $app->get('/', function (Request $request) use($app) {
|
||||
|
||||
|
||||
$app->get('/doc', function (Request $request) use($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
$page = array(
|
||||
"title" => "Documentation",
|
||||
@@ -107,7 +102,7 @@ $app->get('/doc', function (Request $request) use($app){
|
||||
})->bind('doc');
|
||||
|
||||
$app->get('/about', function (Request $request) use($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
$page = array(
|
||||
"title" => "About CodeShare",
|
||||
@@ -119,7 +114,7 @@ $app->get('/about', function (Request $request) use($app){
|
||||
|
||||
/* User */
|
||||
$app->get('/tos',function(Request $request) use($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
$page = array(
|
||||
"title" => "Terms of service",
|
||||
@@ -131,7 +126,7 @@ $app->get('/tos',function(Request $request) use($app){
|
||||
})->bind('tos');
|
||||
|
||||
$app->get('/login', function(Request $request) use ($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
if($user != null){
|
||||
return $app->redirect($app["url_generator"]->generate('home'));
|
||||
@@ -147,7 +142,7 @@ $app->get('/login', function(Request $request) use ($app){
|
||||
})->bind('login')->method('GET|POST');
|
||||
|
||||
$app->get('/signup', function(Request $request) use ($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
if($user != null){
|
||||
return $app->redirect($app["url_generator"]->generate('home'));
|
||||
@@ -177,18 +172,19 @@ function loginRegister($default,$state=''){
|
||||
}
|
||||
|
||||
function loginOrRegister($state,$request){
|
||||
global $app;
|
||||
switch ($state){
|
||||
case 3:
|
||||
return loginRegister('login','BAD_CREDENTIAL');
|
||||
case 1:
|
||||
if(checklogin($request->get('email'),$request->get('pwd'))==''){
|
||||
if(checklogin($request->get('email'),$request->get('pwd'),$app['data'])==''){
|
||||
return 'redirect';
|
||||
}else{
|
||||
return loginRegister("login",'BAD_CREDENTIAL');
|
||||
}
|
||||
case 2:
|
||||
$state = register($request->get('emailre'),$request->get('emailre-re'),
|
||||
$request->get('pwdre'), $request->get('pwdre-re'),$request->get('nick'));
|
||||
$request->get('pwdre'), $request->get('pwdre-re'),$request->get('nick'),$app['data']);
|
||||
if ($state == '')
|
||||
return 'redirect';
|
||||
else
|
||||
@@ -203,7 +199,7 @@ $app->get('logout',function(Request $request) use ($app){
|
||||
})->bind('logout');
|
||||
|
||||
$app->get('/user', function(Request $request) use ($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
if($user == null)
|
||||
$app->abort('403');
|
||||
@@ -213,12 +209,11 @@ $app->get('/user', function(Request $request) use ($app){
|
||||
$passact = $request->get("passact");
|
||||
$newpass = $request->get("newpass");
|
||||
$newpassre = $request->get("newpass-re");
|
||||
if($app['db']->checkPass($user['email'],$passact) && $newpass == $newpassre){
|
||||
if($app['data']->checkPass($user['email'],$passact) && $newpass == $newpassre){
|
||||
$status=1;
|
||||
$app['db']->updatePass($user['IDU'],$newpass);
|
||||
$app['data']->updatePass($user['IDU'],$newpass);
|
||||
}else
|
||||
$status=2;
|
||||
$app['db']->close();
|
||||
}
|
||||
$page = array(
|
||||
"page" => "user",
|
||||
@@ -259,7 +254,7 @@ function HTTPError($code){
|
||||
return array("text"=>$text,"number"=>$code);
|
||||
}
|
||||
|
||||
$app->error(function (\Exception $e,$request, $code) use ($app) {
|
||||
$app->error(function (\Exception $e,$request, $code = 500) use ($app) {
|
||||
$user = null;
|
||||
try{
|
||||
$user = getUser($app);
|
||||
@@ -283,10 +278,10 @@ $app->error(function (\Exception $e,$request, $code) use ($app) {
|
||||
|
||||
/* Codes */
|
||||
$app->get('/code/{lang}-{idc}-{version}', function (Request $request, $lang, $idc, $version) use($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
|
||||
$array = $app['db']->loadAll($idc,$lang,$version);
|
||||
$array = $app['data']->loadAll($idc,$lang,$version);
|
||||
if(!$array){
|
||||
$app->abort('404');
|
||||
}
|
||||
@@ -299,18 +294,17 @@ $app->get('/code/{lang}-{idc}-{version}', function (Request $request, $lang, $id
|
||||
"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),
|
||||
"existedLangs" => $app['data']->loadLangs($idc),
|
||||
"original" => $app['data']->loadOriginalAuthor($idc),
|
||||
);
|
||||
$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)){
|
||||
$diff = $app['data']->loadDiff($idc,$lang);
|
||||
if(count($diff)>=1){
|
||||
$page['otherI'] = true;
|
||||
}
|
||||
dbw_query_goto($app['db']->conn,$diff);
|
||||
$otherImplementation = otherImplementationToArray($app['db'],$diff,$app['supported']);
|
||||
$otherImplementation = otherImplementationToArray($diff,$app['supported']);
|
||||
return $app['twig']->render($app['fronthtml'].'/code.twig', array(
|
||||
"page" => $page,
|
||||
"code" => $code,
|
||||
@@ -332,8 +326,7 @@ function updateCode($request,$idc,$lang,$version,$user){
|
||||
if ($code == null or $lang == null)
|
||||
$app->abort(400);
|
||||
if($lang2 != null){
|
||||
$app['db']->addSource($idc,$lang2,$code,$user['IDU'],$extlib,$extlibver);
|
||||
$app['db']->close();
|
||||
$app['data']->addSource($idc,$lang2,$code,$user['IDU'],$extlib,$extlibver);
|
||||
return $app->redirect($app['url_generator']->generate('code',array("idc"=>$idc,"version"=>1,"lang"=>$lang2)));
|
||||
}else{
|
||||
$name = $request->get("name");
|
||||
@@ -342,8 +335,7 @@ function updateCode($request,$idc,$lang,$version,$user){
|
||||
$output = htmlentities($request->get("output"));
|
||||
if($name == null || $description == null || $input == null ||$output == null)
|
||||
$app->abort(400);
|
||||
$version2 = $app['db']->addOrModifyCodes($idc,$name,$description,$input,$output,$lang,$code,$user['IDU'],$extlibver,$extlibver);
|
||||
$app['db']->close();
|
||||
$version2 = $app['data']->addOrModifyCodes($idc,$name,$description,$input,$output,$lang,$code,$user['IDU'],$extlibver,$extlibver);
|
||||
if($version2!=0)
|
||||
return $app->redirect($app['url_generator']->generate('code',array("idc"=>$idc,"version"=>$version2,"lang"=>$lang)));
|
||||
else
|
||||
@@ -352,11 +344,11 @@ function updateCode($request,$idc,$lang,$version,$user){
|
||||
}
|
||||
|
||||
$app->get('/code/{lang}-{idc}', function(Request $request, $lang, $idc) use($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
|
||||
$array = $app['db']->loadOtherVersion($idc,$lang);
|
||||
$other = otherVersionToArray($app['db'],$array,$app['supported']);
|
||||
$array = $app['data']->loadOtherVersion($idc,$lang);
|
||||
$other = otherVersionToArray($array,$app['supported']);
|
||||
$name = $other[0]['name'];
|
||||
|
||||
$page = array(
|
||||
@@ -371,7 +363,7 @@ $app->get('/code/{lang}-{idc}', function(Request $request, $lang, $idc) use($app
|
||||
})->bind('codeVer');
|
||||
|
||||
$app->get('/add', function(Request $request) use($app){
|
||||
connectDB();
|
||||
|
||||
$user = getUser($app);
|
||||
if ($user == null)
|
||||
return $app->redirect($app['url_generator']->generate('login'));
|
||||
@@ -390,7 +382,7 @@ $app->get('/add', function(Request $request) use($app){
|
||||
$app->abort(400);
|
||||
}
|
||||
else{
|
||||
$idc = $app['db']->addOrModifyCodes(
|
||||
$idc = $app['data']->addOrModifyCodes(
|
||||
0,
|
||||
$name,
|
||||
$description,
|
||||
|
||||
@@ -1,382 +0,0 @@
|
||||
<?php
|
||||
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__ . '/Config.php';
|
||||
require 'functions.php';
|
||||
require 'DB.php';
|
||||
require 'dbToTable.php';
|
||||
require 'users.php';
|
||||
|
||||
|
||||
$path = array(
|
||||
"html" => "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);
|
||||
}
|
||||
}*/
|
||||
@@ -11,9 +11,10 @@
|
||||
* Methods to get an array to send to twig
|
||||
*/
|
||||
|
||||
function lastToArray($db,&$query,$supported){
|
||||
function lastToArray(&$query,$supported){
|
||||
$last = array();
|
||||
while($var = dbw_fetch_array($db->conn,$query)){
|
||||
$list = $query->fetchAll();
|
||||
foreach($list as $var){
|
||||
$array = array
|
||||
( "idc" => $var["IDC"],
|
||||
"lang" => $var["Lang"],
|
||||
@@ -50,9 +51,9 @@ function allCodeToArray(&$query,$supported){
|
||||
|
||||
}
|
||||
|
||||
function otherImplementationToArray($db,&$query,$supported){
|
||||
function otherImplementationToArray(&$query,$supported){
|
||||
$other = array();
|
||||
while($var = dbw_fetch_array($db->conn,$query)){
|
||||
foreach($query as $var){
|
||||
$array = array
|
||||
( "lang" => $var["Lang"],
|
||||
"version" => $var["Version"],
|
||||
@@ -64,6 +65,6 @@ function otherImplementationToArray($db,&$query,$supported){
|
||||
return $other;
|
||||
}
|
||||
|
||||
function otherVersionToArray($db,$query,$supported){
|
||||
return lastToArray($db,$query,$supported);
|
||||
function otherVersionToArray(&$query,$supported){
|
||||
return lastToArray($query,$supported);
|
||||
}
|
||||
@@ -24,8 +24,7 @@ function checkInfo($request){
|
||||
* @param $pass user's input password
|
||||
* @return bool true if email-password combination is correct, false if not
|
||||
*/
|
||||
function checklogin($email,$pass){
|
||||
$db = new DB();
|
||||
function checklogin($email,$pass,$db){
|
||||
$bool = $db->checkPass($email,$pass);
|
||||
|
||||
if($bool){
|
||||
@@ -34,10 +33,8 @@ function checklogin($email,$pass){
|
||||
$db->setToken($idu,$token);
|
||||
$_SESSION['token'] = $token;
|
||||
$_SESSION['sessionID'] =$idu;
|
||||
$db->close();
|
||||
return '';
|
||||
}
|
||||
$db->close();
|
||||
return 'BAD';
|
||||
}
|
||||
|
||||
@@ -49,16 +46,14 @@ function checklogin($email,$pass){
|
||||
* @param $nick new user's nickname
|
||||
* @return bool true if email never exists before, else false
|
||||
*/
|
||||
function register($email,$emailre,$pass,$passre,$nick){
|
||||
$db = new DB();
|
||||
function register($email,$emailre,$pass,$passre,$nick,$db){
|
||||
|
||||
if($emailre != $email || $pass != $passre)
|
||||
return 'POST_ERROR';
|
||||
$state = $db->register($email,$pass,$nick);
|
||||
if($state == 'CORRECT') {
|
||||
$db->close();
|
||||
return checklogin($email, $pass);
|
||||
return checklogin($email, $pass,$db);
|
||||
}else {
|
||||
$db->close();
|
||||
return $state;
|
||||
}
|
||||
|
||||
@@ -74,8 +69,8 @@ function logout(){
|
||||
function getUser($app){
|
||||
$user=null;
|
||||
if(isset($_SESSION['sessionID'])){
|
||||
if($app['db']->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
|
||||
$user = $app['db']->loadProfile($_SESSION['sessionID']);
|
||||
if($app['data']->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
|
||||
$user = $app['data']->loadProfile($_SESSION['sessionID']);
|
||||
}
|
||||
}
|
||||
return $user;
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
{
|
||||
"doctrine/cache": {
|
||||
"version": "v1.8.0"
|
||||
},
|
||||
"doctrine/dbal": {
|
||||
"version": "v2.8.0"
|
||||
},
|
||||
"doctrine/event-manager": {
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
"jkanetwork/dbwrapper": {
|
||||
"version": "1.5.1"
|
||||
},
|
||||
"pimple/pimple": {
|
||||
"version": "v3.2.3"
|
||||
},
|
||||
@@ -32,6 +44,12 @@
|
||||
"symfony/http-kernel": {
|
||||
"version": "v4.1.5"
|
||||
},
|
||||
"symfony/polyfill-ctype": {
|
||||
"version": "v1.9.0"
|
||||
},
|
||||
"symfony/polyfill-mbstring": {
|
||||
"version": "v1.9.0"
|
||||
},
|
||||
"symfony/routing": {
|
||||
"version": "4.0",
|
||||
"recipe": {
|
||||
@@ -43,5 +61,8 @@
|
||||
},
|
||||
"symfony/twig-bridge": {
|
||||
"version": "v4.1.5"
|
||||
},
|
||||
"twig/twig": {
|
||||
"version": "v2.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"require": {
|
||||
"silex/silex": "~1.3",
|
||||
"twig/twig": "~1.23",
|
||||
"symfony/twig-bridge": "^4.1",
|
||||
"jkanetwork/dbwrapper": "^1.5"
|
||||
}
|
||||
}
|
||||
990
composer.lock
generated
990
composer.lock
generated
@@ -1,990 +0,0 @@
|
||||
{
|
||||
"_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": []
|
||||
}
|
||||
Reference in New Issue
Block a user