Modifica la estructura del proyecto usando composer y slim framework -- INCOMPLETO, ya se caqueó en el primer POST

This commit is contained in:
German Correa 2017-12-06 20:43:53 -03:00
parent 98baf9acc6
commit 6cb63e6938
1404 changed files with 2824 additions and 184 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
2021y22.csv
*.bak
bkp/*
/vendor/
/logs/*
!/logs/README.md

View File

@ -1,10 +0,0 @@
RewriteEngine On
#example.com/page will display the contents of example.com/page.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
#301 from example.com/page.html to example.com/page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.php\ HTTP/
RewriteRule ^(.*)\.php$ /$1 [R=301,L]

14
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,14 @@
# How to Contribute
## Pull Requests
1. Fork the Slim Skeleton repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch to the **3.x** branch
It is very important to separate new features or improvements into separate feature branches, and to send a
pull request for each branch. This allows us to review and pull in new features or improvements individually.
## Style Guide
All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# Slim Framework 3 Skeleton Application
Use this skeleton application to quickly setup and start working on a new Slim Framework 3 application. This application uses the latest Slim 3 with the PHP-View template renderer. It also uses the Monolog logger.
This skeleton application was built for Composer. This makes setting up a new Slim Framework application quick and easy.
## Install the Application
Run this command from the directory in which you want to install your new Slim Framework application.
php composer.phar create-project slim/slim-skeleton [my-app-name]
Replace `[my-app-name]` with the desired directory name for your new application. You'll want to:
* Point your virtual host document root to your new application's `public/` directory.
* Ensure `logs/` is web writeable.
To run the application in development, you can also run this command.
php composer.phar start
Run this command to run the test suite
php composer.phar test
That's it! Now go build something cool.

View File

@ -1,30 +0,0 @@
<?php include_once 'header.php'; ?>
<div class="row">
<div id="content" class="col-xs-12 col-sm-8">
<div class="row">
<div class="col-xs-12">
<h1><strong>Committees</strong></h1>
<h2>Scientific Committee</h2>
<ul class="comite">
<li><a href="http://www.math.lsa.umich.edu/~canary/" data-linktype="external" data-val="http://www.math.lsa.umich.edu/~canary/">Dick Canary - University of Michigan</a></li>
<li><a href="https://www.math.u-psud.fr/~crovisie/" data-linktype="external" data-val="https://www.math.u-psud.fr/~crovisie/">Sylvain Crovisier - Université Paris-Sud</a></li>
<li><a href="https://www.ihes.fr/en/professeur/3403-2/" data-linktype="external" data-val="https://www.ihes.fr/en/professeur/3403-2/">Fanny Kassel - IHES</a></li>
<li><a href="http://cayley.kr/wiki/Sang-hyun_Kim" data-linktype="external" data-val="http://cayley.kr/wiki/Sang-hyun_Kim">Sang-hyun Kim - Seoul National University</a></li>
<li><a href="https://www.dpmms.cam.ac.uk/~gpp24/" data-linktype="external" data-val="https://www.dpmms.cam.ac.uk/~gpp24/">Gabriel Paternain - University of Cambridge</a></li>
<li><a href="http://w3.impa.br/~enrique/" data-linktype="external" data-val="http://w3.impa.br/~enrique/">Enrique Pujals - IMPA</a></li>
<li><a data-val="http://www.cmat.edu.uy/~rpotrie/" href="http://www.cmat.edu.uy/~rpotrie/" data-linktype="external">Rafael Potrie - CMAT</a></li>
</ul>
<h2>Organizing Committee</h2>
<ul class="comite">
<li>Juan Alonso</li>
<li>Joaquín Brum</li>
<li>Andrés Sambarino</li>
<li>Martín Sambarino</li>
</ul>
</div>
</div>
</div>
<?php include_once 'sidebar.php'; ?>
<?php include_once 'footer.php'; ?>

36
composer.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": "slim/slim-skeleton",
"description": "Groups Geometry and Dynamics, ICM2018 Satellite, Web Project",
"keywords": ["ICM2018", "GGDWorkshop", "Montevideo","Math","Groups","Geometry"],
"homepage": "https://ggdworkshop.cmat.edu.uy",
"license": "GPLv3",
"authors": [
{
"name": "Germán Correa",
"email": "germanc@cmat.edu.uy",
"homepage": "http://www.cmat.edu.uy"
}
],
"require": {
"php": ">=5.5.0",
"slim/slim": "^3.1",
"monolog/monolog": "^1.17",
"slim/twig-view": "^2.3"
},
"require-dev": {
"phpunit/phpunit": ">=4.8 < 6.0"
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"config": {
"process-timeout" : 0
},
"scripts": {
"start": "php -S localhost:8080 -t public index.php",
"test": "phpunit"
}
}

1940
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,9 @@
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$db_path = $root."/db/ggdworkshop.db";
$schema_path = $root."/db/schema.sql";
class DB{
private $pdo;
public function connect(){
if($this->pdo == null){
global $db_path;
$this->pdo = new \PDO('sqlite:'.$db_path);
$this->pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
return $this->pdo;
public function __constructor($dbpdo){
$this->pdo = $dbpdo;
}
public function schema($schema_file){
@ -55,16 +45,6 @@
return $stmt->fetchAll(\PDO::FETCH_BOTH);
}
}
$db = new DB();
$db->connect();
$db->schema($schema_path);
}
?>

Binary file not shown.

18
docker-compose.yml Normal file
View File

@ -0,0 +1,18 @@
version: '2'
volumes:
logs:
driver: local
services:
slim:
image: php:7-alpine
working_dir: /var/www
command: php -S 0.0.0.0:8080 -t public public/index.php
environment:
docker: "true"
ports:
- 8080:8080
volumes:
- .:/var/www
- logs:/var/www/logs

View File

@ -1,38 +0,0 @@
<?php include_once 'header.php'; ?>
<div class="row">
<div id="content" class="col-xs-12 col-sm-8">
<div class="row">
<h1 id="welcome"><strong>Welcome!</strong></h1>
<p>
The Dynamical Systems Group at the Universidad de la República has
been organizing several international Conferences and
Workshops in the last 20 years, focusing on different aspects of
dynamics and related topics.
</p>
<p>
As our group expanded, both in number of participants and areas
of research, we are holding a Workshop on Groups, Geometry and Dynamics
on 2018 at Montevideo as a satellite conference of ICM 2018 (Rio de
Janeiro). The goal of the Workshop is to bring together top scientists
working on these areas to discuss new trends on these topics. The
idea is to have few talks and lots of discussion time.
</p>
<p>
During the conference we will be holding a memorial recognition to Ricardo Mañé
(1948-1995), a top Uruguayan mathematician who worked on Dynamical
Systems, and who in 2018 would have been 70 years old.
</p>
<div class="thumbnail">
<a href="https://en.wikipedia.org/wiki/Ricardo_Ma%C3%B1%C3%A9" target="_blank">
<img class="img-responsive" src="img/rmane.jpg" alt="Ricardo Mañé"/>
<div class="caption">
<p>Quisque in porttitor ante. Morbi non maximus purus. Nulla vel varius nulla. Fusce in orci a nibh sodales sagittis eu vel elit. </p>
</div>
</a>
</div>
</div>
</div>
<?php include_once 'sidebar.php' ?>
<?php include_once 'footer.php' ?>

1
logs/README.md Normal file
View File

@ -0,0 +1 @@
Your Slim Framework application's log files will be written to this directory.

7
phpunit.xml Normal file
View File

@ -0,0 +1,7 @@
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="SlimSkeleton">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@ -0,0 +1,5 @@
<?php include_once 'header.php';?>
<h1>pagina de include</h1>
<?php include_once 'footer.php';?>

View File

View File

@ -0,0 +1,3 @@
[Trash Info]
Path=included.php
DeletionDate=2017-09-05T19:02:02

View File

@ -0,0 +1,3 @@
[Trash Info]
Path=sidebar.html
DeletionDate=2017-09-05T18:56:27

3
public/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
2021y22.csv
*.bak
bkp/*

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

6
public/htaccess Normal file
View File

@ -0,0 +1,6 @@
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

View File

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

Before

Width:  |  Height:  |  Size: 748 KiB

After

Width:  |  Height:  |  Size: 748 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 575 KiB

After

Width:  |  Height:  |  Size: 575 KiB

View File

Before

Width:  |  Height:  |  Size: 767 KiB

After

Width:  |  Height:  |  Size: 767 KiB

View File

Before

Width:  |  Height:  |  Size: 488 KiB

After

Width:  |  Height:  |  Size: 488 KiB

View File

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

33
public/index.php Normal file
View File

@ -0,0 +1,33 @@
<?php
if (PHP_SAPI == 'cli-server') {
// To help the built-in PHP dev server, check if the request was actually for
// something which should probably be served as a static file
$url = parse_url($_SERVER['REQUEST_URI']);
$file = __DIR__ . $url['path'];
if (is_file($file)) {
return false;
}
}
require __DIR__ . '/../vendor/autoload.php';
session_start();
// Instantiate the app
$settings = require __DIR__ . '/../src/settings.php';
$app = new \Slim\App($settings);
// Set up dependencies
require __DIR__ . '/../src/dependencies.php';
// Register middleware
require __DIR__ . '/../src/middleware.php';
// Register routes
require __DIR__ . '/../src/routes.php';
// Require DB
require __DIR__.'/../db/db.php';
// Run app
$app->run();

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Some files were not shown because too many files have changed in this diff Show More