mirror of
https://github.com/moparisthebest/wallabag
synced 2024-11-30 04:42:19 -05:00
Merge pull request #705 from tcitworld/v2-silex
[V2] changed everything from Poche to Wallabag
This commit is contained in:
commit
7f665638d0
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,8 +2,8 @@ assets/*
|
|||||||
cache/*
|
cache/*
|
||||||
composer.phar
|
composer.phar
|
||||||
composer.lock
|
composer.lock
|
||||||
poche.db
|
wallabag.db
|
||||||
poche_test.db
|
wallabag_test.db
|
||||||
vendor/atoum
|
vendor/atoum
|
||||||
vendor/bin
|
vendor/bin
|
||||||
vendor/autoload.php
|
vendor/autoload.php
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Poche v2 [![Build Status](https://travis-ci.org/inthepoche/poche.png?branch=v2-silex)](https://travis-ci.org/inthepoche/poche)
|
# wallabag v2 [![Build Status](https://api.travis-ci.org/wallabag/wallabag.png?branch=v2-silex)](https://travis-ci.org/wallabag/wallabag)
|
||||||
|
|
||||||
This is a Proof of Concept of Poche v2 using the PHP micro-framework [Silex](http://silex.sensiolabs.org).
|
This is a Proof of Concept of wallabag v2 using the PHP micro-framework [Silex](http://silex.sensiolabs.org).
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
@ -11,11 +11,11 @@ Get Composer and install Silex:
|
|||||||
|
|
||||||
Then configure your webserver to point to the `web/` directory. Some documentation is available on the [Silex documentation page](http://silex.sensiolabs.org/doc/web_servers.html).
|
Then configure your webserver to point to the `web/` directory. Some documentation is available on the [Silex documentation page](http://silex.sensiolabs.org/doc/web_servers.html).
|
||||||
|
|
||||||
If you are using PHP 5.4 you can run Poche v2 by using the embedded webserver:
|
If you are using PHP 5.4 you can run wallabag v2 by using the embedded webserver:
|
||||||
|
|
||||||
php -S localhost:8080 -t web web/index.php
|
php -S localhost:8080 -t web web/index.php
|
||||||
|
|
||||||
Poche should now be running at [http://localhost:8080](http://localhost:8080).
|
wallabag should now be running at [http://localhost:8080](http://localhost:8080).
|
||||||
|
|
||||||
Then you should initialize your database by running:
|
Then you should initialize your database by running:
|
||||||
|
|
||||||
|
20
app/app.php
20
app/app.php
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
use Knp\Provider\ConsoleServiceProvider;
|
use Knp\Provider\ConsoleServiceProvider;
|
||||||
use Poche\Api\EntryApi;
|
use Wallabag\Api\EntryApi;
|
||||||
use Poche\Api\ContentFullTextRssApi;
|
use Wallabag\Api\ContentFullTextRssApi;
|
||||||
use Poche\Repository\EntryRepository;
|
use Wallabag\Repository\EntryRepository;
|
||||||
use Poche\Twig;
|
use Wallabag\Twig;
|
||||||
|
|
||||||
use Symfony\Component\Translation\Loader\PoFileLoader;
|
use Symfony\Component\Translation\Loader\PoFileLoader;
|
||||||
use Silex\Provider\SessionServiceProvider;
|
use Silex\Provider\SessionServiceProvider;
|
||||||
@ -23,22 +23,22 @@ $app->before(function () use ($app) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$app['twig'] = $app->share($app->extend('twig', function($twig) {
|
$app['twig'] = $app->share($app->extend('twig', function($twig) {
|
||||||
$twig->addFilter(new Twig_SimpleFilter('getDomain', 'Poche\Twig\Filter::getDomain'));
|
$twig->addFilter(new Twig_SimpleFilter('getDomain', 'Wallabag\Twig\Filter::getDomain'));
|
||||||
return $twig;
|
return $twig;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$app['twig'] = $app->share($app->extend('twig', function($twig) {
|
$app['twig'] = $app->share($app->extend('twig', function($twig) {
|
||||||
$twig->addFilter(new Twig_SimpleFilter('getReadingTime', 'Poche\Twig\Filter::getReadingTime'));
|
$twig->addFilter(new Twig_SimpleFilter('getReadingTime', 'Wallabag\Twig\Filter::getReadingTime'));
|
||||||
return $twig;
|
return $twig;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$app['twig'] = $app->share($app->extend('twig', function($twig) {
|
$app['twig'] = $app->share($app->extend('twig', function($twig) {
|
||||||
$twig->addFilter(new Twig_SimpleFilter('getPicture', 'Poche\Twig\Filter::getPicture'));
|
$twig->addFilter(new Twig_SimpleFilter('getPicture', 'Wallabag\Twig\Filter::getPicture'));
|
||||||
return $twig;
|
return $twig;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
$app->register(new ConsoleServiceProvider(), [
|
$app->register(new ConsoleServiceProvider(), [
|
||||||
'console.name' => 'Poche console',
|
'console.name' => 'Wallabag console',
|
||||||
'console.version' => '0.1',
|
'console.version' => '0.1',
|
||||||
'console.project_directory' => __DIR__.'/..',
|
'console.project_directory' => __DIR__.'/..',
|
||||||
]);
|
]);
|
||||||
@ -46,7 +46,7 @@ $app->register(new ConsoleServiceProvider(), [
|
|||||||
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
|
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
|
||||||
'db.options' => array(
|
'db.options' => array(
|
||||||
'driver' => 'pdo_sqlite',
|
'driver' => 'pdo_sqlite',
|
||||||
'path' => __DIR__.'/../poche.db',
|
'path' => __DIR__.'/../wallabag.db',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ $app->register(new SecurityServiceProvider(), array(
|
|||||||
'form' => array('login_path' => '/', 'check_path' => 'login'),
|
'form' => array('login_path' => '/', 'check_path' => 'login'),
|
||||||
'logout' => array('logout_path' => '/logout'),
|
'logout' => array('logout_path' => '/logout'),
|
||||||
'users' => $app->share(function() use ($app) {
|
'users' => $app->share(function() use ($app) {
|
||||||
return new Poche\User\UserProvider($app['db']);
|
return new Wallabag\User\UserProvider($app['db']);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
use Poche\Model\Entry;
|
use Wallabag\Model\Entry;
|
||||||
use Poche\Controller;
|
use Wallabag\Controller;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
$front = $app['controllers_factory'];
|
$front = $app['controllers_factory'];
|
||||||
|
|
||||||
// entry
|
// entry
|
||||||
$front->get('/', 'Poche\Controller\EntryController::indexAction');
|
$front->get('/', 'Wallabag\Controller\EntryController::indexAction');
|
||||||
$front->get('/view/{id}', 'Poche\Controller\EntryController::showAction')
|
$front->get('/view/{id}', 'Wallabag\Controller\EntryController::showAction')
|
||||||
->bind('view_entry');
|
->bind('view_entry');
|
||||||
$front->match('/add', 'Poche\Controller\EntryController::addAction')
|
$front->match('/add', 'Wallabag\Controller\EntryController::addAction')
|
||||||
->bind('add');
|
->bind('add');
|
||||||
$front->get('/remove/{id}', 'Poche\Controller\EntryController::removeAction')
|
$front->get('/remove/{id}', 'Wallabag\Controller\EntryController::removeAction')
|
||||||
->bind('remove_entry');
|
->bind('remove_entry');
|
||||||
$front->get('/restore/{id}', 'Poche\Controller\EntryController::restoreAction')
|
$front->get('/restore/{id}', 'Wallabag\Controller\EntryController::restoreAction')
|
||||||
->bind('restore_entry');
|
->bind('restore_entry');
|
||||||
|
|
||||||
// bookmarks
|
// bookmarks
|
||||||
$front->get('/bookmarks', 'Poche\Controller\BookmarkController::indexAction');
|
$front->get('/bookmarks', 'Wallabag\Controller\BookmarkController::indexAction');
|
||||||
$front->match('/star/{id}', 'Poche\Controller\BookmarkController::addAction')
|
$front->match('/star/{id}', 'Wallabag\Controller\BookmarkController::addAction')
|
||||||
->bind('star_entry');
|
->bind('star_entry');
|
||||||
$front->match('/unstar/{id}', 'Poche\Controller\BookmarkController::removeAction')
|
$front->match('/unstar/{id}', 'Wallabag\Controller\BookmarkController::removeAction')
|
||||||
->bind('unstar_entry');
|
->bind('unstar_entry');
|
||||||
|
|
||||||
// archive
|
// archive
|
||||||
$front->get('/archive', 'Poche\Controller\ArchiveController::indexAction');
|
$front->get('/archive', 'Wallabag\Controller\ArchiveController::indexAction');
|
||||||
$front->match('/mark-read/{id}', 'Poche\Controller\ArchiveController::readAction')
|
$front->match('/mark-read/{id}', 'Wallabag\Controller\ArchiveController::readAction')
|
||||||
->bind('mark_entry_read');
|
->bind('mark_entry_read');
|
||||||
$front->match('/mark-unread/{id}', 'Poche\Controller\ArchiveController::unreadAction')
|
$front->match('/mark-unread/{id}', 'Wallabag\Controller\ArchiveController::unreadAction')
|
||||||
->bind('mark_entry_unread');
|
->bind('mark_entry_unread');
|
||||||
|
|
||||||
return $front;
|
return $front;
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<footer role="contentinfo">
|
<footer role="contentinfo">
|
||||||
<p>powered by <a href="http://www.inthepoche.com">poche</a></p>
|
<p>powered by <a href="http://wallabag.org/">wallabag</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="alert alert-error" >{{ error }}</div>
|
<div class="alert alert-error" >{{ error }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form action="{{ path('login') }}" method="post">
|
<form action="{{ path('login') }}" method="post">
|
||||||
<p><label for="username">{{ 'username'|trans }}: </label><input id="username" type="text" name="_username" value="poche"></p>
|
<p><label for="username">{{ 'username'|trans }}: </label><input id="username" type="text" name="_username" value="wallabag"></p>
|
||||||
<p><label for="password">{{ 'password'|trans }}: </label><input id="password" type="password" name="_password" value="password"></p>
|
<p><label for="password">{{ 'password'|trans }}: </label><input id="password" type="password" name="_password" value="password"></p>
|
||||||
<p><input type="submit" value="{{ 'login'|trans }}"></p>
|
<p><input type="submit" value="{{ 'login'|trans }}"></p>
|
||||||
</form>
|
</form>
|
@ -3,7 +3,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<header>
|
<header>
|
||||||
<nav role="navigation">
|
<nav role="navigation">
|
||||||
<a class="logo" href="/">poche</a>
|
<a class="logo" href="/">wallabag</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li {% if app.request.requesturi == '/' %}class="active"{% endif %}><a href="/">{{ 'unread'|trans }}</a>{% if app.request.requesturi == '/' %} (<span id="counter">{{count}}</span>){% endif %}</li>
|
<li {% if app.request.requesturi == '/' %}class="active"{% endif %}><a href="/">{{ 'unread'|trans }}</a>{% if app.request.requesturi == '/' %} (<span id="counter">{{count}}</span>){% endif %}</li>
|
||||||
<li {% if app.request.requesturi == '/bookmarks' %}class="active"{% endif %}><a href="/bookmarks">{{ 'bookmarks'|trans }}</a></li>
|
<li {% if app.request.requesturi == '/bookmarks' %}class="active"{% endif %}><a href="/bookmarks">{{ 'bookmarks'|trans }}</a></li>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<!--[if IE]>
|
<!--[if IE]>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=10">
|
<meta http-equiv="X-UA-Compatible" content="IE=10">
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<title>{% block title %}{% endblock %} – poche</title>
|
<title>{% block title %}{% endblock %} – wallabag</title>
|
||||||
<link rel="stylesheet" href="/assets/css/reset.css" media="all">
|
<link rel="stylesheet" href="/assets/css/reset.css" media="all">
|
||||||
<link rel="stylesheet" href="/assets/css/tinytypo.css" media="all">
|
<link rel="stylesheet" href="/assets/css/tinytypo.css" media="all">
|
||||||
<link rel="stylesheet" href="/assets/css/typo.css" media="all">
|
<link rel="stylesheet" href="/assets/css/typo.css" media="all">
|
||||||
|
@ -15,6 +15,6 @@
|
|||||||
"symfony/security": "2.3.*@dev"
|
"symfony/security": "2.3.*@dev"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": { "Poche\\": "src/" }
|
"psr-0": { "Wallabag\\": "src/" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
console
4
console
@ -7,7 +7,7 @@ require_once __DIR__.'/app/app.php';
|
|||||||
|
|
||||||
$console = $app['console'];
|
$console = $app['console'];
|
||||||
|
|
||||||
$console->add(new Poche\Command\UnitTestsCommand());
|
$console->add(new Wallabag\Command\UnitTestsCommand());
|
||||||
$console->add(new Poche\Command\CreateSchemaCommand());
|
$console->add(new Wallabag\Command\CreateSchemaCommand());
|
||||||
|
|
||||||
$console->run();
|
$console->run();
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
bootstrap="tests/functionals/bootstrap.php"
|
bootstrap="tests/functionals/bootstrap.php"
|
||||||
>
|
>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Poche Test Suite">
|
<testsuite name="Wallabag Test Suite">
|
||||||
<directory>./tests/functionals/</directory>
|
<directory>./tests/functionals/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Api;
|
namespace Wallabag\Api;
|
||||||
|
|
||||||
use Poche\Util\Url;
|
use Wallabag\Util\Url;
|
||||||
|
|
||||||
class ContentFullTextRssApi
|
class ContentFullTextRssApi
|
||||||
{
|
{
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Api;
|
namespace Wallabag\Api;
|
||||||
|
|
||||||
class EntryApi
|
class EntryApi
|
||||||
{
|
{
|
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\Command;
|
namespace Wallabag\Command;
|
||||||
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
use Knp\Command\Command as BaseCommand;
|
use Knp\Command\Command as BaseCommand;
|
||||||
use Poche\Schema;
|
use Wallabag\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application aware command
|
* Application aware command
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\Command;
|
namespace Wallabag\Command;
|
||||||
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Controller;
|
namespace Wallabag\Controller;
|
||||||
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Controller;
|
namespace Wallabag\Controller;
|
||||||
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Controller;
|
namespace Wallabag\Controller;
|
||||||
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Model;
|
namespace Wallabag\Model;
|
||||||
|
|
||||||
class Entry
|
class Entry
|
||||||
{
|
{
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Repository;
|
namespace Wallabag\Repository;
|
||||||
|
|
||||||
class EntryRepository
|
class EntryRepository
|
||||||
{
|
{
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche;
|
namespace Wallabag;
|
||||||
|
|
||||||
use Poche\Util\Token;
|
use Wallabag\Util\Token;
|
||||||
|
|
||||||
class Schema
|
class Schema
|
||||||
{
|
{
|
||||||
@ -34,7 +34,7 @@ class Schema
|
|||||||
$db->query("
|
$db->query("
|
||||||
CREATE TABLE users (
|
CREATE TABLE users (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE,
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE,
|
||||||
username TEXT DEFAULT 'poche',
|
username TEXT DEFAULT 'wallabag',
|
||||||
password TEXT,
|
password TEXT,
|
||||||
roles TEXT DEFAULT '',
|
roles TEXT DEFAULT '',
|
||||||
email TEXT,
|
email TEXT,
|
@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* poche, a read it later open source system
|
* wallabag, a read it later open source system
|
||||||
*
|
*
|
||||||
* @category poche
|
* @category wallabag
|
||||||
* @author Nicolas Lœuillet <support@inthepoche.com>
|
* @author Nicolas Lœuillet <hello@wallabag.org>
|
||||||
* @copyright 2013
|
* @copyright 2013
|
||||||
* @license http://www.wtfpl.net/ see COPYING file
|
* @license http://www.wtfpl.net/ see COPYING file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Poche\Twig;
|
namespace Wallabag\Twig;
|
||||||
|
|
||||||
class Filter
|
class Filter
|
||||||
{
|
{
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\User;
|
namespace Wallabag\User;
|
||||||
|
|
||||||
use Symfony\Component\Security\Core\User\UserProviderInterface;
|
use Symfony\Component\Security\Core\User\UserProviderInterface;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
use Symfony\Component\Security\Core\User\UserInterface;
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\Util;
|
namespace Wallabag\Util;
|
||||||
|
|
||||||
class DummySingleItem {
|
class DummySingleItem {
|
||||||
public $url;
|
public $url;
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\Util;
|
namespace Wallabag\Util;
|
||||||
|
|
||||||
class DummySingleItemFeed {
|
class DummySingleItemFeed {
|
||||||
public $item;
|
public $item;
|
@ -7,7 +7,7 @@
|
|||||||
* @example http://www.framework2.com.ar/dzone/forceUTF8-es/
|
* @example http://www.framework2.com.ar/dzone/forceUTF8-es/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Poche\Util;
|
namespace Wallabag\Util;
|
||||||
|
|
||||||
class Encoding {
|
class Encoding {
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Util;
|
namespace Wallabag\Util;
|
||||||
|
|
||||||
class Token
|
class Token
|
||||||
{
|
{
|
@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* poche, a read it later open source system
|
* wallabag, a read it later open source system
|
||||||
*
|
*
|
||||||
* @category poche
|
* @category wallabag
|
||||||
* @author Nicolas Lœuillet <support@inthepoche.com>
|
* @author Nicolas Lœuillet <hello@wallabag.org>
|
||||||
* @copyright 2013
|
* @copyright 2013
|
||||||
* @license http://www.wtfpl.net/ see COPYING file
|
* @license http://www.wtfpl.net/ see COPYING file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Poche\Util;
|
namespace Wallabag\Util;
|
||||||
|
|
||||||
class Url
|
class Url
|
||||||
{
|
{
|
||||||
@ -357,7 +357,7 @@ class Url
|
|||||||
}
|
}
|
||||||
if (isset($splink)) {
|
if (isset($splink)) {
|
||||||
// Build DOM tree from HTML
|
// Build DOM tree from HTML
|
||||||
$readability = new PocheReadability($html, $url);
|
$readability = new WallabagReadability($html, $url);
|
||||||
$xpath = new DOMXPath($readability->dom);
|
$xpath = new DOMXPath($readability->dom);
|
||||||
// Loop through single_page_link xpath expressions
|
// Loop through single_page_link xpath expressions
|
||||||
$single_page_url = null;
|
$single_page_url = null;
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Util;
|
namespace Wallabag\Util;
|
||||||
|
|
||||||
class PocheReadability extends Readability
|
class WallabagReadability extends Readability
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get the article title as an H1.
|
* Get the article title as an H1.
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\Tests\Functionals;
|
namespace Wallabag\Tests\Functionals;
|
||||||
use Poche\Tests\Functionals\Fixtures;
|
use Wallabag\Tests\Functionals\Fixtures;
|
||||||
|
|
||||||
class ApiTest extends PocheWebTestCase
|
class ApiTest extends WallabagWebTestCase
|
||||||
{
|
{
|
||||||
public function testEmptyGetEntries()
|
public function testEmptyGetEntries()
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Tests\Functionals;
|
namespace Wallabag\Tests\Functionals;
|
||||||
|
|
||||||
class Fixtures
|
class Fixtures
|
||||||
{
|
{
|
||||||
public static function loadUsers($db) {
|
public static function loadUsers($db) {
|
||||||
|
|
||||||
$db->query("INSERT INTO users (id, username) values (1, 'poche_test');");
|
$db->query("INSERT INTO users (id, username) values (1, 'wallabag_test');");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Poche\Tests\Functionals;
|
namespace Wallabag\Tests\Functionals;
|
||||||
|
|
||||||
use Poche\Tests\Functionals\Fixtures;
|
use Wallabag\Tests\Functionals\Fixtures;
|
||||||
|
|
||||||
use Silex\WebTestCase;
|
use Silex\WebTestCase;
|
||||||
|
|
||||||
use Poche\Schema;
|
use Wallabag\Schema;
|
||||||
|
|
||||||
class PocheWebTestCase extends WebTestCase
|
class WallabagWebTestCase extends WebTestCase
|
||||||
{
|
{
|
||||||
protected $app;
|
protected $app;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ class PocheWebTestCase extends WebTestCase
|
|||||||
|
|
||||||
$app['db.options'] = array(
|
$app['db.options'] = array(
|
||||||
'driver' => 'pdo_sqlite',
|
'driver' => 'pdo_sqlite',
|
||||||
'path' => __DIR__.'/poche_test.db'
|
'path' => __DIR__.'/wallabag_test.db'
|
||||||
);
|
);
|
||||||
|
|
||||||
$app['debug'] = true;
|
$app['debug'] = true;
|
@ -2,4 +2,4 @@
|
|||||||
require __DIR__.'/../../vendor/autoload.php';
|
require __DIR__.'/../../vendor/autoload.php';
|
||||||
require __DIR__.'/../../vendor/full-text-rss/autoload.php';
|
require __DIR__.'/../../vendor/full-text-rss/autoload.php';
|
||||||
require __DIR__.'/Fixtures.php';
|
require __DIR__.'/Fixtures.php';
|
||||||
require __DIR__.'/PocheWebTestCase.php';
|
require __DIR__.'/WallabagWebTestCase.php';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Model\tests\units;
|
namespace Wallabag\Model\tests\units;
|
||||||
|
|
||||||
use \atoum;
|
use \atoum;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ class Entry extends atoum
|
|||||||
{
|
{
|
||||||
public function testGetId()
|
public function testGetId()
|
||||||
{
|
{
|
||||||
$entry = new \Poche\Model\Entry(1, "Titre test");
|
$entry = new \Wallabag\Model\Entry(1, "Titre test");
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->integer($entry->getId())
|
->integer($entry->getId())
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Poche\Util\tests\units;
|
namespace Wallabag\Util\tests\units;
|
||||||
|
|
||||||
use \atoum;
|
use \atoum;
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ class Token extends atoum
|
|||||||
public function testTokenSize()
|
public function testTokenSize()
|
||||||
{
|
{
|
||||||
$this
|
$this
|
||||||
->integer(strlen(\Poche\Util\Token::generateToken()))
|
->integer(strlen(\Wallabag\Util\Token::generateToken()))
|
||||||
->isEqualTo(15)
|
->isEqualTo(15)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.2 KiB |
@ -1,11 +1,11 @@
|
|||||||
var poche = {};
|
var wallabag = {};
|
||||||
|
|
||||||
poche.App = (function() {
|
wallabag.App = (function() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
Run: function() {
|
Run: function() {
|
||||||
// poche.Event.ListenKeyboardEvents();
|
// wallabag.Event.ListenKeyboardEvents();
|
||||||
poche.Event.ListenMouseEvents();
|
wallabag.Event.ListenMouseEvents();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
poche.Event = (function() {
|
wallabag.Event = (function() {
|
||||||
|
|
||||||
var queue = [];
|
var queue = [];
|
||||||
|
|
||||||
@ -14,26 +14,26 @@ poche.Event = (function() {
|
|||||||
switch (action) {
|
switch (action) {
|
||||||
case 'mark_entry_read':
|
case 'mark_entry_read':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
poche.Item.MarkAsRead(e.target.getAttribute("data-entry-id"));
|
wallabag.Item.MarkAsRead(e.target.getAttribute("data-entry-id"));
|
||||||
break;
|
break;
|
||||||
case 'mark_entry_unread':
|
case 'mark_entry_unread':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
poche.Item.MarkAsUnread(e.target.getAttribute("data-entry-id"));
|
wallabag.Item.MarkAsUnread(e.target.getAttribute("data-entry-id"));
|
||||||
break;
|
break;
|
||||||
case 'unstar_entry':
|
case 'unstar_entry':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
poche.Item.MarkAsUnstarred(e.target.getAttribute("data-entry-id"));
|
wallabag.Item.MarkAsUnstarred(e.target.getAttribute("data-entry-id"));
|
||||||
break;
|
break;
|
||||||
case 'star_entry':
|
case 'star_entry':
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
poche.Item.MarkAsStarred(e.target.getAttribute("data-entry-id"));
|
wallabag.Item.MarkAsStarred(e.target.getAttribute("data-entry-id"));
|
||||||
break;
|
break;
|
||||||
// case 'original-link':
|
// case 'original-link':
|
||||||
// poche.Item.OpenOriginal(e.target.getAttribute("data-entry-id"));
|
// wallabag.Item.OpenOriginal(e.target.getAttribute("data-entry-id"));
|
||||||
// break;
|
// break;
|
||||||
// case 'mark-all-read':
|
// case 'mark-all-read':
|
||||||
// e.preventDefault();
|
// e.preventDefault();
|
||||||
// poche.Item.MarkListingAsRead("?action=unread");
|
// wallabag.Item.MarkListingAsRead("?action=unread");
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,36 +81,36 @@ poche.Event = (function() {
|
|||||||
|
|
||||||
switch (e.keyCode || e.which) {
|
switch (e.keyCode || e.which) {
|
||||||
case 100: // d
|
case 100: // d
|
||||||
poche.Item.DownloadContent(poche.Nav.GetCurrentItemId());
|
wallabag.Item.DownloadContent(wallabag.Nav.GetCurrentItemId());
|
||||||
break;
|
break;
|
||||||
case 112: // p
|
case 112: // p
|
||||||
case 107: // k
|
case 107: // k
|
||||||
poche.Nav.SelectPreviousItem();
|
wallabag.Nav.SelectPreviousItem();
|
||||||
break;
|
break;
|
||||||
case 110: // n
|
case 110: // n
|
||||||
case 106: // j
|
case 106: // j
|
||||||
poche.Nav.SelectNextItem();
|
wallabag.Nav.SelectNextItem();
|
||||||
break;
|
break;
|
||||||
case 118: // v
|
case 118: // v
|
||||||
poche.Item.OpenOriginal(poche.Nav.GetCurrentItemId());
|
wallabag.Item.OpenOriginal(wallabag.Nav.GetCurrentItemId());
|
||||||
break;
|
break;
|
||||||
case 111: // o
|
case 111: // o
|
||||||
poche.Item.Show(poche.Nav.GetCurrentItemId());
|
wallabag.Item.Show(wallabag.Nav.GetCurrentItemId());
|
||||||
break;
|
break;
|
||||||
case 109: // m
|
case 109: // m
|
||||||
poche.Item.SwitchStatus(poche.Nav.GetCurrentItem());
|
wallabag.Item.SwitchStatus(wallabag.Nav.GetCurrentItem());
|
||||||
break;
|
break;
|
||||||
case 102: // f
|
case 102: // f
|
||||||
poche.Item.SwitchBookmark(poche.Nav.GetCurrentItem());
|
wallabag.Item.SwitchBookmark(wallabag.Nav.GetCurrentItem());
|
||||||
break;
|
break;
|
||||||
case 104: // h
|
case 104: // h
|
||||||
poche.Nav.OpenPreviousPage();
|
wallabag.Nav.OpenPreviousPage();
|
||||||
break
|
break
|
||||||
case 108: // l
|
case 108: // l
|
||||||
poche.Nav.OpenNextPage();
|
wallabag.Nav.OpenNextPage();
|
||||||
break;
|
break;
|
||||||
case 63: // ?
|
case 63: // ?
|
||||||
poche.Nav.ShowHelp();
|
wallabag.Nav.ShowHelp();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
poche.Item = (function() {
|
wallabag.Item = (function() {
|
||||||
|
|
||||||
function getItem(item_id)
|
function getItem(item_id)
|
||||||
{
|
{
|
||||||
@ -25,7 +25,7 @@ poche.Item = (function() {
|
|||||||
|
|
||||||
// function showItemBookmarked(item_id, item)
|
// function showItemBookmarked(item_id, item)
|
||||||
// {
|
// {
|
||||||
// if (! poche.Nav.IsListing()) {
|
// if (! wallabag.Nav.IsListing()) {
|
||||||
|
|
||||||
// var link = document.getElementById("bookmark-" + item_id);
|
// var link = document.getElementById("bookmark-" + item_id);
|
||||||
// if (link) link.innerHTML = "★";
|
// if (link) link.innerHTML = "★";
|
||||||
@ -47,7 +47,7 @@ poche.Item = (function() {
|
|||||||
|
|
||||||
function hideItemBookmarked(item_id, item)
|
function hideItemBookmarked(item_id, item)
|
||||||
{
|
{
|
||||||
if (! poche.Nav.IsListing()) {
|
if (! wallabag.Nav.IsListing()) {
|
||||||
|
|
||||||
var link = document.getElementById("bookmark-" + item_id);
|
var link = document.getElementById("bookmark-" + item_id);
|
||||||
if (link) link.innerHTML = "☆";
|
if (link) link.innerHTML = "☆";
|
||||||
@ -147,7 +147,7 @@ poche.Item = (function() {
|
|||||||
|
|
||||||
counter = parseInt(container.textContent.trim(), 10) - 1;
|
counter = parseInt(container.textContent.trim(), 10) - 1;
|
||||||
container.textContent = counter;
|
container.textContent = counter;
|
||||||
document.title = "unread (" + counter + ") – poche";
|
document.title = "unread (" + counter + ") – wallabag";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ poche.Item = (function() {
|
|||||||
{
|
{
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (poche.Nav.IsListing()) showItemAsStarred(item_id);
|
if (wallabag.Nav.IsListing()) showItemAsStarred(item_id);
|
||||||
};
|
};
|
||||||
request.open("POST", "star/" + item_id, true);
|
request.open("POST", "star/" + item_id, true);
|
||||||
request.send();
|
request.send();
|
||||||
@ -165,7 +165,7 @@ poche.Item = (function() {
|
|||||||
{
|
{
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (poche.Nav.IsListing()) showItemAsUnstarred(item_id);
|
if (wallabag.Nav.IsListing()) showItemAsUnstarred(item_id);
|
||||||
};
|
};
|
||||||
request.open("POST", "unstar/" + item_id, true);
|
request.open("POST", "unstar/" + item_id, true);
|
||||||
request.send();
|
request.send();
|
||||||
@ -175,7 +175,7 @@ poche.Item = (function() {
|
|||||||
{
|
{
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (poche.Nav.IsListing()) showItemAsRead(item_id);
|
if (wallabag.Nav.IsListing()) showItemAsRead(item_id);
|
||||||
};
|
};
|
||||||
request.open("POST", "mark-read/" + item_id, true);
|
request.open("POST", "mark-read/" + item_id, true);
|
||||||
request.send();
|
request.send();
|
||||||
@ -185,7 +185,7 @@ poche.Item = (function() {
|
|||||||
{
|
{
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (poche.Nav.IsListing()) showItemAsUnread(item_id);
|
if (wallabag.Nav.IsListing()) showItemAsUnread(item_id);
|
||||||
};
|
};
|
||||||
request.open("POST", "mark-unread/" + item_id, true);
|
request.open("POST", "mark-unread/" + item_id, true);
|
||||||
request.send();
|
request.send();
|
||||||
@ -287,4 +287,4 @@ poche.Item = (function() {
|
|||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
poche.App.Run();
|
wallabag.App.Run();
|
@ -1,4 +1,4 @@
|
|||||||
poche.Nav = (function() {
|
wallabag.Nav = (function() {
|
||||||
|
|
||||||
// function scrollPageTo(item)
|
// function scrollPageTo(item)
|
||||||
// {
|
// {
|
||||||
|
Loading…
Reference in New Issue
Block a user