alltube/index.php

52 lines
1.3 KiB
PHP
Raw Normal View History

2014-03-13 20:07:56 +01:00
<?php
/**
* PHP web interface for youtube-dl (http://rg3.github.com/youtube-dl/)
* Index page
2015-10-29 21:19:40 +01:00
*
2014-03-13 20:07:56 +01:00
* PHP Version 5.3.10
2015-10-29 21:19:40 +01:00
*
2014-03-13 20:07:56 +01:00
* @category Youtube-dl
* @package Youtubedl
2015-01-07 10:47:46 +01:00
* @author Pierre Rudloff <contact@rudloff.pro>
2014-03-13 20:07:56 +01:00
* @author Olivier Haquette <contact@olivierhaquette.fr>
* @license GNU General Public License http://www.gnu.org/licenses/gpl.html
* @link http://rudloff.pro
* */
2015-10-31 15:42:25 +01:00
require_once __DIR__.'/vendor/autoload.php';
2016-04-06 13:19:27 +02:00
require_once __DIR__.'/vendor/rudloff/smarty-plugin-noscheme/modifier.noscheme.php';
2015-10-29 21:19:40 +01:00
use Alltube\VideoDownload;
2016-03-30 01:39:47 +02:00
$app = new \Slim\App();
$container = $app->getContainer();
$container['view'] = function ($c) {
$view = new \Slim\Views\Smarty(__DIR__.'/templates/');
$view->addSlimPlugins($c['router'], $c['request']->getUri());
2016-04-06 13:19:27 +02:00
$view->registerPlugin('modifier', 'noscheme', 'Smarty_Modifier_noscheme');
2016-03-30 01:39:47 +02:00
return $view;
};
2015-10-29 21:23:02 +01:00
$app->get(
'/',
2015-10-29 22:32:36 +01:00
array('Alltube\Controller\FrontController', 'index')
2015-10-29 21:23:02 +01:00
);
$app->get(
'/extractors',
2015-10-29 22:32:36 +01:00
array('Alltube\Controller\FrontController', 'extractors')
2016-03-30 01:39:47 +02:00
)->setName('extractors');
2015-10-29 21:23:02 +01:00
$app->get(
'/video',
2015-10-29 22:32:36 +01:00
array('Alltube\Controller\FrontController', 'video')
2016-03-30 01:39:47 +02:00
)->setName('video');
2015-10-31 11:48:14 +01:00
$app->get(
'/redirect',
array('Alltube\Controller\FrontController', 'redirect')
);
$app->get(
'/json',
array('Alltube\Controller\FrontController', 'json')
);
2015-10-29 21:19:40 +01:00
$app->run();