Keep in mind it's an **instable** branch, everything can be broken :)
```
-git clone https://github.com/wallabag/wallabag.git -b refactor
+git clone https://github.com/wallabag/wallabag.git -b v2
cd wallabag
composer install
php app/console wallabag:install
+++ /dev/null
-<?php
-if (!file_exists(__DIR__ . '/config/config.inc.php')) {
- die('wallabag seems to be not installed. Please execute ./bin/install before.');
-}
-
-if (version_compare(PHP_VERSION, '5.3.3', '<')) {
- die('This software require PHP 5.3.3 minimum');
-}
-
-if (version_compare(PHP_VERSION, '5.4.0', '<')) {
- if (! ini_get('short_open_tag')) {
- die('This software require to have short tags enabled, check your php.ini => "short_open_tag = On"');
- }
-}
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * wallabag, self hostable application allowing you to not miss any content anymore
- *
- * @category wallabag
- * @author Nicolas Lœuillet <nicolas@loeuillet.org>
- * @copyright 2013
- * @license http://opensource.org/licenses/MIT see COPYING file
- */
-
-@define ('SALT', ''); # put a strong string here
-@define ('LANG', 'en_EN.utf8');
-
-@define ('STORAGE', 'sqlite'); # postgres, mysql or sqlite
-
-@define ('STORAGE_SQLITE', ROOT . '/data/db/poche.sqlite'); # if you are using sqlite, where me database file is located
-
-# only for postgres & mysql
-@define ('STORAGE_SERVER', 'localhost');
-@define ('STORAGE_DB', 'poche');
-@define ('STORAGE_USER', 'poche');
-@define ('STORAGE_PASSWORD', 'poche');
-
-#################################################################################
-# Do not trespass unless you know what you are doing
-#################################################################################
-// Change this if http is running on nonstandard port - i.e is behind cache proxy
-@define ('HTTP_PORT', 80);
-
-// Change this if not using the standart port for SSL - i.e you server is behind sslh
-@define ('SSL_PORT', 443);
-
-@define ('MODE_DEMO', FALSE);
-@define ('DEBUG_POCHE', FALSE);
-
-//default level of error reporting in application. Developers should override it in their config.inc.php: set to E_ALL.
-@define ('ERROR_REPORTING', E_ALL & ~E_NOTICE);
-
-@define ('DOWNLOAD_PICTURES', FALSE); # This can slow down the process of adding articles
-@define ('REGENERATE_PICTURES_QUALITY', 75);
-@define ('CONVERT_LINKS_FOOTNOTES', FALSE);
-@define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
-@define ('SHARE_TWITTER', TRUE);
-@define ('SHARE_MAIL', TRUE);
-@define ('SHARE_SHAARLI', FALSE);
-@define ('SHAARLI_URL', 'http://myshaarliurl.com');
-@define ('SHARE_DIASPORA', FALSE);
-@define ('DIASPORA_URL', 'http://diasporapod.com'); # Don't add a / at the end
-@define ('FLATTR', TRUE);
-@define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url=');
-@define ('NOT_FLATTRABLE', '0');
-@define ('FLATTRABLE', '1');
-@define ('FLATTRED', '2');
-@define ('CARROT', FALSE);
-
-// ebook
-@define ('EPUB', TRUE);
-@define ('MOBI', FALSE);
-@define ('PDF', FALSE);
-
-// display or not print link in article view
-@define ('SHOW_PRINTLINK', '1');
-// display or not percent of read in article view. Affects only default theme.
-@define ('SHOW_READPERCENT', '1');
-@define ('ABS_PATH', ROOT . '/data/assets/');
-
-@define ('DEFAULT_THEME', 'baggy');
-
-@define ('THEME', ROOT . '/src/Wallabag/Wallabag/Resources/views');
-@define ('LOCALE', ROOT . '/src/Wallabag/Wallabag/Resources/translations');
-@define ('CACHE', ROOT . '/app/cache');
-
-@define ('PAGINATION', '12');
-
-//limit for download of articles during import
-@define ('IMPORT_LIMIT', 5);
-//delay between downloads (in sec)
-@define ('IMPORT_DELAY', 5);
+++ /dev/null
-<?php
-/**
- * wallabag, self hostable application allowing you to not miss any content anymore
- *
- * @category wallabag
- * @author Nicolas Lœuillet <nicolas@loeuillet.org>
- * @copyright 2013
- * @license http://opensource.org/licenses/MIT see COPYING file
- */
-
-@define ('SALT', 'ThisTokenIsNotSoSecretChangeIt'); # put a strong string here
-@define ('LANG', 'en_EN.utf8');
-
-@define ('STORAGE', 'sqlite'); # postgres, mysql or sqlite
-
-@define ('STORAGE_SQLITE', ROOT . '/data/db/poche.sqlite'); # if you are using sqlite, where me database file is located
-
-# only for postgres & mysql
-@define ('STORAGE_SERVER', 'localhost');
-@define ('STORAGE_DB', 'poche');
-@define ('STORAGE_USER', 'poche');
-@define ('STORAGE_PASSWORD', 'poche');
-
-#################################################################################
-# Do not trespass unless you know what you are doing
-#################################################################################
-// Change this if http is running on nonstandard port - i.e is behind cache proxy
-@define ('HTTP_PORT', 80);
-
-// Change this if not using the standart port for SSL - i.e you server is behind sslh
-@define ('SSL_PORT', 443);
-
-@define ('MODE_DEMO', FALSE);
-@define ('DEBUG_POCHE', FALSE);
-
-//default level of error reporting in application. Developers should override it in their config.inc.php: set to E_ALL.
-@define ('ERROR_REPORTING', E_ALL & ~E_NOTICE);
-
-@define ('DOWNLOAD_PICTURES', FALSE); # This can slow down the process of adding articles
-@define ('REGENERATE_PICTURES_QUALITY', 75);
-@define ('CONVERT_LINKS_FOOTNOTES', FALSE);
-@define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
-@define ('SHARE_TWITTER', TRUE);
-@define ('SHARE_MAIL', TRUE);
-@define ('SHARE_SHAARLI', FALSE);
-@define ('SHAARLI_URL', 'http://myshaarliurl.com');
-@define ('SHARE_DIASPORA', FALSE);
-@define ('DIASPORA_URL', 'http://diasporapod.com'); # Don't add a / at the end
-@define ('FLATTR', TRUE);
-@define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url=');
-@define ('NOT_FLATTRABLE', '0');
-@define ('FLATTRABLE', '1');
-@define ('FLATTRED', '2');
-@define ('CARROT', FALSE);
-
-// ebook
-@define ('EPUB', TRUE);
-@define ('MOBI', FALSE);
-@define ('PDF', FALSE);
-
-// display or not print link in article view
-@define ('SHOW_PRINTLINK', '1');
-// display or not percent of read in article view. Affects only default theme.
-@define ('SHOW_READPERCENT', '1');
-@define ('ABS_PATH', ROOT . '/data/assets/');
-
-@define ('DEFAULT_THEME', 'baggy');
-
-@define ('THEME', ROOT . '/src/Wallabag/Wallabag/Resources/views');
-@define ('LOCALE', ROOT . '/src/Wallabag/Wallabag/Resources/translations');
-@define ('CACHE', ROOT . '/app/cache');
-
-@define ('PAGINATION', '12');
-
-//limit for download of articles during import
-@define ('IMPORT_LIMIT', 5);
-//delay between downloads (in sec)
-@define ('IMPORT_DELAY', 5);
+++ /dev/null
-#!/usr/bin/php
-<?php
-require_once __DIR__. '/../vendor/autoload.php';
-
-use Symfony\Component\Yaml\Yaml;
-
-$parameters = Yaml::parse(file_get_contents('app/config/parameters.yml'));
-
-echo 'Okay, you want to install wallabag, let\'s go!';
-echo "\r\n";
-
-function executeQuery($handle, $sql, $params) {
- try
- {
- $query = $handle->prepare($sql);
- $query->execute($params);
- return $query->fetchAll();
- }
- catch (Exception $e)
- {
- return false;
- }
-}
-
-$configFile = 'app/config/config.inc.php';
-$dbFile = 'data/db/poche.sqlite';
-$username = 'wallabag';
-$password = 'wallabag';
-$salt = $parameters['parameters']['secret'];
-$defaultLanguage = 'en_EN.UTF8';
-
-if (!copy('app/config/config.inc.default.php', $configFile)) {
- die('Installation aborted, impossible to create ' . $configFile . ' file. Maybe you don\'t have write access to create it.');
-}
-
-$content = file_get_contents($configFile);
-$content = str_replace("define ('SALT', '');", "define ('SALT', '".$salt."');", $content);
-file_put_contents($configFile, $content);
-
-if (!copy('bin/poche.sqlite', $dbFile)) {
- die('Impossible to create ' . $dbFile . ' file.');
-}
-
-chmod($dbFile, 0777);
-
-$dbPath = 'sqlite:' . realpath('') . '/' . $dbFile;
-
-$handle = new PDO($dbPath);
-
-$handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-
-$saltedPassword = sha1($password . $username . $salt);
-
-$sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')";
-$params = array($username, $saltedPassword, $username);
-$query = executeQuery($handle, $sql, $params);
-
-$idUser = (int)$handle->lastInsertId('users_id_seq');
-
-$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
-$params = array($idUser, 'pager', '10');
-$query = executeQuery($handle, $sql, $params);
-
-$sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)';
-$params = array($idUser, 'language', $defaultLanguage);
-$query = executeQuery($handle, $sql, $params);
-
-echo 'wallabag is now installed';
-echo "\r\n";
-echo 'Just execute `php app/console server:run` for using wallabag:';
-echo "\r\n";
-echo 'http://localhost:8000';
\ No newline at end of file
*/
public function postEntriesAction(Request $request)
{
- //TODO la récup ne marche pas
- //TODO gérer si on passe le titre
//TODO gérer si on passe les tags
- //TODO ne pas avoir du code comme ça qui doit se trouver dans le Repository
$url = $request->request->get('url');
$content = Extractor::extract($url);
$entry = new Entries();
$entry->setUserId(1);
$entry->setUrl($url);
- $entry->setTitle($content->getTitle());
+ $entry->setTitle($request->request->get('title') ?: $content->getTitle());
$entry->setContent($content->getBody());
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
->where('e.isRead = 0')
->andWhere('e.userId =:userId')->setParameter('userId', $userId)
->andWhere('e.isDeleted=0')
+ ->orderBy('e.createdAt', 'desc')
->getQuery();
$paginator = new Paginator($qb);
->where('e.isRead = 1')
->andWhere('e.userId =:userId')->setParameter('userId', $userId)
->andWhere('e.isDeleted=0')
+ ->orderBy('e.createdAt', 'desc')
->getQuery();
$paginator = new Paginator($qb);
->where('e.isFav = 1')
->andWhere('e.userId =:userId')->setParameter('userId', $userId)
->andWhere('e.isDeleted=0')
+ ->orderBy('e.createdAt', 'desc')
->getQuery();
$paginator = new Paginator($qb);
public function findEntries($userId, $isArchived, $isStarred, $isDeleted, $sort, $order)
{
- //TODO tous les paramètres ne sont pas utilisés, à corriger
$qb = $this->createQueryBuilder('e')
->select('e')
->where('e.userId =:userId')->setParameter('userId', $userId);
$qb->andWhere('e.isDeleted =:isDeleted')->setParameter('isDeleted', $isDeleted);
}
+ if ('created' === $sort) {
+ $qb->orderBy('e.createdAt', $order);
+ } elseif ('updated' === $sort) {
+ $qb->orderBy('e.updatedAt', $order);
+ }
+
return $qb
->getQuery()
->getResult(Query::HYDRATE_ARRAY);