This commit is contained in:
JoseluCross
2018-09-30 10:42:10 +02:00
31 changed files with 2519 additions and 404 deletions

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<div class="container justified" style="font-size: 12pt">
<h4 style="text-align: center">Terms of service</h4>
@@ -20,7 +20,7 @@
<p>The registered user in all moment can close their account but all data hosted in CodeShare will remain
hosted.
<br>JKA Network is reserved the right to ban the access to account of any user who engage <a
href="index.php?page=doc#vandalism">vandalism</a></p>
href="{{path('doc')}}#vandalism">vandalism</a></p>
<h4 class="docheader top10" id="cookiePolicy">Cookie policiy</h4>
<p>In CodeShare are used two differents cookies, one for session system and other for cookies' consent. You can
block CodeShare cookies but you cannot log in because we cannot check if login was right.

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<div class="container">
<div class="row" style="text-align: center">

View File

@@ -52,9 +52,7 @@
</div>
<div class="form-group">
<div class="col-sm-12 col-sm-12">
<button type="submit" class="btn btn-success g-recaptcha btn-block"
data-sitekey="6Lc7gXAUAAAAAJRaFo99vIkOUWckuGW8IOLtUxwZ"
data-callback="YourOnSubmitFn">Submit</button>
<button type="submit" class="btn btn-success btn-block">Submit</button>
</div>
</div>
</form>

View File

@@ -2,35 +2,35 @@
<html>
<head>
<title>{{ page.title }}</title>
<link type="text/css" rel="stylesheet" href="{{ path.css }}/bootstrap-paper.css"/>
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/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 type="text/css" rel="stylesheet" href="{{ app.frontcss }}/main.css"/>
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/codeStyles/vs.css"/>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.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="{{ app.frontjs }}/highlight.pack.js"></script>
<script src="{{ app.frontjs }}/jquery-3.2.1.min.js"></script>
<script src="{{ app.frontjs }}/bootstrap.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script src="{{ path.js }}/functions.js"></script>
<script src="{{ app.frontjs }}/functions.js"></script>
</head>
<body>
{% include 'nav.twig' %}
{% include 'header.twig' %}
{% include app.fronthtml~'/nav.twig' %}
{% include app.fronthtml~'/header.twig' %}
{% block content %}{% endblock %}
{% include "footer.twig" %}
{% include app.fronthtml~"/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(){

View File

@@ -0,0 +1,56 @@
<!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>

View File

@@ -1,9 +1,9 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<div id="ajaxPut">
<div class="codebox">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
{% include "codebox.twig" %}
{% include app.fronthtml~"/codebox.twig" %}
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
@@ -25,7 +25,7 @@
<a href="?page=del&id={{ code.idc }}&lang={{ code.lang }}&version={{ code.version }}" class="btn btn-danger">Delete source</a>
{% endif %}#}
{% if page.otherV %}
<div style='text-align: center; font-size: 22px; '><a href='?page=code&id={{ code.idc }}&lang={{ code.lang }}'>View version's history</a></div>
<div style='text-align: center; font-size: 22px; '><a href='{{ path('codeVer',{'idc': code.idc,'lang': code.lang}) }}'>View version's history</a></div>
{% endif %}
{#<div id='QOZU_box'>Se necesita tener JavaScript habilitado para poder ver los comentarios de la web.</div>#}
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align:center;"><h3>Other implementations</h3>
@@ -36,12 +36,12 @@
<table>
<tr>
<th>
<a href="?page=code&id={{ code.idc }}&lang={{ i.lang }}&version={{ i.version }}">Link</a>
<a href="{{ path('code',{'idc': code.idc,'lang': i.lang,'version': i.version}) }}">{{i.lLang}}</a>
</th>
</tr>
<tr>
<td><strong>Lang: </strong>{{ i.lLang }}</td>
</tr>
{#<tr>
<td><strong>Version: </strong>{{ i.version }}</td>
</tr>#}
<tr>
<td>
<pre><code class='{{ i.lang }}'>{{ i.code }}</code></pre>
@@ -81,6 +81,14 @@
{% endfor %}
</select>
</div>
<div class="col_full" id="lib">
<label for="extlib">External Library:</label>
<input type="text" name="extlib" id="extlib" {% if code.extlib != "" %}value="{{ code.extlib }}"{% endif %} placeholder="Name of library">
</div>
<div class="col_full" id="libVer">
<label for="extlibver">Library version:</label>
<input type="text" name="extlibver" id="extlibver" {% if code.extlib != "" %}value="{{ code.extlibver }}" required="required" {% endif %} placeholder="Library version">
</div>
<div class="col_full">
<label for="code">Code:</label>
<textarea style="width: 100%" rows="{{ code.rows }}" required="required" name="code" id="code"></textarea>

View File

@@ -1,14 +1,14 @@
<table style="width: 100%; text-align:center">
<tr>
<th>
<a href="?page=code&id={{ code.idc }}&lang={{ code.lang }}&version={{ code.version }}">{{ code.name }}</a>
<a href="{{ path('code',{'idc': code.idc,'lang': code.lang,'version': code.version}) }}">{{ code.name }}</a>
</th>
</tr>
<tr>
<td><strong>Author:</strong>&nbsp{{ code.nick }} <strong> Version: </strong>{{ code.version }} <strong>
Lang: </strong>{{ code.lLang }}</td>
</tr>
{% if code.extlib is not null %}
{% if code.extlib is defined %}
<tr>
<td>
<strong>External library:</strong>&nbsp{{ code.extlib }}

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<div class="container justified" style="font-size: 12pt;">
<h4 style="text-align: center">Documentation</h4>
@@ -9,9 +9,9 @@
<h4 class="docheader top10" id="how">How can I submit my own solution?</h4>
<ol>
<li><p>First, you need to <strong>sign up</strong> in CodeShare <a href="?page=register">(link)</a>, and then go to <a href="?page=add">submit page</a> to start.</p>
<img src="{{ path.img }}/doc/submit.png" alt="submit"/></li>
<img src="{{ app.frontimg }}/doc/submit.png" alt="submit"/></li>
<li><p>Write the <strong>solution's name and description.</strong> Notice that in this input boxes you shouldn't type any reference of language they can be uploaded in multiple languages in the future, and there are a box for language.</p>
<img src="{{ path.img }}/doc/name_des.png"/></li>
<img src="{{ app.frontimg }}/doc/name_des.png"/></li>
<li><p>Now select <strong>language</strong> to help other users to find it easily.</p></li>
<li><p>If your solution use a <strong>external library</strong> you can add its name and its version in their own input boxes.</p></li>
<li><p>After that, introduce the <strong>Input</strong> and <strong>Output</strong> examples with the following criteria:</p></li>

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<div class='center'>
<h1>{{ error.number }} - {{ error.text }}

View File

@@ -7,7 +7,7 @@
{% endif %}
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="codebox">
{% include "codebox.twig" %}
{% include app.fronthtml~"/codebox.twig" %}
</div>
</div>
{% endfor %}

View File

@@ -1,8 +1,8 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<h5 style="text-align:center">Last codes</h5>
{% include "filter.twig" %}
{% include app.fronthtml~"/filter.twig" %}
<div id="ajaxPut">
{% include "firstCodes.twig" %}
{% include app.fronthtml~"/firstCodes.twig" %}
</div>
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<div class="container">
<div class="row">
@@ -11,7 +11,7 @@
{% if page.state == 1 %}
<p class="text-danger">Bad credentials</p>
{% elseif page.state == 2 %}
<p class="text-danger">Email already exits</p>
<p class="text-danger">Error during sign-up, check your data</p>
{% endif %}
</div>
</div>
@@ -73,16 +73,14 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="tos">You agree to our <a href="?page=tos">Terms of service</a></label>
<label class="control-label col-sm-3" for="tos">You agree to our <a href="{{path('tos')}}">Terms of service</a></label>
<div class="col-sm-9">
<input type="checkbox" required="required" name="tos" id="tos">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success g-recaptcha"
data-sitekey="6Lc7gXAUAAAAAJRaFo99vIkOUWckuGW8IOLtUxwZ"
data-callback="YourOnSubmitFn">Submit</button>
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
<div class="col-sm-offset-1 col-sm-12">
@@ -127,7 +125,7 @@
document.getElementById("emailre").onchange = checkEmail;
document.getElementById("emailre-re").onchange = checkEmail;
{% if page.page == "register" or page.state == 2 %}
{% if page.page == "sign-up" or page.state == 2 %}
nowRegister();
{% endif %}

View File

@@ -11,16 +11,16 @@
<div class="navbar-collapse collapse" id="nav" aria-expanded="false" style="height: 1px">
<ul class="nav navbar-nav navbar-left">
<li {% if page.page == "home" %}class="active"{% endif %}>
<a href="index.php">Home</a>
<a href="{{ path('home') }}">Home</a>
</li>
<li {% if page.page == "add" %}class="active"{% endif %}>
<a href="?page=add">Submit code</a>
</li>
<li {% if page.page == "doc" %}class="active"{% endif %}>
<a href="?page=doc">Documentation</a>
<a href="{{ path('doc') }}">Documentation</a>
</li>
<li {% if page.page == "about" %}class="active"{% endif %}>
<a href="?page=about">About</a>
<a href="{{ path('about') }}">About</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
@@ -34,17 +34,17 @@
</li>
{% if user.nick is defined %}
<li {% if page.page == "user" %}class="active"{% endif %}>
<a href="?page=user">{{ user.nick }}</a>
<a href="{{path('user')}}">{{ user.nick }}</a>
</li>
<li>
<a href="?page=logout">Log out</a>
<a href="{{ path('logout')}}">Log out</a>
</li>
{% else %}
<li {% if page.page == "login" %}class="active"{% endif %}>
<a href="?page=login">Log in</a>
<a href="{{ path('login') }}">Log in</a>
</li>
<li {% if page.page == "register" %}class="active"{% endif %}>
<a href="?page=register">Register</a>
<a href="{{ path('register') }}">Register</a>
</li>
{% endif %}
</ul>

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
{% include "firstCodes.twig" %}
{% include app.fronthtml~"/firstCodes.twig" %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "base.twig" %}
{% extends app.fronthtml~"/base.twig" %}
{% block content %}
<h4 style="text-align: center" xmlns="http://www.w3.org/1999/html">{{ user.nick }}</h4>
<div class="container">

View File

@@ -1,6 +1,9 @@
{
"require": {
"twig/twig": "^2.0",
"jkanetwork/dbwrapper": "^1.4"
"jkanetwork/dbwrapper": "^1.4",
"symfony/flex": "^1.1",
"symfony/twig-bridge": "^4.1",
"silex/silex": "^2.3"
}
}

711
Source/composer.lock generated
View File

@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c34d26c2711c26f871ff9ca8a4401104",
"content-hash": "80eef0db968dff798db6ae8ac2157e65",
"packages": [
{
"name": "jkanetwork/dbwrapper",
@@ -48,6 +48,546 @@
],
"time": "2018-05-16T15:47:31+00:00"
},
{
"name": "pimple/pimple",
"version": "v3.2.3",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Pimple.git",
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/container": "^1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2.x-dev"
}
},
"autoload": {
"psr-0": {
"Pimple": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Pimple, a simple Dependency Injection Container",
"homepage": "http://pimple.sensiolabs.org",
"keywords": [
"container",
"dependency injection"
],
"time": "2018-01-21T07:42:36+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
},
{
"name": "psr/log",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2016-10-10T12:19:37+00:00"
},
{
"name": "silex/silex",
"version": "v2.3.0",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Silex.git",
"reference": "6bc31c1b8c4ef614a7115320fd2d3b958032f131"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Silex/zipball/6bc31c1b8c4ef614a7115320fd2d3b958032f131",
"reference": "6bc31c1b8c4ef614a7115320fd2d3b958032f131",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"pimple/pimple": "^3.0",
"symfony/event-dispatcher": "^4.0",
"symfony/http-foundation": "^4.0",
"symfony/http-kernel": "^4.0",
"symfony/routing": "^4.0"
},
"replace": {
"silex/api": "self.version",
"silex/providers": "self.version"
},
"require-dev": {
"doctrine/dbal": "^2.2",
"monolog/monolog": "^1.4.1",
"swiftmailer/swiftmailer": "^5",
"symfony/asset": "^4.0",
"symfony/browser-kit": "^4.0",
"symfony/config": "^4.0",
"symfony/css-selector": "^4.0",
"symfony/debug": "^4.0",
"symfony/doctrine-bridge": "^4.0",
"symfony/dom-crawler": "^4.0",
"symfony/expression-language": "^4.0",
"symfony/finder": "^4.0",
"symfony/form": "^4.0",
"symfony/intl": "^4.0",
"symfony/monolog-bridge": "^4.0",
"symfony/options-resolver": "^4.0",
"symfony/phpunit-bridge": "^3.2",
"symfony/process": "^4.0",
"symfony/security": "^4.0",
"symfony/serializer": "^4.0",
"symfony/translation": "^4.0",
"symfony/twig-bridge": "^4.0",
"symfony/validator": "^4.0",
"symfony/var-dumper": "^4.0",
"symfony/web-link": "^4.0",
"twig/twig": "^2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"autoload": {
"psr-4": {
"Silex\\": "src/Silex"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
}
],
"description": "The PHP micro-framework based on the Symfony Components",
"homepage": "http://silex.sensiolabs.org",
"keywords": [
"microframework"
],
"abandoned": "symfony/flex",
"time": "2018-04-20T05:17:01+00:00"
},
{
"name": "symfony/debug",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "47ead688f1f2877f3f14219670f52e4722ee7052"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/47ead688f1f2877f3f14219670f52e4722ee7052",
"reference": "47ead688f1f2877f3f14219670f52e4722ee7052",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/log": "~1.0"
},
"conflict": {
"symfony/http-kernel": "<3.4"
},
"require-dev": {
"symfony/http-kernel": "~3.4|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2018-08-03T11:13:38+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
"reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"conflict": {
"symfony/dependency-injection": "<3.4"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/stopwatch": "~3.4|~4.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2018-07-26T09:10:45+00:00"
},
{
"name": "symfony/flex",
"version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/flex.git",
"reference": "9fb60f232af0764d58002e7872acb43a74506d25"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/flex/zipball/9fb60f232af0764d58002e7872acb43a74506d25",
"reference": "9fb60f232af0764d58002e7872acb43a74506d25",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0",
"php": "^7.0"
},
"require-dev": {
"composer/composer": "^1.0.2",
"symfony/phpunit-bridge": "^3.2.8"
},
"type": "composer-plugin",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
},
"class": "Symfony\\Flex\\Flex"
},
"autoload": {
"psr-4": {
"Symfony\\Flex\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien.potencier@gmail.com"
}
],
"description": "Composer plugin for Symfony",
"time": "2018-09-03T08:17:12+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "3a5c91e133b220bb882b3cd773ba91bf39989345"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a5c91e133b220bb882b3cd773ba91bf39989345",
"reference": "3a5c91e133b220bb882b3cd773ba91bf39989345",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-mbstring": "~1.1"
},
"require-dev": {
"predis/predis": "~1.0",
"symfony/expression-language": "~3.4|~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpFoundation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2018-08-27T17:47:02+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "33de0a1ff2e1720096189e3ced682d7a4e8f5e35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/33de0a1ff2e1720096189e3ced682d7a4e8f5e35",
"reference": "33de0a1ff2e1720096189e3ced682d7a4e8f5e35",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/log": "~1.0",
"symfony/debug": "~3.4|~4.0",
"symfony/event-dispatcher": "~4.1",
"symfony/http-foundation": "^4.1.1",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/config": "<3.4",
"symfony/dependency-injection": "<4.1",
"symfony/var-dumper": "<4.1.1",
"twig/twig": "<1.34|<2.4,>=2"
},
"provide": {
"psr/log-implementation": "1.0"
},
"require-dev": {
"psr/cache": "~1.0",
"symfony/browser-kit": "~3.4|~4.0",
"symfony/config": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/css-selector": "~3.4|~4.0",
"symfony/dependency-injection": "^4.1",
"symfony/dom-crawler": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/finder": "~3.4|~4.0",
"symfony/process": "~3.4|~4.0",
"symfony/routing": "~3.4|~4.0",
"symfony/stopwatch": "~3.4|~4.0",
"symfony/templating": "~3.4|~4.0",
"symfony/translation": "~3.4|~4.0",
"symfony/var-dumper": "^4.1.1"
},
"suggest": {
"symfony/browser-kit": "",
"symfony/config": "",
"symfony/console": "",
"symfony/dependency-injection": "",
"symfony/var-dumper": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpKernel\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2018-08-28T06:17:42+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
@@ -165,6 +705,173 @@
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/routing",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "a5784c2ec4168018c87b38f0e4f39d2278499f51"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/a5784c2ec4168018c87b38f0e4f39d2278499f51",
"reference": "a5784c2ec4168018c87b38f0e4f39d2278499f51",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"conflict": {
"symfony/config": "<3.4",
"symfony/dependency-injection": "<3.4",
"symfony/yaml": "<3.4"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/http-foundation": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"doctrine/annotations": "For using the annotation loader",
"symfony/config": "For using the all-in-one router or any loader",
"symfony/dependency-injection": "For loading routes from a service",
"symfony/expression-language": "For using expression matching",
"symfony/http-foundation": "For using a Symfony Request object",
"symfony/yaml": "For using the YAML loader"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Routing\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Routing Component",
"homepage": "https://symfony.com",
"keywords": [
"router",
"routing",
"uri",
"url"
],
"time": "2018-08-03T07:58:40+00:00"
},
{
"name": "symfony/twig-bridge",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bridge.git",
"reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
"reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"twig/twig": "^1.35|^2.4.4"
},
"conflict": {
"symfony/console": "<3.4",
"symfony/form": "<4.1.2"
},
"require-dev": {
"symfony/asset": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/finder": "~3.4|~4.0",
"symfony/form": "^4.1.2",
"symfony/http-foundation": "~3.4|~4.0",
"symfony/http-kernel": "~3.4|~4.0",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/routing": "~3.4|~4.0",
"symfony/security": "~3.4|~4.0",
"symfony/security-acl": "~2.8|~3.0",
"symfony/stopwatch": "~3.4|~4.0",
"symfony/templating": "~3.4|~4.0",
"symfony/translation": "~3.4|~4.0",
"symfony/var-dumper": "~3.4|~4.0",
"symfony/web-link": "~3.4|~4.0",
"symfony/workflow": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"symfony/asset": "For using the AssetExtension",
"symfony/expression-language": "For using the ExpressionExtension",
"symfony/finder": "",
"symfony/form": "For using the FormExtension",
"symfony/http-kernel": "For using the HttpKernelExtension",
"symfony/routing": "For using the RoutingExtension",
"symfony/security": "For using the SecurityExtension",
"symfony/stopwatch": "For using the StopwatchExtension",
"symfony/templating": "For using the TwigEngine",
"symfony/translation": "For using the TranslationExtension",
"symfony/var-dumper": "For using the DumpExtension",
"symfony/web-link": "For using the WebLinkExtension",
"symfony/yaml": "For using the YamlExtension"
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bridge\\Twig\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Twig Bridge",
"homepage": "https://symfony.com",
"time": "2018-08-14T15:48:59+00:00"
},
{
"name": "twig/twig",
"version": "v2.5.0",

View File

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: true

View File

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: ~

View File

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: true

View File

@@ -0,0 +1,3 @@
#index:
# path: /
# controller: App\Controller\DefaultController::index

View File

@@ -1,8 +1,10 @@
<?php
$filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
if (php_sapi_name() === 'cli-server' && is_file($filename)) {
return false;
}
require_once __DIR__ . '/src/app.php';
run();
$app->run();

View File

@@ -16,7 +16,7 @@ class Config
*/
public static function init(){
if(!Config::initialized()) {
$file = file_get_contents("data/project.json");
$file = file_get_contents(__DIR__."/../data/project.json");
Config::$config = json_decode($file, true);
Config::$in=true;
}

View File

@@ -132,7 +132,8 @@ class DB
*/
public function loadDiff($id, $lang)
{
$query = "SELECT Lang,Code,Version FROM Sources NATURAL JOIN Codes WHERE IDC='$id' AND Lang<>'$lang' AND Version = (SELECT MAX(Version) FROM Sources NATURAL JOIN Codes WHERE IDC='$id' AND Lang<>'$lang')";
$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;
}
@@ -286,6 +287,7 @@ class DB
$version++;
$modification = time();
$query = "INSERT INTO Sources (`IDC`,`Lang`,`Version`,`Modification`,`Code`,`UseExtLib`,`UseExtLibVer`,`IDU`) VALUES ('$IDC','$lang',$version,$modification,'$code','$lib','$libV','$IDU')";
//echo $query . ';';
dbw_query($this->conn, $query);
@@ -324,8 +326,8 @@ class DB
$arr = $this->loadAll($IDC, $lang, $this->getLastVersion($IDC, $lang));
$codewrite = $arr["Code"];
$version = 0;
if ($code != $codewrite) {
$version = $this->addSource($IDC, $lang, $_code, $IDU, $extlib, $extlibver);
if ($_code != dbw_escape_string($this->conn,$codewrite)) {
$version = $this->addSource($IDC, $lang, $_code, $IDU, $extlib, $extlibver,$codewrite);
} else if ($extlib != $arr["UseExtLib"] || $extlibver != $arr["UseExtLibVer"]) {
$query = "UPDATE Sources SET `UseExtLib`='$extlib', `UseExtLibVer`='$extlibver' WHERE IDC=$IDC AND Lang='$arr[Lang]' AND Version=$arr[Version]";
@@ -458,7 +460,7 @@ class DB
*/
public function updatePass($idu, $pass)
{
$query = "UPDATE Users SET password='" . hash('sha256', $pass) . "' WHERE IDU='$idu'";
$query = "UPDATE Users SET pass='" . hash('sha256', $pass) . "' WHERE IDU='$idu'";
dbw_query($this->conn, $query);
}
}

View File

@@ -4,7 +4,7 @@ if(isset($_COOKIE['cookieconsent_status'])) {
}
require_once __DIR__ .'/../vendor/autoload.php';
//require_once __DIR__ . '/dbwrapper.php';
require_once __DIR__ . '/Config.php';
require 'functions.php';
require 'DB.php';
@@ -12,90 +12,257 @@ require 'dbToTable.php';
require 'users.php';
$path = array(
"html" => "assets/html/",
"css" => "assets/css/",
"js" => "assets/js/",
"img" => "assets/img/",
);
$app = new Silex\Application();
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$app['debug'] = true;
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/../',
));
$app['url'] = '/';
$app['front'] = $app['url'] . 'assets';
$valores = array('js', 'img', 'css', 'fonts', 'html');
foreach($valores as $asset){
$app['front'.$asset] = $app['front'].'/'.$asset;
}
$string = file_get_contents(__DIR__."/../data/supported.json");
$supported = json_decode($string, true);
$loader = new Twig_Loader_Filesystem($path['html']);
$twig = new Twig_Environment($loader);
$user = array();
$db=null;
$app["supported"] = json_decode($string, true);
$app['db']=null;
function connectDB(){
global $app;
try {
$db = new DB();
$app['db'] = new DB();
}catch (Exception $ex){
sendHTTPError(503);
exit();
$app->abort('503','ERROR en la Base de Datos');
}
}
function run(){
global $user;
if(isset($_SESSION['sessionID'])){
global $db;
if($db->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
$user = $db->loadProfile($_SESSION['sessionID']);
/* Security */
$app['security.role_hierarchy'] = array(
'ROLE_DELETE' => array('ROLE_COMMON'),
'ROLE_COMMON' => array('ROLE_USER'),
);
/* End Security */
$app->boot();
/* Basics */
$app->get('/', function (Request $request) use($app) {
connectDB();
$user = getUser($app);
$query = $app['db']->loadLast();
$last = lastToArray($app["db"],$query,$app['supported']);
return $app['twig']->render($app['fronthtml'] . '/firstpage.twig' ,array(
'page' => array('title' => "CodeShare",
"description" => "Sharing your solutions with all",
"last" => $last,
"supported" => $app["supported"],
"page" => "home",
"grouped" => groupByCategory($app["supported"])),
'user' => $user
));
})->bind('home');
$app->get('/doc', function (Request $request) use($app){
connectDB();
$user = getUser($app);
$page = array(
"title" => "Documentation",
"description" => "All documentation about how to upload code in CodeShare",
"page" => "doc",
);
return $app['twig']->render($app['fronthtml'].'/doc.twig', array("page" => $page, "user" => $user));
})->bind('doc');
$app->get('/about', function (Request $request) use($app){
connectDB();
$user = getUser($app);
$page = array(
"title" => "About CodeShare",
"description" => "Developed by JKA Network's Team",
"page" => "about",
);
return $app['twig']->render($app['fronthtml'].'/about.twig', array("page" => $page,'user'=>$user));
})->bind('about');
/* 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);
if(!$array){
$app->abort('404');
}
$page = array(
"page" => 'code',
"title" => "$array[Name] by $array[nick]",
"description" => "$array[Name] by $array[nick] in ".$app['supported'][$lang][0],
"otherV" => false,
"otherI" => false,
"existedLangs" => $app['db']->loadLangs($idc),
"original" => $app['db']->loadOriginalAuthor($idc),
);
$code = allCodeToArray($array,$app['supported']);
if($array['Version']!=1)
$page['otherV'] = true;
$diff = $app['db']->loadDiff($idc,$lang);
if(dbw_fetch_array($app['db']->conn,$diff)){
$page['otherI'] = true;
}
dbw_query_goto($app['db']->conn,$diff);
$otherImplementation = otherImplementationToArray($app['db'],$diff,$app['supported']);
return $app['twig']->render($app['fronthtml'].'/code.twig', array(
"page" => $page,
"code" => $code,
"otherImplementation" => $otherImplementation,
"supported" => $app['supported'],
"user" => $user
));
})->bind('code');
$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']);
$name = $other[0]['name'];
$page = array(
"title" => "Other versions of $name",
"description" => "All differents version of $name uploaded in CodeShare",
"last" => $other,
"page" => ""
);
return $app['twig']->render($app['fronthtml'].'/otherVersion.twig', array(
"page" => $page, "user" => $user
));
})->bind('codeVer');
/* User */
$app->get('/tos',function(Request $request) use($app){
connectDB();
$user = getUser($app);
$page = array(
"title" => "Terms of service",
"description" => "Terms of services and privacy policies",
"page" => ""
);
return $app['twig']->render($app['fronthtml'].'/TOS.twig', array("page" => $page, "user" => $user));
})->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'));
}
if ($request->getMethod() == 'GET'){
return loginRegister('login');
}
else{
$state = checkInfo($request);
return loginOrRegister($state,$request);
}
})->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'));
}
if ($request->getMethod() == 'GET'){
return loginRegister('sign-up');
}else{
$state = checkInfo($request);
return loginOrRegister($state,$request);
}
})->bind('register')->method('GET|POST');
function loginRegister($default,$state=0){
global $app;
$page = array(
"title" => ucfirst($default),
"description" => "Start now in CodeShare",
"page" => "$default",
"state" => $state, //0=no logged, 1 login fail, 2 register fail, 3 all correct (render home)
);
return $app['twig']->render($app['fronthtml']."/loginregister.twig", array("page" => $page));
}
function loginOrRegister($state,$request){
global $app;
switch ($state){
case 3:
return loginRegister('login',1);
case 1:
if(checklogin($request->get('email'),$request->get('pwd'))){
return $app->redirect($app["url_generator"]->generate('home'));
}else{
return loginRegister("login",1);
}
case 2:
if(register($request->get('emailre'),$request->get('emailre-re'),
$request->get('pwdre'), $request->get('pwdre-re'),$request->get('nick'))){
return $app->redirect($app["url_generator"]->generate('home'));
}else{
return loginRegister("sing-up",2);
}
}
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":
$app->get('logout',function(Request $request) use ($app){
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();
}
}
return $app->redirect($app['url_generator']->generate('home'));
})->bind('logout');
function sendHTTPError($code){
global $twig, $path,$user;
$page = array("title" => $code."");
$app->get('/user', function(Request $request) use ($app){
connectDB();
$user = getUser($app);
if($user == null)
$app->abort('403');
header($code."");
$status = 0;
if($request->getMethod() == 'POST'){
$passact = $request->get("passact");
$newpass = $request->get("newpass");
$newpassre = $request->get("newpass-re");
if($app['db']->checkPass($user['email'],$passact) && $newpass == $newpassre){
$status=1;
$app['db']->updatePass($user['IDU'],$newpass);
}else
$status=2;
$app['db']->close();
}
$page = array(
"page" => "user",
"title" => "$user[nick]",
"description" => "NOT RELEVANT",
"status" => $status
);
return $app['twig']->render($app['fronthtml']."/user.twig",array("page"=>$page,"user"=>$user));
})->bind('user')->method('GET|POST');
/* Error Codes */
function HTTPError($code){
switch($code){
case 401:
$text = "Unauthorized user";
@@ -117,269 +284,28 @@ function sendHTTPError($code){
$code = "Internal error";
break;
}
$error = array("number" => $code."","text"=>$text);
echo $twig->render('error.twig',array("page" => $page, "path" => $path, "user" => $user,"error" => $error));
return array("text"=>$text,"number"=>$code);
}
/**
* 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();
$app->error(function (\Exception $e,$request, $code) use ($app) {
$user = null;
try{
$user = getUser($app);
}catch(Throwable $ex){
//Nothing
}
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'])){
$db->addSource($_GET['id'],$_POST['lang'],htmlentities($_POST['code']),$user["IDU"]);
$db->close();
header("Location: ?page=code&id=$_GET[id]&lang=$_POST[lang]&version=1");
}else if(isset($_POST['name'])){
$extlib = isset($_POST['extlib']) ? $_POST['extlib'] : null;
$extlibver = isset($_POST['extlibver']) ? $_POST['extlibver'] : null;
$version=$db->addOrModifyCodes(
$_GET['id'],
$_POST['name'],
$_POST['description'],
htmlentities($_POST['input']),
htmlentities($_POST['output']),
$_GET['lang'],
htmlentities($_POST['code']),
$user['IDU'],
$extlib,
$extlibver);
//die();
$db->close();
if($version!=0){
header("Location: ?page=code&id=$_GET[id]&lang=$_GET[lang]&version=$version");
if ($app['debug']) {
return;
}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,
$error = HTTPError($code);
return $app['twig']->render($app['fronthtml'].'/error.twig', Array(
'page' => array("title"=>$code),
'error' => $error,
'user' => $user,
));
}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), 4 captcha failed
);
$response = checkCaptcha($_POST['g-recaptcha-response']);
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($response)
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"];
//echo "EEEEEOOO";
global $db;
if($db->checkPass($user['email'],$passact)){
$status=1;
$db->updatePass($user['IDU'],$newpass);
}else
$status=2;
$db->close();
}
$page = array(
"title" => "$user[nick]",
"description" => "NOT RELEVANT",
"status" => $status
);
echo $twig->render("user.twig",array("page"=>$page,"path"=>$path, "user"=>$user));
}else{
sendHTTPError(403);
}
}
/*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);
}
}*/

382
Source/src/appOld.php Normal file
View File

@@ -0,0 +1,382 @@
<?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);
}
}*/

View File

@@ -11,7 +11,7 @@
* Methods to get an array to send to twig
*/
function lastToArray($db,&$query,&$supported){
function lastToArray($db,&$query,$supported){
$last = array();
while($var = dbw_fetch_array($db->conn,$query)){
$array = array
@@ -29,7 +29,7 @@ function lastToArray($db,&$query,&$supported){
return $last;
}
function allCodeToArray(&$query,&$supported){
function allCodeToArray(&$query,$supported){
$code = array(
"idc" => $query['IDC'],
"lang" => $query['Lang'],
@@ -50,7 +50,7 @@ function allCodeToArray(&$query,&$supported){
}
function otherImplementationToArray($db,&$query,&$supported){
function otherImplementationToArray($db,&$query,$supported){
$other = array();
while($var = dbw_fetch_array($db->conn,$query)){
$array = array
@@ -64,6 +64,6 @@ function otherImplementationToArray($db,&$query,&$supported){
return $other;
}
function otherVersionToArray($db,&$query,&$supported){
function otherVersionToArray($db,$query,$supported){
return lastToArray($db,$query,$supported);
}

View File

@@ -54,7 +54,7 @@ function ksonParse($path){
/**
* Group by $supported
*/
function groupByCategory(&$supported){
function groupByCategory($supported){
$grouped = Array();
foreach($supported as $key => $val){
if(!array_key_exists($val[1],$grouped)){

View File

@@ -6,6 +6,17 @@
* Time: 19:06
*/
function checkInfo($request){
$email = $request->get('email');
$emailre = $request->get('emailre');
if ($email != null)
return 1;
else if ($emailre != null)
return 2;
else
return 3;
}
/**
* Check if login is correct
*
@@ -37,8 +48,10 @@ function checklogin($email,$pass){
* @param $nick new user's nickname
* @return bool true if email never exists before, else false
*/
function register($email,$pass,$nick){
function register($email,$emailre,$pass,$passre,$nick){
$db = new DB();
if($emailre != $email || $pass != $passre)
return false;
$bool = $db->register($email,$pass,$nick);
if($bool) {
$db->close();
@@ -56,3 +69,13 @@ function register($email,$pass,$nick){
function logout(){
session_destroy(); //Logout
}
function getUser($app){
$user=null;
if(isset($_SESSION['sessionID'])){
if($app['db']->checkCookie($_SESSION['sessionID'],$_SESSION['token'])){
$user = $app['db']->loadProfile($_SESSION['sessionID']);
}
}
return $user;
}

8
composer.json Normal file
View File

@@ -0,0 +1,8 @@
{
"require": {
"silex/silex": "~1.3",
"twig/twig": "~1.23",
"symfony/twig-bridge": "^4.1",
"jkanetwork/dbwrapper": "^1.5"
}
}

990
composer.lock generated Normal file
View File

@@ -0,0 +1,990 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2f1e425874f2052e4cdae6c9b1fe7800",
"packages": [
{
"name": "ircmaxell/password-compat",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/ircmaxell/password_compat.git",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"autoload": {
"files": [
"lib/password.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthony Ferrara",
"email": "ircmaxell@php.net",
"homepage": "http://blog.ircmaxell.com"
}
],
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
"homepage": "https://github.com/ircmaxell/password_compat",
"keywords": [
"hashing",
"password"
],
"time": "2014-11-20T16:49:30+00:00"
},
{
"name": "jkanetwork/dbwrapper",
"version": "1.5.1",
"source": {
"type": "git",
"url": "https://gitlab.com/CodeSolutionsProject/DBWrapper.git",
"reference": "1bc58622f2f520286f5de7058fc5b9a97921003b"
},
"dist": {
"type": "zip",
"url": "https://gitlab.com/api/v4/projects/CodeSolutionsProject%2FDBWrapper/repository/archive.zip?sha=1bc58622f2f520286f5de7058fc5b9a97921003b",
"reference": "1bc58622f2f520286f5de7058fc5b9a97921003b",
"shasum": ""
},
"require": {
"php": "^7.0"
},
"type": "library",
"autoload": {
"files": [
"src/dbwrapper.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Kevin Puertas Ruiz",
"email": "kevin01010@gmail.com"
}
],
"description": "MySQL, PgSQL and SQLite wrapper",
"keywords": [
"mysql",
"pgsql",
"sqlite",
"wrapper"
],
"time": "2018-05-16T15:47:31+00:00"
},
{
"name": "pimple/pimple",
"version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Pimple.git",
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Pimple": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
"homepage": "http://pimple.sensiolabs.org",
"keywords": [
"container",
"dependency injection"
],
"time": "2013-11-22T08:30:29+00:00"
},
{
"name": "psr/log",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2016-10-10T12:19:37+00:00"
},
{
"name": "silex/silex",
"version": "v1.3.6",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Silex.git",
"reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Silex/zipball/ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136",
"reference": "ff8aa6bc2e066e14b07e0c63e9bd9dd1458af136",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"pimple/pimple": "~1.0",
"symfony/event-dispatcher": "~2.3|3.0.*",
"symfony/http-foundation": "~2.3|3.0.*",
"symfony/http-kernel": "~2.3|3.0.*",
"symfony/routing": "~2.3|3.0.*"
},
"require-dev": {
"doctrine/dbal": "~2.2",
"monolog/monolog": "^1.4.1",
"swiftmailer/swiftmailer": "~5",
"symfony/browser-kit": "~2.3|3.0.*",
"symfony/config": "~2.3|3.0.*",
"symfony/css-selector": "~2.3|3.0.*",
"symfony/debug": "~2.3|3.0.*",
"symfony/dom-crawler": "~2.3|3.0.*",
"symfony/finder": "~2.3|3.0.*",
"symfony/form": "~2.3|3.0.*",
"symfony/intl": "~2.3|3.0.*",
"symfony/monolog-bridge": "~2.3|3.0.*",
"symfony/options-resolver": "~2.3|3.0.*",
"symfony/phpunit-bridge": "~2.7",
"symfony/process": "~2.3|3.0.*",
"symfony/security": "~2.3|3.0.*",
"symfony/serializer": "~2.3|3.0.*",
"symfony/translation": "~2.3|3.0.*",
"symfony/twig-bridge": "~2.3|3.0.*",
"symfony/validator": "~2.3|3.0.*",
"twig/twig": "~1.28|~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-4": {
"Silex\\": "src/Silex"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
}
],
"description": "The PHP micro-framework based on the Symfony Components",
"homepage": "http://silex.sensiolabs.org",
"keywords": [
"microframework"
],
"abandoned": "symfony/flex",
"time": "2017-04-30T16:26:54+00:00"
},
{
"name": "symfony/debug",
"version": "v2.8.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "cbb8a5f212148964efbc414838c527229f9951b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/cbb8a5f212148964efbc414838c527229f9951b7",
"reference": "cbb8a5f212148964efbc414838c527229f9951b7",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"psr/log": "~1.0"
},
"conflict": {
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
"symfony/class-loader": "~2.2|~3.0.0",
"symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Debug\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2018-08-03T09:45:57+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.8.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "84ae343f39947aa084426ed1138bb96bf94d1f12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/84ae343f39947aa084426ed1138bb96bf94d1f12",
"reference": "84ae343f39947aa084426ed1138bb96bf94d1f12",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "^2.0.5|~3.0.0",
"symfony/dependency-injection": "~2.6|~3.0.0",
"symfony/expression-language": "~2.6|~3.0.0",
"symfony/stopwatch": "~2.3|~3.0.0"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2018-07-26T09:03:18+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v2.8.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "dc02e684171d0696edb6d4266e9d93af5e3f44d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/dc02e684171d0696edb6d4266e9d93af5e3f44d3",
"reference": "dc02e684171d0696edb6d4266e9d93af5e3f44d3",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/polyfill-mbstring": "~1.1",
"symfony/polyfill-php54": "~1.0",
"symfony/polyfill-php55": "~1.0"
},
"require-dev": {
"symfony/expression-language": "~2.4|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpFoundation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2018-08-27T15:52:41+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v2.8.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "5424d38f10dc62752e655740224681a478d9f5bb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/5424d38f10dc62752e655740224681a478d9f5bb",
"reference": "5424d38f10dc62752e655740224681a478d9f5bb",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"psr/log": "~1.0",
"symfony/debug": "^2.6.2",
"symfony/event-dispatcher": "^2.6.7|~3.0.0",
"symfony/http-foundation": "~2.7.36|~2.8.29|~3.1.6",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/config": "<2.7",
"twig/twig": "<1.34|<2.4,>=2"
},
"require-dev": {
"symfony/browser-kit": "~2.3|~3.0.0",
"symfony/class-loader": "~2.1|~3.0.0",
"symfony/config": "~2.8",
"symfony/console": "~2.3|~3.0.0",
"symfony/css-selector": "^2.0.5|~3.0.0",
"symfony/dependency-injection": "~2.8|~3.0.0",
"symfony/dom-crawler": "^2.0.5|~3.0.0",
"symfony/expression-language": "~2.4|~3.0.0",
"symfony/finder": "^2.0.5|~3.0.0",
"symfony/process": "^2.0.5|~3.0.0",
"symfony/routing": "~2.8|~3.0.0",
"symfony/stopwatch": "~2.3|~3.0.0",
"symfony/templating": "~2.2|~3.0.0",
"symfony/translation": "^2.0.5|~3.0.0",
"symfony/var-dumper": "~2.6|~3.0.0"
},
"suggest": {
"symfony/browser-kit": "",
"symfony/class-loader": "",
"symfony/config": "",
"symfony/console": "",
"symfony/dependency-injection": "",
"symfony/finder": "",
"symfony/var-dumper": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpKernel\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2018-08-27T17:33:38+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/polyfill-php54",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php54.git",
"reference": "412977e090c6a8472dc39d50d1beb7d59495a965"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/412977e090c6a8472dc39d50d1beb7d59495a965",
"reference": "412977e090c6a8472dc39d50d1beb7d59495a965",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php54\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/polyfill-php55",
"version": "v1.9.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php55.git",
"reference": "578b8528da843de0fc65ec395900fa3181f2ead7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/578b8528da843de0fc65ec395900fa3181f2ead7",
"reference": "578b8528da843de0fc65ec395900fa3181f2ead7",
"shasum": ""
},
"require": {
"ircmaxell/password-compat": "~1.0",
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php55\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"time": "2018-08-06T14:22:27+00:00"
},
{
"name": "symfony/routing",
"version": "v2.8.45",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "e26f791e8669603e9dc0a601e75a50f914eaa144"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/e26f791e8669603e9dc0a601e75a50f914eaa144",
"reference": "e26f791e8669603e9dc0a601e75a50f914eaa144",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"conflict": {
"symfony/config": "<2.7"
},
"require-dev": {
"doctrine/annotations": "~1.0",
"psr/log": "~1.0",
"symfony/config": "~2.7|~3.0.0",
"symfony/expression-language": "~2.4|~3.0.0",
"symfony/http-foundation": "~2.3|~3.0.0",
"symfony/yaml": "^2.0.5|~3.0.0"
},
"suggest": {
"doctrine/annotations": "For using the annotation loader",
"symfony/config": "For using the all-in-one router or any loader",
"symfony/dependency-injection": "For loading routes from a service",
"symfony/expression-language": "For using expression matching",
"symfony/http-foundation": "For using a Symfony Request object",
"symfony/yaml": "For using the YAML loader"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Routing\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Routing Component",
"homepage": "https://symfony.com",
"keywords": [
"router",
"routing",
"uri",
"url"
],
"time": "2018-07-26T11:13:39+00:00"
},
{
"name": "symfony/twig-bridge",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bridge.git",
"reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
"reference": "550cd9cd3a106a3426bdb2bd9d2914a4937656d1",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"twig/twig": "^1.35|^2.4.4"
},
"conflict": {
"symfony/console": "<3.4",
"symfony/form": "<4.1.2"
},
"require-dev": {
"symfony/asset": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/finder": "~3.4|~4.0",
"symfony/form": "^4.1.2",
"symfony/http-foundation": "~3.4|~4.0",
"symfony/http-kernel": "~3.4|~4.0",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/routing": "~3.4|~4.0",
"symfony/security": "~3.4|~4.0",
"symfony/security-acl": "~2.8|~3.0",
"symfony/stopwatch": "~3.4|~4.0",
"symfony/templating": "~3.4|~4.0",
"symfony/translation": "~3.4|~4.0",
"symfony/var-dumper": "~3.4|~4.0",
"symfony/web-link": "~3.4|~4.0",
"symfony/workflow": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
"suggest": {
"symfony/asset": "For using the AssetExtension",
"symfony/expression-language": "For using the ExpressionExtension",
"symfony/finder": "",
"symfony/form": "For using the FormExtension",
"symfony/http-kernel": "For using the HttpKernelExtension",
"symfony/routing": "For using the RoutingExtension",
"symfony/security": "For using the SecurityExtension",
"symfony/stopwatch": "For using the StopwatchExtension",
"symfony/templating": "For using the TwigEngine",
"symfony/translation": "For using the TranslationExtension",
"symfony/var-dumper": "For using the DumpExtension",
"symfony/web-link": "For using the WebLinkExtension",
"symfony/yaml": "For using the YamlExtension"
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bridge\\Twig\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Twig Bridge",
"homepage": "https://symfony.com",
"time": "2018-08-14T15:48:59+00:00"
},
{
"name": "twig/twig",
"version": "v1.35.4",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
"reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "^2.7",
"symfony/phpunit-bridge": "^3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.35-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
},
{
"name": "Twig Team",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"time": "2018-07-13T07:12:17+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}