Compare commits

...

1274 Commits

Author SHA1 Message Date
a45f644148 Release wallabag 2.0.0-alpha.2 2016-01-22 11:37:17 +01:00
6c32aaae95 Merge pull request #1614 from wallabag/v2-few-fixes
Few fixes
2016-01-22 09:36:50 +01:00
23afdf3a70 CS 2016-01-22 08:01:32 +01:00
a3cac44c78 Add for deleting rule from an other user 2016-01-22 08:01:17 +01:00
0f0e8eb82a Use FOSUserEvents instead of c/p a controller
The `resetAction` was overriden to redirect user to the homepage instead of `fos_user_profile_show`.
Instead of copying the whole method we can simply use FOSUserEvents to handle that.
2016-01-21 16:39:13 +01:00
a0d6ccc5ca Fix bad type after using findByUrlAndUserId
It returns an object since few commits this part of (untested) code still use an array.
Also add test for that part of code.
2016-01-21 16:37:25 +01:00
e56983af1f Fix bad redirection when adding a new user 2016-01-21 16:36:30 +01:00
27ea492cf7 Add tests on TagAllCommand
Some simple tests
2016-01-21 16:36:17 +01:00
7a0e6970b4 Use PHP7 random_bytes to generate RSS Token
random_bytes is a PHP 7 function wich has been ported to PHP 5 using paragonie/random_compat
2016-01-21 16:35:41 +01:00
9aa66d6244 Merge pull request #1565 from wallabag/v2-2fa-html
Use HTML email for 2FA
2016-01-21 12:27:47 +01:00
abd454c456 Update HTML 2FA template
Split paragraph in translation
Inject wallabag_url for image in HTML template
Remove username & password from config_dev.yml (null are already the default value)
2016-01-21 11:03:27 +01:00
5f736213af #1490 HTML in E-Mails 2016-01-21 11:03:27 +01:00
d1f1333f48 CS 2016-01-21 11:03:27 +01:00
7ce895bf5e Use HTML email for 2FA
Related to #1490
2016-01-21 11:03:27 +01:00
e72a943ad2 Merge pull request #1610 from wallabag/v2-composer-lock-release
Disable xdebug all the time
2016-01-21 11:02:18 +01:00
3ee1582e60 Disable xdebug all the time
Use travis_wait to avoid travis timeout on `composer up`
Jump to `memory_limit -1` for `composer up`
Also, since composer.lock is ignored, we can remove it.
2016-01-21 09:29:14 +01:00
eff6a406f3 Merge pull request #1606 from wallabag/v2-tag-cascade
Remove tag relation when removing an entry
2016-01-21 08:38:37 +01:00
ff1c7d16be Merge pull request #1607 from wallabag/v2-composer-lock
Ignore composer.lock
2016-01-21 08:28:52 +01:00
173629a400 Ignore composer.lock
Having a big composer.lock on a final project can have side effect on incoming PR that add a new vendor.
Mostly because conflict are too frequent.

By ignoring composer.lock we ease the PR submission and rebase.

BUT we need to be careful when we release a new version of wallabag. We should manually `git add -f composer.lock` to update it.

Since composer.lock will no longer be commited I switch the `composer install` to a `composer up` in the travis configuration.
2016-01-20 18:49:45 +01:00
7e80861588 Remove tag relation when removing an entry
Fix #1453
2016-01-20 18:35:57 +01:00
d481f42b7d Merge pull request #1599 from wallabag/v2-fix-pt-documentation
Add configuration for portuguese documentation
2016-01-20 13:00:43 +01:00
acc0160c29 Add configuration for portuguese documentation 2016-01-20 12:54:19 +01:00
3a59d13fd1 Merge pull request #1594 from araujo0205/patch-1
Create index.rst
2016-01-20 12:09:18 +01:00
e1101bee83 Create index.rst 2016-01-19 16:01:28 -02:00
3080a4afa4 Merge pull request #1587 from wallabag/v2-translator
Use translator interface instead of final class
2016-01-18 09:16:01 +01:00
e678c4752a Use translator interface instead of final class
Symfony use a different class when in dev mode and prod mode.

Prod loads `Symfony\Bundle\FrameworkBundle\Translation\Translator`.
Dev loads `Symfony\Component\Translation\DataCollectorTranslator` to gather information for the debug bar.

Fix #1585
2016-01-17 12:56:04 +01:00
3bcc4d4cb2 Merge pull request #1584 from wallabag/v2-cleanup
some cleanup
2016-01-15 16:29:06 +01:00
160e2d8f0b some cleanup:
* move capistrano config files
* remove useless files
2016-01-15 16:07:57 +01:00
f902d78153 Merge pull request #1564 from wallabag/v2-remove-flattr
Remove Flattr references
2016-01-15 16:01:13 +01:00
86719c63bf Merge pull request #1583 from wallabag/v2-fix-delete
Fix `findOneByUrl` side effect in tests
2016-01-15 15:47:13 +01:00
b91465c067 remove flattr on about page 2016-01-15 15:46:46 +01:00
1930c19d82 Merge pull request #1524 from wallabag/sf2.8
Upgrade to Symfony 3.0
2016-01-15 15:38:31 +01:00
7883367246 Fix findOneByUrl side effect in tests
Fix #1566
2016-01-15 15:28:32 +01:00
790573d458 Merge pull request #1560 from wallabag/v2-quickstart
Fix #1501 Quickstart for beginners
2016-01-15 15:21:43 +01:00
5c072d2b57 Quickstart for beginners 2016-01-15 15:01:30 +01:00
131eaa3e94 Update graby stuff 2016-01-15 11:05:51 +01:00
c7f622d369 Update readme & fix console permission 2016-01-15 09:36:32 +01:00
1fc8ed8794 Last deps update 2016-01-15 09:35:39 +01:00
d8dbe76bf5 Add assets config
To avoid :
> Twig_Error_Syntax: Unknown "asset" function in
2016-01-15 09:35:39 +01:00
ccf50a9fd8 Update path in build file 2016-01-15 09:35:39 +01:00
31e33fc42e Update to Symfony 3.0.x 2016-01-15 09:35:39 +01:00
73cd160bfc Switch to Symfony 3 structure 2016-01-15 09:35:39 +01:00
1d405d0e62 Remove some commented code 2016-01-15 09:35:39 +01:00
c38d27d421 Update to friendsofsymfony/oauth-server-bundle@1.5.0-BETA 2016-01-15 09:35:39 +01:00
27e475a941 Fix Pocket generateUrl parameters 2016-01-15 09:35:38 +01:00
6108b0f26c Update deps
LexikFormFilterBundle & RulerZBundle are now Symfony 3 compatible

There are still some issue with FOSOAuthServerBundle
2016-01-15 09:35:38 +01:00
1d76102a24 Fix recent update
- some missing url parameters from WallabagRestController & EntryController
- use a service for `EntryFilterType` to use fully qualified name instead (so changing class signature)
- update ImportBundle (url & form)
2016-01-15 09:35:38 +01:00
8ba854c068 TwoFactorBundle -> 2.0 2016-01-15 09:35:38 +01:00
b4faefc04d Switch to psr-4 2016-01-15 09:35:38 +01:00
5c895a7fd1 Update bundle & stock file
- update stock file (AppKernel, app.php, etc ..) from SymfonyStandard edition)
- update bundle to latest release
- remove security on profiler
2016-01-15 09:35:38 +01:00
619cc45359 Symfony Upgrade Fixer FTW
symfony-upgrade-fixer fix src/Wallabag/
2016-01-15 09:35:38 +01:00
516022d60e Improve composer.json
Following great article from Jordi: http://seld.be/notes/new-composer-patterns

Changelogs summary:

 - paragonie/random_compat updated from 1.1.1 to 1.1.4
   See changes: https://github.com/paragonie/random_compat/compare/1.1.1...1.1.4
   Release notes: https://github.com/paragonie/random_compat/releases/tag/1.1.4

 - doctrine/cache updated from v1.5.2 to v1.5.4
   See changes: https://github.com/doctrine/cache/compare/v1.5.2...v1.5.4
   Release notes: https://github.com/doctrine/cache/releases/tag/v1.5.4

 - sensio/framework-extra-bundle updated from v3.0.11 to v3.0.12
   See changes: https://github.com/sensiolabs/SensioFrameworkExtraBundle/compare/v3.0.11...v3.0.12
   Release notes: https://github.com/sensiolabs/SensioFrameworkExtraBundle/releases/tag/v3.0.12

 - nelmio/cors-bundle updated from 1.4.0 to 1.4.1
   See changes: https://github.com/nelmio/NelmioCorsBundle/compare/1.4.0...1.4.1
   Release notes: https://github.com/nelmio/NelmioCorsBundle/releases/tag/1.4.1

 - friendsofsymfony/rest-bundle updated from 1.7.4 to 1.7.6
   See changes: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/1.7.4...1.7.6
   Release notes: https://github.com/FriendsOfSymfony/FOSRestBundle/releases/tag/1.7.6

 - nelmio/api-doc-bundle updated from 2.11.0 to 2.11.1
   See changes: https://github.com/nelmio/NelmioApiDocBundle/compare/2.11.0...2.11.1
   Release notes: https://github.com/nelmio/NelmioApiDocBundle/releases/tag/2.11.1

 - neitanod/forceutf8 updated from v1.5 to v2.0
   See changes: https://github.com/neitanod/forceutf8/compare/v1.5...v2.0
   Release notes: https://github.com/neitanod/forceutf8/releases/tag/v2.0

 - j0k3r/graby-site-config updated from 1.0.9 to 1.0.10
   See changes: https://github.com/j0k3r/graby-site-config/compare/1.0.9...1.0.10
   Release notes: https://github.com/j0k3r/graby-site-config/releases/tag/1.0.10

 - j0k3r/graby updated from 1.0.6 to 1.0.7
   See changes: https://github.com/j0k3r/graby/compare/1.0.6...1.0.7
   Release notes: https://github.com/j0k3r/graby/releases/tag/1.0.7

 - sebastian/diff updated from 1.4.0 to 1.4.1
   See changes: https://github.com/sebastianbergmann/diff/compare/1.4.0...1.4.1
   Release notes: https://github.com/sebastianbergmann/diff/releases/tag/1.4.1

 - phpunit/phpunit updated from 4.8.19 to 4.8.21
   See changes: https://github.com/sebastianbergmann/phpunit/compare/4.8.19...4.8.21
   Release notes: https://github.com/sebastianbergmann/phpunit/releases/tag/4.8.21

 - kphoen/rulerz updated from 0.16.1 to 0.16.2
   See changes: https://github.com/K-Phoen/rulerz/compare/0.16.1...0.16.2
   Release notes: https://github.com/K-Phoen/rulerz/releases/tag/0.16.2
2016-01-15 09:35:37 +01:00
bd2c8b4677 Wallabag now require PHP >= 5.5
See https://github.com/K-Phoen/rulerz/pull/21/files#diff-b5d0ee8c97c7abd7e3fa29b9a27d1780
2016-01-15 09:35:37 +01:00
30a40b0298 Remove weak deprecation 💥 2016-01-15 09:35:37 +01:00
e23edfd287 Update deps
Changelogs summary:

 - doctrine/cache updated from v1.5.1 to v1.5.2
   See changes: https://github.com/doctrine/cache/compare/v1.5.1...v1.5.2
   Release notes: https://github.com/doctrine/cache/releases/tag/v1.5.2

 - doctrine/common updated from v2.5.1 to v2.5.2
   See changes: https://github.com/doctrine/common/compare/v2.5.1...v2.5.2
   Release notes: https://github.com/doctrine/common/releases/tag/v2.5.2

 - symfony/polyfill-mbstring installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-mbstring/releases/tag/v1.0.0

 - symfony/polyfill-util installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-util/releases/tag/v1.0.0

 - paragonie/random_compat installed in version 1.1.1
   Release notes: https://github.com/paragonie/random_compat/releases/tag/1.1.1

 - symfony/polyfill-php70 installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-php70/releases/tag/v1.0.0

 - symfony/polyfill-php56 installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-php56/releases/tag/v1.0.0

 - ircmaxell/password-compat installed in version v1.0.4
   Release notes: https://github.com/ircmaxell/password_compat/releases/tag/v1.0.4

 - symfony/polyfill-php55 installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-php55/releases/tag/v1.0.0

 - symfony/polyfill-php54 installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-php54/releases/tag/v1.0.0

 - symfony/polyfill-intl-icu installed in version v1.0.0
   Release notes: https://github.com/symfony/polyfill-intl-icu/releases/tag/v1.0.0

 - symfony/symfony updated from v2.7.7 to v2.8.0
   See changes: https://github.com/symfony/symfony/compare/v2.7.7...v2.8.0
   Release notes: https://github.com/symfony/symfony/releases/tag/v2.8.0

 - symfony/security-acl installed in version v2.7.7
   Release notes: https://github.com/symfony/security-acl/releases/tag/v2.7.7

 - doctrine/orm updated from v2.5.1 to v2.5.2
   See changes: https://github.com/doctrine/doctrine2/compare/v2.5.1...v2.5.2
   Release notes: https://github.com/doctrine/doctrine2/releases/tag/v2.5.2

 - kriswallsmith/assetic updated from v1.3.1 to v1.3.2
   See changes: https://github.com/kriswallsmith/assetic/compare/v1.3.1...v1.3.2
   Release notes: https://github.com/kriswallsmith/assetic/releases/tag/v1.3.2

 - symfony/assetic-bundle updated from v2.7.0 to v2.7.1
   See changes: https://github.com/symfony/assetic-bundle/compare/v2.7.0...v2.7.1
   Release notes: https://github.com/symfony/assetic-bundle/releases/tag/v2.7.1

 - symfony/swiftmailer-bundle updated from v2.3.8 to v2.3.9
   See changes: https://github.com/symfony/swiftmailer-bundle/compare/v2.3.8...v2.3.9
   Release notes: https://github.com/symfony/swiftmailer-bundle/releases/tag/v2.3.9

 - symfony/monolog-bundle updated from 2.8.1 to v2.8.2
   See changes: https://github.com/symfony/monolog-bundle/compare/2.8.1...v2.8.2
   Release notes: https://github.com/symfony/monolog-bundle/releases/tag/v2.8.2

 - sensio/distribution-bundle updated from v3.0.33 to v3.0.34
   See changes: https://github.com/sensiolabs/SensioDistributionBundle/compare/v3.0.33...v3.0.34
   Release notes: https://github.com/sensiolabs/SensioDistributionBundle/releases/tag/v3.0.34

 - friendsofsymfony/rest-bundle updated from 1.7.2 to 1.7.4
   See changes: https://github.com/FriendsOfSymfony/FOSRestBundle/compare/1.7.2...1.7.4
   Release notes: https://github.com/FriendsOfSymfony/FOSRestBundle/releases/tag/1.7.4

 - nelmio/api-doc-bundle updated from 2.10.3 to 2.11.0
   See changes: https://github.com/nelmio/NelmioApiDocBundle/compare/2.10.3...2.11.0
   Release notes: https://github.com/nelmio/NelmioApiDocBundle/releases/tag/2.11.0

 - j0k3r/graby-site-config updated from 1.0.6 to 1.0.9
   See changes: https://github.com/j0k3r/graby-site-config/compare/1.0.6...1.0.9
   Release notes: https://github.com/j0k3r/graby-site-config/releases/tag/1.0.9

 - j0k3r/safecurl updated from v1.1.1 to 2.0.2
   See changes: https://github.com/j0k3r/safecurl/compare/v1.1.1...2.0.2
   Release notes: https://github.com/j0k3r/safecurl/releases/tag/2.0.2

 - j0k3r/graby updated from 1.0.4 to 1.0.6
   See changes: https://github.com/j0k3r/graby/compare/1.0.4...1.0.6
   Release notes: https://github.com/j0k3r/graby/releases/tag/1.0.6

 - scheb/two-factor-bundle updated from v1.4.7 to v1.5.0
   See changes: https://github.com/scheb/two-factor-bundle/compare/v1.4.7...v1.5.0
   Release notes: https://github.com/scheb/two-factor-bundle/releases/tag/v1.5.0

 - sebastian/recursion-context updated from 1.0.1 to 1.0.2
   See changes: https://github.com/sebastianbergmann/recursion-context/compare/1.0.1...1.0.2
   Release notes: https://github.com/sebastianbergmann/recursion-context/releases/tag/1.0.2

 - sebastian/environment updated from 1.3.2 to 1.3.3
   See changes: https://github.com/sebastianbergmann/environment/compare/1.3.2...1.3.3
   Release notes: https://github.com/sebastianbergmann/environment/releases/tag/1.3.3

 - sebastian/diff updated from 1.3.0 to 1.4.0
   See changes: https://github.com/sebastianbergmann/diff/compare/1.3.0...1.4.0
   Release notes: https://github.com/sebastianbergmann/diff/releases/tag/1.4.0

 - phpunit/phpunit updated from 4.8.18 to 4.8.19
   See changes: https://github.com/sebastianbergmann/phpunit/compare/4.8.18...4.8.19
   Release notes: https://github.com/sebastianbergmann/phpunit/releases/tag/4.8.19

 - symfony/phpunit-bridge updated from v2.7.7 to v2.8.0
   See changes: https://github.com/symfony/phpunit-bridge/compare/v2.7.7...v2.8.0
   Release notes: https://github.com/symfony/phpunit-bridge/releases/tag/v2.8.0

 - doctrine/doctrine-cache-bundle updated from 1.2.1 to 1.2.2
   See changes: https://github.com/doctrine/DoctrineCacheBundle/compare/1.2.1...1.2.2
   Release notes: https://github.com/doctrine/DoctrineCacheBundle/releases/tag/1.2.2

 - doctrine/doctrine-bundle updated from v1.5.2 to 1.6.1
   See changes: https://github.com/doctrine/DoctrineBundle/compare/v1.5.2...1.6.1
   Release notes: https://github.com/doctrine/DoctrineBundle/releases/tag/1.6.1

 - phpzip/phpzip updated from 2.0.7 to 2.0.8
   See changes: https://github.com/Grandt/PHPZip/compare/2.0.7...2.0.8
   Release notes: https://github.com/Grandt/PHPZip/releases/tag/2.0.8

 - kphoen/rulerz updated from 0.14.0 to 0.16.1
   See changes: https://github.com/K-Phoen/rulerz/compare/0.14.0...0.16.1
   Release notes: https://github.com/K-Phoen/rulerz/releases/tag/0.16.1

 - friendsofsymfony/user-bundle updated from dev-master to dev-master
   See changes: 45d6f40...e39b040
2016-01-15 09:35:37 +01:00
9ee44a109a Merge pull request #1574 from jjanvier/readme
Fix typo and set version in the README
2016-01-14 07:50:55 +01:00
6663d49329 Fix typo and set version in the README 2016-01-14 00:47:17 +01:00
0aafb8dfcb Merge pull request #1561 from FabienM/docker-compose
Add basic docker-compose configuration
2016-01-11 09:08:39 +01:00
8b909e7ea7 Add documentation to run docker-compose 2016-01-10 15:01:20 +01:00
1d41effebc Add Docker configuration for Postgres and MariaDB 2016-01-10 15:01:11 +01:00
540ef5e084 Add basic docker-compose configuration 2016-01-10 14:41:42 +01:00
4aa2997106 Merge pull request #1563 from wallabag/v2-fix-1394
#1394 Fixed 'mark as read' and 'mark as unread' links
2016-01-10 10:20:16 +01:00
c60b549313 Merge pull request #1562 from wallabag/v2-add-import-baggy
add import link on baggy theme
2016-01-10 10:17:27 +01:00
6c9bad13e1 Fixed 'mark as read' and 'mark as unread' links 2016-01-09 22:20:19 +01:00
da82839bf8 add import link on baggy theme 2016-01-09 20:33:09 +01:00
5ad863c63a Merge pull request #1558 from wallabag/v2-documentation
[v2] documentation cleaning
2016-01-09 17:33:27 +01:00
1caf557de7 Merge pull request #1559 from wallabag/v2-doctrine-migrations
Installation & configuration of Doctrine Migrations
2016-01-09 14:43:06 +01:00
e1b9f4fb37 Update deps
Changelogs summary:

 - doctrine/dbal updated from v2.5.3 to v2.5.4
   See changes: https://github.com/doctrine/dbal/compare/v2.5.3...v2.5.4
   Release notes: https://github.com/doctrine/dbal/releases/tag/v2.5.4

 - doctrine/orm updated from v2.5.3 to v2.5.4
   See changes: https://github.com/doctrine/doctrine2/compare/v2.5.3...v2.5.4
   Release notes: https://github.com/doctrine/doctrine2/releases/tag/v2.5.4

 - nelmio/api-doc-bundle updated from 2.11.1 to 2.11.2
   See changes: https://github.com/nelmio/NelmioApiDocBundle/compare/2.11.1...2.11.2
   Release notes: https://github.com/nelmio/NelmioApiDocBundle/releases/tag/2.11.2

 - friendsofsymfony/user-bundle updated from dev-master to dev-master
   See changes: e5e7a2b...6ccff96
2016-01-09 14:24:09 +01:00
a42938f42c documentation cleaning 2016-01-09 13:50:45 +01:00
292c1324e9 Installation & configuration of Doctrine Migrations 2016-01-08 16:27:29 +01:00
39643c6b76 Merge pull request #1493 from wallabag/v2-pocket-import
v2 – 1st draft for Pocket import via API & Wallabag v1 import
2016-01-07 22:15:08 +01:00
b88cf91fc8 updated tests 2016-01-07 21:00:04 +01:00
488a468e3e Merge pull request #1553 from wallabag/v2-hide-export-button
Hide export button if we are not on entries list
2016-01-06 21:25:41 +01:00
10b2411c10 Hide export button if we are not on entries list 2016-01-06 07:47:09 +01:00
d1af8ad4db Added french translations 2016-01-05 22:38:09 +01:00
8eedc8cfac Few phpDoc fix
And some little mistakes
2016-01-03 11:15:44 +01:00
c5c7f90a81 Fix tag related test for Pocket 2016-01-03 10:32:56 +01:00
5b2b5858fe Update deps 2016-01-02 23:31:41 +01:00
6d7c7a6e3f Remove real consumer key
We should never commit them :)
2016-01-02 23:27:41 +01:00
7019c7cf6c Add tagged services for import
- list services in /import
- add url to import service
- ImportBundle routing are now prefixed by /import
- optimize flush in each import (flushing each 20 contents)
- improve design of each import
- add more tests
2016-01-02 23:27:41 +01:00
b1d05721cf Rewrote Wallabag v1 import 2016-01-02 23:27:41 +01:00
252ebd6071 Rewrote Pocket Import
For the moment, we won't do a queue system, just a plain synchronous import.
We also use ContentProxy to grab content for each article from Pocket.
Error from Pocket are now logged using the logger.
The ImportInterface need to be simple and not related to oAuth (not all import will use that method).
2016-01-02 23:27:41 +01:00
b4b592a0c0 Fix the way to check for an existing entry
Instead of requiring more than 1 entry (> 1) we have to check for at least one entry (> 0)
2016-01-02 23:27:41 +01:00
77a7752a59 Update after previous merge
PR #1443 was merged into this branch to handle all import type in the same place.
2016-01-02 23:27:41 +01:00
7ec2897ee0 First test on PocketImport
Giving ability to define the Client add abitliy to easliy test the import.
2016-01-02 23:27:41 +01:00
0aa344dc24 Update url & service name
Prefix ur with service namel: [service]_[route name]
Add comment in Interface
2016-01-02 23:27:41 +01:00
5a4bbcc9a7 Change the way to check for an existing entry
The repository method return the entry found or false if nothing exists.
2016-01-02 23:27:41 +01:00
27a8708b67 Update deps 2016-01-02 23:27:41 +01:00
303768dfe9 - remove importers configuration
- add check on userId for findOneByURL for entries
2016-01-02 23:27:41 +01:00
dda57bb944 fix #1502 avoid duplicate entry and store pocket url in config 2016-01-02 23:24:17 +01:00
87f23b005c assign tags to entries and add lastPocketImport attribute to user 2016-01-02 23:24:17 +01:00
d51b38ed30 create ImportController to list importers 2016-01-02 23:24:17 +01:00
557e549db7 service call 2016-01-02 23:24:17 +01:00
9c9c23cf08 forgot test parameters 2016-01-02 23:24:17 +01:00
ff7b031d57 refactor pocket import 2016-01-02 23:24:17 +01:00
1f4408de9e 1st draft for Pocket import via API 2016-01-02 23:24:17 +01:00
10b40f85d6 add docs for Import feature 2016-01-02 23:24:17 +01:00
d275bdf4d3 form to upload file 2016-01-02 23:24:17 +01:00
8c3c77c1bd create controller to launch import command 2016-01-02 23:24:17 +01:00
a1bb1b3c2a userId is now set in parameters 2016-01-02 23:24:17 +01:00
56ea1de99b first draft for json import, needed for wallabag v1 migration 2016-01-02 23:24:17 +01:00
dad1c546a5 Merge pull request #1545 from wallabag/v2-user-tag
v2 – Remove user reference in tag
2016-01-02 12:46:52 +01:00
5432f61509 Merge pull request #1546 from wallabag/v2-reload-content
v2 – Ability to reload an entry
2016-01-02 12:46:09 +01:00
00a051add4 Merge pull request #1547 from wallabag/v2-mistakes
v2 – Fix wrong if when deleting an entry
2016-01-02 12:45:08 +01:00
e82160e5e9 Fix wrong if when deleting an entry
Bad condition when deleting an entry returned `true` instead of the referer url
2015-12-30 11:32:53 +01:00
0cf434c00f Backport all icomoon from v1
And add a reload icon
2015-12-30 09:53:52 +01:00
831b02aaf2 Ability to reload an entry
Could be useful when we want to update the content or when the content failed to be fetched.

Fix #1503
2015-12-30 09:41:17 +01:00
6be9750155 Removed comment
And move the SQL query inside the php doc
2015-12-29 21:59:34 +01:00
e6a228c43b Merge pull request #1544 from wallabag/2fa-email
v2 – Add custom email for 2FA
2015-12-29 20:32:58 +01:00
4059a061c0 Fix the way to remove a tag from all user entries 2015-12-29 15:43:32 +01:00
1bb1939ab7 Cleanup tests
- WallabagRestController: remove the tag deletion from the API since we can't remove a tag now, we only remove reference to entries
- RuleBasedTaggerTest: remove workaround for asserting tag are equal since problem was related to mock expects (_call instead of findOneByLabel which was removed from the tag repository)
2015-12-29 15:04:46 +01:00
01fddd0cb2 Fix parameters regarding documentation
Parameters are `star` & `archived`, not `is_starred` & `is_archived`
2015-12-29 14:54:55 +01:00
fc73222723 Remove user reference in tag
Fix #1543
2015-12-29 14:50:52 +01:00
ab64c3d9ac PHP 7.0 must not fail 2015-12-29 11:41:35 +01:00
23ff8d3619 Add custom email for 2FA
Related #1490
2015-12-29 11:17:06 +01:00
c997cfcc9c Merge pull request #1540 from wallabag/v2-fix-delete
v2 – 	Don't redirect to the content page after deletion
2015-12-28 13:51:48 +01:00
2863bf2ab5 Don't redirect to the content page after deletion
Fix #1512

We generate the url of the removed content and compare it to the referer url. If they matche, we redirect user to the homepage otherwise to the referer url.
2015-12-28 13:42:50 +01:00
71eff67f8b Entry data should have unique url 2015-12-28 13:42:50 +01:00
d25b828821 Merge pull request #1542 from wallabag/v2-avoid-duplicate-tag
v2 – 	Avoid multiple tag creation
2015-12-28 13:37:13 +01:00
e9fa8c40aa Add test on tagAllForUser
And fix multiplication of entries returned by `tagAllForUser`.
2015-12-28 13:20:48 +01:00
fc031e5706 Avoid multiple tag creation
When a new tag is created but not yet persisted, it can be duplicated.
It could happen when multiple rules match the content and at least 2 of them should attach same new tag.

Fix #1528
2015-12-28 13:20:48 +01:00
82899c0402 Merge pull request #1488 from wallabag/v2-slug-tags
Slug for tags
2015-12-28 13:12:30 +01:00
3c65dfb735 add slug for tags 2015-12-28 12:49:45 +01:00
22c1d29b89 Merge pull request #1537 from bdunogier/update_lock
Updated composer.lock
2015-12-24 08:37:27 +01:00
d4aa174367 Updated composer.lock
Had to restrict scheb/two-factor-bundle to ~1.4.0 because of a circular service reference.
See https://github.com/scheb/two-factor-bundle/issues/33.

Also updated php version requirement to 5.5.0.
2015-12-23 22:49:03 +01:00
da2240f9d4 Merge pull request #1529 from wallabag/v2-taggingrule-tablename
changed table name for tagging rule
2015-12-08 09:35:27 +01:00
347fa6beb0 php cs 2015-12-08 09:20:03 +01:00
c5d0db8b71 changed table name for tagging rule 2015-12-08 09:05:56 +01:00
a7f1921f7d Merge pull request #1478 from K-Phoen/rule-based-tags
Rule based tags
2015-12-06 14:31:26 +01:00
2e15e30bf0 Merge pull request #1523 from wallabag/tcitworld-patch-1
Typo
2015-12-04 06:43:40 +01:00
a24c1ee30a Typo 2015-12-04 00:17:07 +01:00
f4b617f2ff Merge pull request #1518 from mathbruyen/smtp-from-env
Set SMTP from environment variables
2015-12-03 08:43:40 +01:00
752b90d1f2 Fix tagging rules ordering 2015-11-29 16:19:02 +01:00
59507c5b24 SMTP configuration through environment
Configuring SMTP parameters required to be written in files which is not
convenient when using docker containers as the credentials need to be in
the filesystem.

Created environment parameters override for those parameters. A new build
script created in order to generate those parameters right before
launching the application.
2015-11-26 10:44:03 +01:00
c13eda461f Clean the tagging rule creation form 2015-11-16 14:01:43 +01:00
69edb774eb Assert that the tag has is the good one 2015-11-16 13:34:00 +01:00
958671a7ae Add a quick test 2015-11-13 22:53:28 +01:00
aeff8aa765 Document the matches operator in the FAQ 2015-11-13 20:57:46 +01:00
f27aca26f6 Add phpdoc for all Matches implementations 2015-11-13 20:50:09 +01:00
a6e27f7466 Add matches operator 2015-11-13 14:37:58 +01:00
5c514b0be3 Improve the tagging rules documentation 2015-11-11 17:06:36 +01:00
b7b2005494 Fix the creation of the repository services 2015-11-11 16:44:57 +01:00
6cbbf1481a Update rulerz-bundle 2015-11-11 16:39:28 +01:00
0c5bcd82ba Use Psr\Log\NullLogger instead of creating a mock 2015-11-11 16:27:53 +01:00
7b1648961d Fix incorrect comment. 2015-11-11 16:27:19 +01:00
8a99c7a86b Add a few functional tests for the tagging rules creation form 2015-11-11 16:27:19 +01:00
9b88658c04 Update baggy theme 2015-11-11 16:27:19 +01:00
52e423f307 Provide a way to delete tagging rules 2015-11-11 16:27:19 +01:00
625acf3352 Add a command to automatically tag all entries for a user 2015-11-11 16:27:19 +01:00
cad8cda7af Use a tagged version of kphoen/rulerz-bundle 2015-11-11 16:25:44 +01:00
c23fc05df8 Validate used operators when creating tagging rules 2015-11-11 16:23:49 +01:00
5a166c5c1a Add tests for the RuleBasedTagger class 2015-11-11 16:23:49 +01:00
1c9cd2a7f0 Errors in the automatic tagging do not prevent the entry from being added 2015-11-11 16:23:49 +01:00
1dc4e5da2e Also validate used variables when creating tagging rules 2015-11-11 16:23:49 +01:00
3447d1ee07 Add naïve validation for tagging rules (only checks the syntax) 2015-11-11 16:23:49 +01:00
71ef0ed254 Rename the « Tags » tab to « Tagging rules » 2015-11-11 16:23:49 +01:00
003fa77438 Add tests for the StringToListTransformer class 2015-11-11 16:23:49 +01:00
f530f7f5e1 Fix ContentProxyTest 2015-11-11 16:23:49 +01:00
1d7b350b25 Add missing use statement 2015-11-11 16:23:49 +01:00
e9fbd2d12e Add a table explaining the available variables 2015-11-11 16:23:49 +01:00
981cacf7b9 Display the tagging rules in the config 2015-11-11 16:23:49 +01:00
9cbb404b4a Add missing tagging rule repository 2015-11-11 16:23:49 +01:00
f19f9f62d1 Add a form to create tagging rules 2015-11-11 16:23:49 +01:00
ac9fec610a Add TaggingRule entity 2015-11-11 16:23:49 +01:00
c3510620ad PoC of rule-based tagging 2015-11-11 16:23:49 +01:00
0a0c600887 Merge pull request #1422 from wallabag/v2-ebook
V2 – Export entries
2015-11-09 16:45:48 +01:00
16bbb4aa41 Update deps 2015-11-09 16:35:09 +01:00
fba3f536a5 Fix tests 2015-11-09 16:32:48 +01:00
cceca9ea1d Fix route parameters
Improve export tests
Improve CSV export
2015-11-09 16:32:48 +01:00
268e9e7277 use JMS Serializer 2015-11-09 16:32:48 +01:00
5b7da07620 use the groups annotation instead of setIgnoredAttributes 2015-11-09 16:32:48 +01:00
8ac95cbfcc improved function 2015-11-09 16:32:48 +01:00
b3cc1a14e7 add json & xml 2015-11-09 16:32:48 +01:00
33c36f6b48 Fix tests on pgsql 2015-11-09 16:32:48 +01:00
add597bad9 Rework on export
- all export now return a `HttpFoundation\Response`
- return a 404 on unsupported format
- add tests
2015-11-09 16:32:48 +01:00
03690d1387 Start work on export
For now:
 - ebook
 - mobi
 - pdf
 - csv
2015-11-09 16:32:48 +01:00
f1eccfd63f Merge pull request #1500 from wallabag/v2-quote-pgsql
Fix quote strategy for reserved keyword in Postgres
2015-11-09 16:31:59 +01:00
53cf510689 Lock DoctrineBundle to 1.5.2
Because of a bad change, SQLite database cannot be created anymore.

➡️ https://github.com/doctrine/DoctrineBundle/pull/434
2015-11-08 10:47:56 +01:00
970e0e994f Remove duplicate comments 2015-11-07 14:18:38 +01:00
75c48e3ae0 CS 2015-11-07 14:16:13 +01:00
d502762598 Skipping PostgreSQL test that drop database
For a not-clear reason, I can't properly drop the current database. Even if Doctrine made a special case for that (https://github.com/doctrine/dbal/pull/849).

So instead of trying crazy things to achieve the test, better way is to skip test (too much wasted days ..)
2015-11-07 14:16:13 +01:00
8a493541fa Re-enable test on doctrine command
It will slow down the whole test suite (because it'll use doctrine command).
Remove unecessary `KernelTestCase`.
Also rename `AbstractControllerTest` to `WallabagApiTestCase` for consistency.
2015-11-07 14:16:13 +01:00
735068d181 Add tests on TablePrefixSubscriber 2015-11-07 14:15:33 +01:00
bd0f3d32c9 Quoted entity to avoid reserved keyword
Should fix #1498
2015-11-07 14:15:33 +01:00
54a2241e13 Fix database already exist detection
This is not the same message exception from MySQL & SQLite with Postgres.
2015-11-07 14:15:33 +01:00
4529d0f4b6 Merge pull request #1510 from wallabag/v2-sf3
v2 – Fix some deprecated for Symfony3
2015-11-07 13:39:30 +01:00
164d260c49 CS
Also force SYMFONY_DEPRECATIONS_HELPER for travis
2015-11-07 00:27:41 +01:00
b2a903feef Avoid other bundle deprecation to cancel the build 2015-11-07 00:18:46 +01:00
33fe61f92f Fix form_enctype deprecation
Use form_start instead
2015-11-07 00:18:06 +01:00
18f8f32f70 Fix security.context deprecation 2015-11-07 00:17:37 +01:00
5ead137fe6 Fix pattern deprecation
Replaced by path
2015-11-07 00:16:26 +01:00
78507d2835 Fix deprecated helper in command 2015-11-06 23:39:19 +01:00
872384b0c1 Update deps & add PHPUnit Bridge
Changelogs summary:

 - symfony/phpunit-bridge installed in version v2.7.6
   Release notes: https://github.com/symfony/phpunit-bridge/releases/tag/v2.7.6

 - twig/twig updated from v1.23.0 to v1.23.1
   See changes: https://github.com/twigphp/Twig/compare/v1.23.0...v1.23.1
   Release notes: https://github.com/twigphp/Twig/releases/tag/v1.23.1

 - doctrine/inflector updated from v1.0.1 to v1.1.0
   See changes: https://github.com/doctrine/inflector/compare/v1.0.1...v1.1.0
   Release notes: https://github.com/doctrine/inflector/releases/tag/v1.1.0

 - doctrine/cache updated from v1.5.0 to v1.5.1
   See changes: https://github.com/doctrine/cache/compare/v1.5.0...v1.5.1
   Release notes: https://github.com/doctrine/cache/releases/tag/v1.5.1

 - doctrine/doctrine-cache-bundle updated from v1.0.1 to 1.2.1
   See changes: https://github.com/doctrine/DoctrineCacheBundle/compare/v1.0.1...1.2.1
   Release notes: https://github.com/doctrine/DoctrineCacheBundle/releases/tag/1.2.1

 - doctrine/doctrine-bundle updated from v1.5.2 to 1.6.0
   See changes: https://github.com/doctrine/DoctrineBundle/compare/v1.5.2...1.6.0
   Release notes: https://github.com/doctrine/DoctrineBundle/releases/tag/1.6.0

 - friendsofsymfony/user-bundle updated from dev-master to dev-master
   See changes: d5b28c3...45d6f40
2015-11-06 23:39:14 +01:00
3d9ccf9390 Merge pull request #1505 from wallabag/v2-graby-log
Add graby log
2015-11-02 07:52:28 +01:00
386cd24663 Update deps
Changelogs summary:

 - twig/twig updated from v1.22.3 to v1.23.0
   See changes: https://github.com/twigphp/Twig/compare/v1.22.3...v1.23.0
   Release notes: https://github.com/twigphp/Twig/releases/tag/v1.23.0

 - doctrine/cache updated from v1.4.2 to v1.5.0
   See changes: https://github.com/doctrine/cache/compare/v1.4.2...v1.5.0
   Release notes: https://github.com/doctrine/cache/releases/tag/v1.5.0

 - symfony/symfony updated from v2.7.5 to v2.7.6
   See changes: https://github.com/symfony/symfony/compare/v2.7.5...v2.7.6
   Release notes: https://github.com/symfony/symfony/releases/tag/v2.7.6

 - sensio/distribution-bundle updated from v3.0.31 to v3.0.33
   See changes: https://github.com/sensiolabs/SensioDistributionBundle/compare/v3.0.31...v3.0.33
   Release notes: https://github.com/sensiolabs/SensioDistributionBundle/releases/tag/v3.0.33

 - nelmio/api-doc-bundle updated from 2.9.0 to 2.10.3
   See changes: https://github.com/nelmio/NelmioApiDocBundle/compare/2.9.0...2.10.3
   Release notes: https://github.com/nelmio/NelmioApiDocBundle/releases/tag/2.10.3

 - lexik/form-filter-bundle updated from v4.0.1 to v4.0.2
   See changes: https://github.com/lexik/LexikFormFilterBundle/compare/v4.0.1...v4.0.2
   Release notes: https://github.com/lexik/LexikFormFilterBundle/releases/tag/v4.0.2

 - j0k3r/graby-site-config updated from 1.0.5 to 1.0.6
   See changes: https://github.com/j0k3r/graby-site-config/compare/1.0.5...1.0.6
   Release notes: https://github.com/j0k3r/graby-site-config/releases/tag/1.0.6

 - j0k3r/graby updated from 1.0.2 to 1.0.4
   See changes: https://github.com/j0k3r/graby/compare/1.0.2...1.0.4
   Release notes: https://github.com/j0k3r/graby/releases/tag/1.0.4

 - phpunit/phpunit updated from 4.8.13 to 4.8.16
   See changes: https://github.com/sebastianbergmann/phpunit/compare/4.8.13...4.8.16
   Release notes: https://github.com/sebastianbergmann/phpunit/releases/tag/4.8.16
2015-10-30 08:00:43 +01:00
c929c88faf Enable graby log 2015-10-24 10:53:55 +02:00
e686b5e6fe Merge pull request #1495 from wallabag/v2-docs
add docs
2015-10-22 17:02:06 +02:00
71200c4155 Merge pull request #1496 from wallabag/v2-redirect-after-deletion
fix #1005 V2 redirect after deletion
2015-10-22 09:28:54 +02:00
18d5f4541e redirect on last page after deletion 2015-10-21 15:26:37 +02:00
59e91bc893 add docs 2015-10-21 14:14:51 +02:00
a4e1ddf2d6 Merge pull request #1491 from jlnostr/v2-german-translation
Add german translation.
2015-10-19 09:21:43 +02:00
57cf6fd76c Add language to config.yml 2015-10-18 22:04:50 +02:00
37a564a868 Add german translation. 2015-10-18 21:26:09 +02:00
fcc6949d4a Merge pull request #1446 from wallabag/v2-language-config
[WIP] language selection on config screen
2015-10-18 15:35:42 +02:00
2aac2f278f Add tests on listeners 2015-10-16 07:40:09 +02:00
c89d35e851 Language selection on config screen 2015-10-15 21:42:29 +02:00
3d3ed955f1 Merge pull request #1484 from wallabag/v2-2factor-auth
2factor authentication via email
2015-10-15 13:52:52 +02:00
e9b395ec4b forgot parameters for travis 2015-10-15 13:20:44 +02:00
18cf594f8a move 2factor activation in parameters 2015-10-15 13:17:21 +02:00
0d6a7929e1 add tests for 2factor authentication 2015-10-14 17:10:12 +02:00
f6af634aec Merge pull request #1475 from modos189/v2_material
V2 material
2015-10-14 12:01:30 +02:00
2db616b586 2factor authentication via email 2015-10-13 22:43:15 +02:00
c26a3edc0a Other improvements 2015-10-09 13:00:15 +03:00
ba873ae667 Icons in footer 2015-10-09 12:43:42 +03:00
cf0ea8f113 Merge pull request #1472 from wallabag/v2-clean-views
fix #1470: clean material theme
2015-10-08 13:44:04 +02:00
9dbcf9d418 Merge pull request #1471 from wallabag/v2-bookmarklet
implement bookmarklet
2015-10-08 13:43:53 +02:00
fa853bb603 fix #1470: clean material theme 2015-10-08 13:32:34 +02:00
880a0e1c0b implement bookmarklet 2015-10-08 13:29:41 +02:00
3bfbd22f13 Merge pull request #1468 from wallabag/v2-fix-detect-theme
fix bug on detect active theme
2015-10-06 20:57:54 +02:00
ce782c84b8 fix bug on detect active theme 2015-10-06 20:51:40 +02:00
3123b3c0c8 Merge pull request #1464 from wallabag/v2-fix-type-hint
fix type hint for User
2015-10-06 12:24:18 +02:00
1ce8f30342 fix type hint for User 2015-10-06 12:16:08 +02:00
16dabc3263 Merge pull request #1436 from wallabag/v2-register
Public registration & oAuth2 \o/
2015-10-06 09:19:06 +02:00
fdef5f4605 Merge pull request #1461 from wallabag/v2-test-for-www
fix #1433: add test for removeWww Twig Extension
2015-10-06 09:16:52 +02:00
794dc4ee8a Merge pull request #1459 from wallabag/v2-tags-chips
fix #1457 & update materialize
2015-10-06 09:09:56 +02:00
784bb4c38d add test for removeWww Twig Extension 2015-10-06 09:09:26 +02:00
8263e71192 use form widget for registration 2015-10-06 07:44:10 +02:00
68e9dcf615 restore blue color 2015-10-06 06:16:17 +02:00
e0d188809c move css 2015-10-05 22:49:46 +02:00
d30262154a last changes for baggy theme 2015-10-05 22:45:44 +02:00
ec3ce598f6 material design for register/login/recover pages 2015-10-05 22:16:18 +02:00
9c8f7af196 fix #1457 2015-10-05 21:37:17 +02:00
4c5e544183 Cleanup
- remove unecessary routing for UserBundle
- remove unused form type
2015-10-03 13:37:21 +02:00
0a878469d4 move some files to UserBundle 2015-10-03 13:31:48 +02:00
1210dae105 remove old implementation for login/register/recover 2015-10-03 13:31:48 +02:00
772d8c4b93 Add test on RegistrationConfirmedListener
And PLEASE @nicosomb, NEVER EVER inject the whole container inside a service.
2015-10-03 13:30:43 +02:00
2c13918acc add test for confirmed registration 2015-10-03 13:30:43 +02:00
359b3f43cc * rename AuthenticationListener
* add tests
2015-10-03 13:30:43 +02:00
772732531e check authentication on each API route 2015-10-03 13:30:43 +02:00
cd1298d6df allow API documentation for anonymous 2015-10-03 13:30:43 +02:00
fcb1fba5c2 * public registration
* remove WSSE implementation
* add oAuth2 implementation
2015-10-03 13:30:43 +02:00
8a60bc4cc2 Merge pull request #1447 from wallabag/v2-typo
typo
2015-10-01 19:58:58 +02:00
4b55e704ab typo 2015-10-01 18:48:38 +02:00
0e8f778199 Merge pull request #1441 from wallabag/v2-french-translation
Add french translation
2015-10-01 11:49:13 +02:00
4e9f656ecb restore footer 2015-10-01 11:38:59 +02:00
cfb28c9da0 french translation 2015-10-01 09:26:52 +02:00
8e417206d5 flash messages translation 2015-09-30 18:17:40 +02:00
4aafa7f0df french translation 2015-09-30 18:09:18 +02:00
4f0dfac6a6 add french translation 2015-09-30 17:06:41 +02:00
7c99da0c95 Merge pull request #1437 from wallabag/v2-clean-material
some cleanup on material theme
2015-09-30 09:05:03 +02:00
24429857d8 Merge pull request #1439 from wallabag/v2-fix-deploy
fix Capistrano configuration
2015-09-30 08:49:00 +02:00
d2755b1c30 Merge pull request #1440 from wallabag/v2-fix-1433
fix #1433: remove www. on entries view
2015-09-29 23:23:58 +02:00
2afdea1ccc forgot one file 2015-09-29 23:11:27 +02:00
72fcaf8a6c remove www. on entries view 2015-09-29 22:59:44 +02:00
e75b215a25 fix Capistrano configuration 2015-09-29 22:13:07 +02:00
b0b352fc8e some cleanup on material theme 2015-09-29 20:26:32 +02:00
917040d4a0 Merge pull request #1434 from wallabag/travis-db
Add multiple database tests on Travis
2015-09-28 22:57:11 +02:00
fef4124130 Enabled Tidy on travis for HHVM 2015-09-28 20:35:56 +02:00
02d17813a1 Fix tests for all 2015-09-28 20:26:37 +02:00
159986c4fb Fix Postgres tests 2015-09-28 19:35:55 +02:00
da3d4998c0 Move readingTime & domainName in ContentProxy
So, everything is centralized in one place when we save a new entry.
2015-09-28 19:35:33 +02:00
4180fddac1 Merge pull request #1435 from wallabag/v2-enabled-user
Enabled created user from Config
2015-09-26 20:19:42 +02:00
34c2cc7a1a Use tecnickcom/tcpdf
tecnick.com/tcpdf is abandonned.
2015-09-26 19:51:26 +02:00
0f30f48b93 Enabled created user from Config
By default, creating user with FOSUser are disabled by default.

Fix #1423
2015-09-26 19:45:14 +02:00
609594fa5e Fix authentication error from Github
From: http://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis/
2015-09-26 19:23:20 +02:00
dc22b46bf3 Fix HHVM & PHP 7.0 2015-09-26 19:06:32 +02:00
03fb6fde5f Add multiple database tests on Travis 2015-09-26 11:56:15 +02:00
5716249455 Merge pull request #1429 from wallabag/v2-language
V2 – Handle language in entry
2015-09-23 09:13:34 +02:00
d4ebe5c5dc Entries filter on language
+ updated deps
2015-09-23 07:55:55 +02:00
0d3bafdfdf Remove tab from baggy css
And add a border left on the filter slider
2015-09-23 07:51:17 +02:00
98f0929f16 Handle entry in language
Fix #1333
2015-09-22 20:52:13 +02:00
db96045a0a Adjust preview picture 2015-09-20 22:36:51 +02:00
1db9d411c5 Merge pull request #1420 from modos189/v2_display_picture
improved display pictures
2015-09-14 17:15:40 +02:00
451bad02f0 improved display pictures 2015-09-14 02:12:39 +03:00
b004a236ba Merge pull request #1401 from wallabag/v2-baggy-themes
Cleanup baggy
2015-09-13 21:07:27 +02:00
1a5f7e2d88 A little more width for filter view 2015-09-13 19:53:09 +02:00
5e98404dfb Re-add preview picture on baggy
Which should has been removed on merge
2015-09-13 15:17:58 +02:00
463573bf69 Update deps 2015-09-13 15:07:15 +02:00
5def3f5862 Filters view on side for baggy 2015-09-13 14:56:34 +02:00
71e51207ce Fix tests 2015-09-13 14:56:34 +02:00
1137fae94d Lower domain search length
When searching for "bbc" I got no result .. sigh.
2015-09-13 13:35:12 +02:00
d2fcbf5d84 Handle filter form using some JS
Instead of displaying an ugly form
2015-09-13 13:35:12 +02:00
19c283140e Cleanup base layout 2015-09-13 13:35:12 +02:00
89ee994f77 Remove some global assets
Some global assets where dedicated to baggy
Remove some non-used css
2015-09-13 13:35:12 +02:00
a78d6afeaa Move baggy theme in its folder 2015-09-13 13:35:12 +02:00
4d5fd9be81 Merge pull request #1417 from wallabag/v2-display-picture
fix #972: add preview pictures
2015-09-13 11:41:23 +02:00
40f59b219b Merge pull request #1418 from wallabag/v2-previewpicture-filter
filter for entries with previewPicture
2015-09-13 10:14:42 +02:00
497e0cad7c add test for previewPicture filter 2015-09-13 10:11:22 +02:00
b026d3b115 add previewPicture on baggy theme 2015-09-13 10:03:53 +02:00
616f9fea26 forgot case for previewPicture filter 2015-09-13 08:43:15 +02:00
a3bcd60a37 filter for entries with previewPicture 2015-09-12 17:08:12 +02:00
fb96ea8845 Merge pull request #1362 from wallabag/v2-fosuser
implement FosUser
2015-09-12 16:13:40 +02:00
e610143f51 add preview pictures 2015-09-12 13:39:01 +02:00
af43bd3767 Fix tests
Ensure that created use during install command will always be unique.
We assume that the install command must be run to initialize a wallabag instance. NEVER to add more user.

Also, use a better way to retrieve the real name of the database and not the one defined in parameters.yml (which isn't the same for test envi because the dbname isn't defined in parameters.yml but directly in config_test.yml)
2015-09-12 11:36:16 +02:00
3f7a62908c fix tests for FosUser 2015-09-11 20:32:37 +02:00
a1691859ca implement FosUser 2015-09-11 20:32:37 +02:00
9c08a891f9 Merge pull request #1397 from wallabag/v2-graby
Integrate graby
2015-09-11 20:17:42 +02:00
f1e29e69cb CS 2015-09-10 22:00:53 +02:00
558d9aabab Move fetching content in a separate class 2015-09-10 21:57:25 +02:00
75c3478a0c Update deps 2015-09-10 15:09:44 +02:00
49e564ec15 Merge pull request #1403 from wallabag/v2-material-full-size-domain-filter
Use full size of the panel for domain-filtering
2015-08-26 07:13:11 +02:00
e643992350 typo 2015-08-26 00:24:33 +02:00
b125ed0394 Use full size of the panel for domain-filtering
For longer domains
2015-08-26 00:19:17 +02:00
c6da9bea71 Merge pull request #1400 from wallabag/v2-fix-1357
fix #1357, truncate domain name if it's too loooong
2015-08-25 07:51:55 +02:00
50243f0e34 fix #1357, truncate domain name if it's too loooong 2015-08-24 22:09:57 +02:00
d13de40db6 Update url from graby 2015-08-24 19:52:31 +02:00
a1413a3da9 CS 2015-08-24 12:35:02 +02:00
fad316151c Integrate graby 2015-08-24 12:27:17 +02:00
8c55a9e6c9 Merge pull request #1395 from wallabag/v2-fix-1378
fix #1378: nice display for tags list
2015-08-24 12:16:08 +02:00
230413bdd1 Merge pull request #1396 from wallabag/j0k3r-patch-1
Apply margin only on settings page
2015-08-24 12:04:24 +02:00
dc1c2debfb Apply margin only on settings page 2015-08-24 12:03:00 +02:00
a754db33c9 fix #1378: nice display for tags list 2015-08-24 11:59:53 +02:00
7083d183b9 Merge pull request #1392 from wallabag/v2-fix-redirect
Fix redirect after deletion
2015-08-24 10:44:14 +02:00
8bb1f3d69a Merge pull request #1393 from wallabag/fix-filter-same-day
Fix date filter on same day
2015-08-24 10:39:24 +02:00
f90af145ca Add test for same day filter 2015-08-23 22:06:27 +02:00
bccb5bba75 Merge pull request #1384 from wallabag/v2-fix-config-display
fix #1371 config screen: display bug in RSS tab
2015-08-23 13:17:21 +02:00
7d6c3edcdd Fix date filter on same day
Fix #1379
2015-08-22 15:36:07 +02:00
ec00964de2 Merge pull request #1372 from wallabag/v2-assign-tags
assign tags to an entry
2015-08-22 12:56:42 +02:00
7244d6cb61 assign tags to an entry 2015-08-22 12:40:48 +02:00
83aaf84195 Fix display issue in config rss tab 2015-08-22 12:30:06 +02:00
16a3d04cbd Fix redirect after deletion
Fix #1391
2015-08-22 12:09:27 +02:00
f9d5155abf Merge pull request #1390 from wallabag/coderating
Enable code rating on Scrutinizer
2015-08-21 18:11:52 +02:00
b45c188516 Enable code rating on Scrutinizer 2015-08-21 18:00:02 +02:00
f506da40e2 Merge pull request #1385 from wallabag/v2-status-filter
filters: implement status filter and a new view (to display all entries)
2015-08-21 17:49:20 +02:00
3b84dc08fc restore composer.lock 2015-08-21 11:02:22 +02:00
78f66dcc52 Merge pull request #1389 from wallabag/v2-fix-duplicate
remove dead code
2015-08-21 11:00:49 +02:00
c937de3443 remove dead code 2015-08-21 08:36:57 +02:00
2b7a488917 filters: adapt queryBuilder for 'all' view 2015-08-21 07:38:18 +02:00
e177976099 filters: add test for status filter and adapt other tests results 2015-08-21 07:30:48 +02:00
89659c9eae filters: implement status filter and a new view (to display all entries) 2015-08-21 07:30:48 +02:00
109d67dbb1 Merge pull request #1386 from wallabag/v2-refactor
WIP – Fixing things around 💨
2015-08-20 21:51:02 +02:00
6682139ec5 CS 2015-08-20 20:39:52 +02:00
e6f55346fd Add test on getting starred entries using the API 2015-08-20 20:39:26 +02:00
eccf5eb2e0 Add title in "picto-link"
Picto aren't always obvious for every one. So it's better to have some title when we move the mouse over.
2015-08-20 20:39:26 +02:00
1dbcd63b59 Update baggy about page
According to what have been done on the material theme
2015-08-20 20:39:26 +02:00
4793ee6509 Fixed my name & website 👌 2015-08-20 20:39:26 +02:00
6eebd8c909 Remove unsed things 2015-08-20 20:39:26 +02:00
0ab7404f93 Refactorize the way to retrieve entries
One place to retrieve entries in Entry & Rss controller.
More simple and easy to maintain.
2015-08-20 20:39:22 +02:00
4fcb7eaf13 Merge pull request #1383 from wallabag/cs
CS
2015-08-20 08:22:39 +02:00
8ce32af612 CS
We shouldn't forget to run `php-cs-fixer` time to time
2015-08-20 07:53:55 +02:00
34437f408c Merge pull request #1369 from wallabag/v2-bottombar
fix #1332: bottom bar to display message
2015-08-19 21:27:49 +02:00
ab4aeb8bd8 Merge pull request #1375 from wallabag/v2-fix-1371
fix #1368 config: redirect on correct tab in material theme
2015-08-19 21:26:29 +02:00
fdab81e910 warning bar: add parameter to dis/enable it 2015-08-19 16:00:15 +02:00
c3fdbcc60f Merge pull request #1374 from wallabag/v2-fix-filters-display
filters: enhance view for domain name
2015-08-19 15:32:38 +02:00
e62d27ff9b bottom bar to display message 2015-08-19 15:14:08 +02:00
8b8cdabc89 config: redirect on correct tab in material theme 2015-08-19 15:10:11 +02:00
bdd23b076a filters: enhance view for domain name 2015-08-19 14:55:39 +02:00
7b2d336893 Merge pull request #1342 from wallabag/v2-domain-filter
fix #981: add filter on domain name
2015-08-19 14:33:46 +02:00
443cecd2d8 add filter on domain name 2015-08-19 14:27:00 +02:00
b71ebd9af9 Merge pull request #1366 from wallabag/fix-tags-view
fix tag view in material theme
2015-08-19 12:02:24 +02:00
22ed64522a Merge pull request #1365 from wallabag/v2-typo-pagination
change </div> into </ul>
2015-08-19 11:21:31 +02:00
2e02b50409 Merge pull request #1367 from wallabag/v2-fix-actions-label
action labels depend on status
2015-08-19 11:20:22 +02:00
a3b4e8a2c0 Merge pull request #1363 from wallabag/v2-add-date-filter-view
add creation date filter view
2015-08-19 11:19:43 +02:00
d5e9a99ce6 Merge pull request #1370 from wallabag/v2-composer-cleanup
fix 1356: diet for composer
2015-08-19 11:19:04 +02:00
68568bf0b7 diet for composer 2015-08-18 21:53:11 +02:00
02947111c0 change </div> into </ul> 2015-08-18 18:20:07 +02:00
e68d9179a1 fix tag view in material theme 2015-08-18 18:18:35 +02:00
c713273619 action labels depend on status 2015-08-18 18:13:30 +02:00
3f357ee241 add test 2015-08-18 16:33:32 +02:00
c3cb46809b Merge pull request #1341 from wallabag/v2-capistrano
capistrano config
2015-08-18 16:14:23 +02:00
72ea6dd1a7 add creation date filter view 2015-08-18 15:26:45 +02:00
54f2b4a254 Merge pull request #1353 from wallabag/v2-pluriel
check if one entry or not
2015-08-18 14:29:10 +02:00
3162601c59 Merge pull request #1343 from wallabag/v2-filter-date
[WIP] filter by creation date
2015-08-18 14:28:43 +02:00
6819604185 Merge pull request #1354 from wallabag/v2-clean
some cleanup
2015-08-18 09:11:40 +02:00
f967422fae Update CONTRIBUTING.md 2015-08-18 08:49:42 +02:00
428af5a8c3 usage of transchoice 2015-08-18 08:32:50 +02:00
fd72e99d53 remove capistrano in gitignore 2015-08-18 08:26:41 +02:00
2a2903ceaa some cleanup 2015-08-17 23:31:10 +02:00
fac3f8abfa Merge pull request #1355 from wallabag/v2-clear-button
clean -> clear
2015-08-17 23:22:24 +02:00
e40ff14d7d Merge pull request #1358 from wallabag/nicosomb-patch-1
Disable external_code_coverage on Scrutinizr
2015-08-17 23:21:59 +02:00
a2cdaa8cdd disable external_code_coverage 2015-08-17 23:11:20 +02:00
4a230f9844 change timeout because scrutinizer failed 2015-08-17 21:39:07 +02:00
5f246a5543 clean -> clear 2015-08-17 20:12:11 +02:00
2ba06b1ee2 check if one entry or not 2015-08-17 18:02:54 +02:00
3c5b025ac3 filter by creation date 2015-08-17 15:54:49 +02:00
ceb79aa016 capistrano config 2015-08-17 15:36:27 +02:00
925d8ab316 Merge pull request #1337 from modos189/v2_material
fixes material
2015-08-17 15:32:59 +02:00
d5b28518e9 fix 2015-08-17 16:30:30 +03:00
0a3a5f6cd7 Merge pull request #1352 from wallabag/v2-fix-pagination
fix #1350: fix pagination with filters
2015-08-17 15:19:35 +02:00
ab2c93c7eb add test 2015-08-17 15:15:51 +02:00
727b39a90e Fix calendar in chromium and reducing the size of the calendar 2015-08-17 15:43:44 +03:00
c14a7c4251 fix #1350: fix pagination with filters 2015-08-17 12:13:37 +02:00
c37381b946 Merge pull request #1349 from wallabag/v2-add-original-link
add link to original article in material theme
2015-08-17 09:20:41 +02:00
790d18a319 GUI for filter by creation date #1343 2015-08-17 03:12:14 +03:00
6fd3d82c01 Hide open menu on page reading articles 2015-08-17 02:02:55 +03:00
fcb3faf109 My implementation progress bar at the top of the page #1348 2015-08-17 01:50:46 +03:00
d75a9fa38b Fix:
When I click on "new article" icon, and on the cross after, the filter icon is no more visible.
    When I change the size of my browser window, the filter appears but I didn't click on the icon
    Bug: can't click on pagination > 1
    display bug: when we load homepage, we see quickly the filter form
    new entry form: when we click on the field, the history of the field is at the left of the screen, not below the field (see screenshot)
2015-08-17 01:29:51 +03:00
0e7cf1fc50 Merge remote-tracking branch 'origin/v2' into v2_material 2015-08-17 00:33:03 +03:00
9cc6bd87fe add link to original article in material theme 2015-08-16 21:05:37 +02:00
80127e4fb1 Merge pull request #1338 from wallabag/v2-add-titles
change title for material pages / about page
2015-08-13 11:53:34 +02:00
4ca0c9139c fix diaspora url 2015-08-13 09:18:41 +02:00
a64f1d9f2d change title for material pages / about page 2015-08-13 09:16:22 +02:00
bac5a34552 Fix form rendere 2015-08-12 23:52:40 +03:00
a737d2a0ee Merge remote-tracking branch 'origin/v2' into v2_material 2015-08-12 23:02:19 +03:00
545b852f46 Merge pull request #1331 from wallabag/v2-disable-download
disable download links on entry view
2015-08-12 21:58:46 +02:00
392f4a2681 #1320 Design for filters 2015-08-12 22:55:44 +03:00
120544cccd disable download links on entry view 2015-08-12 21:52:39 +02:00
82b07eb272 Merge pull request #1334 from wallabag/v2-store-domainname
store domainName in database
2015-08-12 21:45:21 +02:00
c2257428b2 store domainName in database 2015-08-12 21:16:00 +02:00
8ba913d87a improved view 2015-08-12 20:27:30 +03:00
06fdfd025e fix #1321 2015-08-12 19:18:31 +03:00
d990dc6f05 Merge pull request #1328 from wallabag/v2-fix-1324
fix #1324: do not display pagination when only 1 page
2015-08-12 14:12:08 +02:00
bdf39ff10d remove pagination if page == 1 with baggy theme 2015-08-12 14:06:56 +02:00
2ac2e0bc2b fix #1324: do not display pagination when only 1 page 2015-08-12 14:05:53 +02:00
1a0ea1f35a Merge pull request #1326 from wallabag/v2-fix-1299
fix #1299: change send buttons on config page
2015-08-12 13:42:32 +02:00
43e6f47d5b fix #1299: change send buttons on config page 2015-08-12 13:35:48 +02:00
9f1d650ae8 Merge pull request #1325 from wallabag/v2-fix-1314
fix #1314: change max-width in material theme
2015-08-12 13:31:34 +02:00
b69fc0628a fix #1314: change max-width in material theme 2015-08-12 13:26:49 +02:00
a8596c35c8 Merge pull request #1323 from wallabag/v2-1302-checkbox
fix #1302: add 'stay connected' checkbox
2015-08-12 13:23:52 +02:00
a15692b1b7 Merge pull request #1312 from wallabag/v2-fix-1311
fix #1311, redirect after login
2015-08-12 13:21:16 +02:00
6622cf9968 add translation 2015-08-12 13:21:07 +02:00
7fc14130c7 add test 2015-08-12 13:18:39 +02:00
579764b264 fix indentation 2015-08-12 13:03:26 +02:00
3e1f25e22f Merge pull request #1322 from wallabag/v2-fix-1303
fix #1303, add link to homepage on forgot password page
2015-08-12 12:43:02 +02:00
5a58461491 add 'stay connected' checkbox 2015-08-12 12:27:12 +02:00
773ed2e7a6 fix #1303, add link to homepage on forgot password page 2015-08-12 12:16:50 +02:00
496f21e6fa Merge pull request #1319 from wallabag/v2-form-header
add new post form in material header
2015-08-12 10:14:44 +02:00
053b9568b2 add new post form in material header 2015-08-12 09:52:36 +02:00
930334cd6d Merge pull request #1297 from wallabag/v2-estimated-time
store estimated reading time in database (#393)
2015-08-12 09:05:21 +02:00
2686457448 store estimated reading time / filters on reading time 2015-08-12 09:01:29 +02:00
fedaf00537 Merge pull request #1317 from wallabag/v2-fix-typo
fix link in howto page
2015-08-11 21:26:31 +02:00
ea8da8c6d5 fix link in howto page 2015-08-11 21:12:08 +02:00
95135988f9 Merge pull request #1316 from wallabag/v2-focus-searchform
fix #1310 add focus to search form
2015-08-11 20:00:30 +02:00
d85454fbf8 add focus to search form 2015-08-11 18:07:02 +02:00
728a432850 fix #1311, redirect after login 2015-08-10 22:37:56 +02:00
f59601fced Merge pull request #1298 from modos189/v2_fix_material
fix material
2015-08-10 19:35:23 +02:00
0e654f6273 Merge remote-tracking branch 'origin/v2' into v2_fix_material
# Conflicts:
#	src/Wallabag/CoreBundle/Resources/views/themes/material/base.html.twig
2015-08-10 15:25:23 +03:00
f48a018929 Merge pull request #1295 from wallabag/v2-howto
add howto page
2015-08-10 14:15:11 +02:00
b958d9e59b remove useless line 2015-08-10 14:13:23 +02:00
4919584b87 Merge remote-tracking branch 'origin/v2' into v2_fix_material
# Conflicts:
#	src/Wallabag/CoreBundle/Resources/views/themes/material/base.html.twig
2015-08-10 12:27:12 +03:00
1473e8c9fb add tests for static pages 2015-08-10 08:19:40 +02:00
47cadf36c8 Merge pull request #1292 from wallabag/v2-tags-route
Add tags list display
2015-08-09 22:47:28 +02:00
20a69dffe7 Merge pull request #1304 from wallabag/v2-rename-starred-menu
rename favorite in starred
2015-08-09 20:47:13 +02:00
009696d0a8 rename favorite in starred 2015-08-09 20:31:53 +02:00
e9d5c2bf02 Merge pull request #1296 from wallabag/v2-fix-564
fix #564: replace Untitled by the domain name
2015-08-08 20:58:03 +02:00
946d6a5124 Preparation for adding links 2015-08-08 01:30:52 +03:00
a6523cfe86 fix #1281 2015-08-08 00:16:14 +03:00
c54ea989a3 fix #1281 (notifications when we star articles are buggy)
All notification corrected
2015-08-08 00:08:29 +03:00
342f0cc55a fix #1281 (When I save 10 articles, I've got 4 lines: 3 articles on 1st line, 3 on 2nd one, only 1 on 3rd line and 3 on last lines (chrome and firefox)) 2015-08-08 00:00:11 +03:00
0e7650683d Title in navigation bar 2015-08-07 23:59:11 +03:00
768303a573 fix #1282 2015-08-07 23:29:21 +03:00
0bc2baa65c fix #564: replace Untitled by the domain name 2015-08-07 21:57:53 +02:00
b7dd5f824c add howto page 2015-08-07 21:22:43 +02:00
54139268f8 Merge pull request #1294 from wallabag/v2-fix-1282
fix #1282: add title on wallabag logo
2015-08-07 20:56:45 +02:00
44a16e82d8 fix #1282: add title on wallabag logo 2015-08-07 20:47:19 +02:00
d0b90fbe18 unit test 2015-08-07 20:29:03 +02:00
55333dfd21 Merge pull request #1293 from wallabag/v2-items-per-page
get itemsPerPage for unread/fav/archive views
2015-08-07 20:10:07 +02:00
47e12c3677 fix display 2015-08-07 20:07:39 +02:00
3f3fbef11f Add tags list display 2015-08-07 18:17:23 +02:00
48ffc5a4b6 get itemsPerPage for unread/fav/archive views 2015-08-07 18:04:46 +02:00
6ecdd48a3f Merge pull request #1286 from wallabag/v2-issue-1283
fix #1283: display the good title for each category
2015-08-06 04:38:04 +03:00
b17874a7d5 Many corrections material theme 2015-08-06 04:22:45 +03:00
308db01684 change order of condition 2015-08-05 21:16:48 +02:00
b1a65df9df fix #1283: display the good title for each category 2015-08-05 21:10:20 +02:00
8d9b8912af Merge pull request #1279 from wallabag/material-default
set material to default theme \o/
2015-08-04 23:13:15 +02:00
4ab58dcf6c set material to default theme \o/ 2015-08-04 22:51:21 +02:00
9e07dc982c Merge pull request #1276 from modos189/v2
Added Material theme
2015-08-04 22:42:33 +02:00
9948d899d3 Fixes and improve css @media 2015-08-04 19:39:26 +03:00
53e121881b Added Material theme 2015-08-04 17:18:15 +03:00
7e63b892f9 Merge pull request #1250 from frankoa/v2_pagination_and_api
Adds pagerfanta paginator everywhere, modifies article routing.
2015-07-29 09:02:30 +02:00
9fb6ac830f Adds pagerfanta paginator everywhere, modifies article routing. Change API for is_starred and is_archived 2015-07-28 23:23:49 +02:00
9b9b05008a Merge branch 'v2-edit-title' into v2 2015-06-08 16:35:41 +02:00
ac9d58211e Merge branch 'v2' into v2-edit-title 2015-06-08 16:35:02 +02:00
3cf22a0541 Merge pull request #1206 from wallabag/sf-2.7
Upgrade to Symfony 2.7
2015-06-03 21:24:11 +02:00
82d6d9cb06 Add basic title edition
Fix #218
I mean basic, because there is no javascript at all. It could be a nice edit-in-place. But for the moment, it is simple.
2015-06-02 18:56:07 +02:00
75e9d1df03 Update to Symfony 2.7
And fix some deps instead of using dev tags
2015-06-02 16:58:19 +02:00
170746f99d Remove phinx
Doctrine handle quite correctly database migration. Thanks to `doctrine:schema:update`
2015-06-02 16:54:52 +02:00
51d9699fa1 Update deps 2015-06-01 17:39:05 +02:00
2878416f8b Merge pull request #1167 from wallabag/v2-api-bundle
Move API stuff in ApiBundle
2015-06-01 15:49:49 +02:00
4346a86068 CS 2015-05-30 13:59:33 +02:00
399bd777d7 Update deps 2015-05-30 13:42:38 +02:00
2f3c816579 Update naming strategy since Doctrine 2.5
See 20fb8270dc
2015-05-30 13:40:39 +02:00
9a014e48d6 Disable coverage
It takes ages to process and most of the time the build fail for "execution time" too long.
Too much time already burned to investigate it.
We'll investigate later, it's not a priority atm.
2015-05-30 13:31:54 +02:00
98510a4189 Merge pull request #1180 from wallabag/v2patch
Add some required
2015-04-15 17:29:28 +02:00
c7d3bf1671 name not required 2015-04-15 17:19:37 +02:00
4d6e818e40 changed email fields with the email type and added required parameter on some stuff 2015-04-15 16:50:20 +02:00
1cbef2d3b5 Enable debug on phpunit 2015-04-04 21:55:06 +02:00
04aaa199b7 Add Travis & Scrutinizer badges 2015-04-02 11:45:53 +02:00
132f614dee Avoid / in feed token
Of course, it breaks the url and the route matcher for each feed route
2015-04-01 21:59:13 +02:00
9744e97131 Fix tests 2015-04-01 21:59:13 +02:00
769e19dc4a Move API stuff in ApiBundle 2015-04-01 21:59:12 +02:00
e3c34bfc06 Merge pull request #1164 from wallabag/v2-remove-username-in-config
Remove ability to change username
2015-04-01 21:58:08 +02:00
d6fa2f70ac Merge pull request #1165 from wallabag/v2-prefix-db
Prefix table
2015-04-01 21:53:48 +02:00
276a1e9d3f And phpunit with html coverage to ant
Launching `ant phpunit` will now generate HTML Coverage
2015-04-01 21:32:02 +02:00
164bd80118 Ability to prefix tables
Will fix #799
2015-04-01 21:32:02 +02:00
c844dc0c50 Remove ability to change username
Since password are linked to username it was hard to change username while checking that the password is the good one.

Instead of doing crazy things to achieve that, I act that user won't be able to update username.

Also, username (and email) must be unique, since people logged in using username and can request a new password using email.

This should fix #1149
2015-04-01 21:23:27 +02:00
1a93ee423b Merge pull request #1166 from wallabag/v2-rss
Add RSS feeds
2015-04-01 21:08:56 +02:00
7d74a2f32b Force raw on content
We don't want Symfony to escape html content
2015-04-01 16:11:19 +02:00
14d7a69b8c Avoid timeout on code coverage from Scrutinizer 2015-03-31 22:48:01 +02:00
34c06cabef Use lemonde instead of mailjet
Mailjet seems to be laggy, hope that LeMonde will be more reliable in the future.

@see https://travis-ci.org/wallabag/wallabag/jobs/56246231
2015-03-31 22:48:01 +02:00
0ee043f745 Update InstallCommand test
They are god damn too long to execute because it launch external command (mostly related to doctrine).

So I've added a PHPUnit @group (`command-doctrine`) so that we can avoid launching them on a regular basis, like that:

`phpunit --exclude-group command-doctrine`
2015-03-31 22:48:01 +02:00
371ac69a6b Add tests
and fix few mistakes
2015-03-31 22:48:00 +02:00
2385f891e5 Sort by id is faster
Since it's the primary key
2015-03-31 22:47:43 +02:00
0c83fd5994 Add rss for entries
will fix #1000
2015-03-31 22:47:43 +02:00
f98a2a0fc3 Merge pull request #1152 from wallabag/v2-forgot-password
Handle forgot password
2015-03-30 17:05:37 +02:00
bdf2add2e8 Merge pull request #1163 from wallabag/v2-speed-up-tests
Speed up tests
2015-03-28 10:46:33 +01:00
3e6b7ea0e9 Rewrite travis & add scrutinizer 2015-03-28 00:25:47 +01:00
6141388969 Enable hhvm & nightly for curiosity 2015-03-27 19:59:45 +01:00
2d733277e6 Switch to Docker-based infrastructure 2015-03-27 19:59:42 +01:00
a05be8abec Use doctrine cache for tests 2015-03-27 19:49:11 +01:00
d0c2243b10 Add some tests 2015-03-08 22:47:32 +01:00
6894d48e03 Handle forgot password 2015-03-08 07:35:24 +01:00
f37d1427a1 Merge pull request #1110 from wallabag/v2-api-hypermedia
[WIP] API : hypermedia & tags
2015-03-06 21:48:33 +01:00
6e22bd737b Use pager in getEntries() and return Hateoas collection 2015-03-06 21:11:02 +01:00
bcf53ab75b Return pager into EntryRepository (for entries only) 2015-03-06 21:11:01 +01:00
a24f2c8808 Add Pagerfanta 2015-03-06 21:11:01 +01:00
48b67328e2 add getUser on Tag entity 2015-03-06 21:09:15 +01:00
efad7e53a1 add more log on AccessDeniedException 2015-03-06 21:09:15 +01:00
2ab8cb6816 fix tests 2015-03-06 21:09:15 +01:00
db2b4bf678 remove JsonResponse 2015-03-06 21:09:15 +01:00
b0cce9e636 fix tests for GET /entries/tags 2015-03-06 21:09:15 +01:00
1df1204d94 remove useless code 2015-03-06 21:09:15 +01:00
6ee416a069 commit bug with getSalt 2015-03-06 21:09:15 +01:00
0ca374e6a1 replace Response with JsonResponse 2015-03-06 21:09:15 +01:00
d8f9f37ab2 remove debug lines 2015-03-06 21:09:15 +01:00
092ca70725 add relation between user and tags, tests are broken 2015-03-06 21:09:15 +01:00
a36737f485 POST entries/tags with test 2015-03-06 20:50:31 +01:00
46bbd8d321 relation between tags and entries 2015-03-06 20:50:31 +01:00
6c87418ff0 fixtures for tag 2015-03-06 20:50:30 +01:00
1bd12b6229 fix GET /api/entries/{entry}/tags 2015-03-06 20:50:30 +01:00
0a018fe039 add relation between entry and tag 2015-03-06 20:50:30 +01:00
6d37a7e6c1 remove dumb code 2015-03-06 20:50:30 +01:00
b3dc0749d3 remove GET /tags/id 2015-03-06 20:50:30 +01:00
2691cf0438 GET /api/tags/id_tag method 2015-03-06 20:50:30 +01:00
1d14779154 remove isDeleted flag 2015-03-06 20:50:30 +01:00
aa4d6562c1 improve hateoas implementation 2015-03-06 20:50:30 +01:00
0ed6302212 returns serialzed object for GET /entries 2015-03-06 20:50:30 +01:00
0f00688096 first draft of hypermedia implementation 2015-03-06 20:50:29 +01:00
73b7744383 Merge pull request #1144 from wallabag/v2-build
Simplify build system
2015-03-04 06:25:17 +01:00
8378485e33 Simplify build system 2015-03-03 19:20:08 +01:00
ba7b9d48d4 Merge pull request #1132 from wallabag/v2-theme
V2 theme
2015-03-02 21:23:19 +01:00
3e30422cda Only one pattern for LiipTheme
Others patterns aren't required (but I think it's still important to have them around)
2015-03-01 20:25:43 +01:00
495aecfe74 Cleanup & simplify theme 2015-03-01 10:49:17 +01:00
71798e4ec4 Remove old themes 2015-03-01 10:49:16 +01:00
32da2a70ef Add LiipThemeBundle
Re-defined the config / user relation to be OneToOne bidirectionnal.
ConfigType is now a service so I can inject the list of available themes that are also used by LiipThemeBundle

Force sqlite for test
In case of people use a different driver in parameter.yml (yes I do :))
2015-03-01 10:49:16 +01:00
fca3c75723 config for CORS 2015-02-28 13:14:43 +01:00
dcae2fc25d enable CORS 2015-02-27 21:26:43 +01:00
0e7971d835 Merge pull request #1095 from wallabag/v2-config
V2 config
2015-02-23 20:56:09 +01:00
c641baad0e More tests on the install command 2015-02-22 23:29:48 +01:00
732c2ad897 sqlite doesn't support getListDatabasesSQL 2015-02-22 17:18:54 +01:00
0bf99bb144 Improve install command & add test
Also add fixtures for Config

InstallCommand now check if database, schema are here and ask the user what to do (keep or trash & re-create)
2015-02-22 14:35:36 +01:00
0bd2cb1ecd Handle default value for new user 2015-02-22 10:50:27 +01:00
e4977b8a86 Adding new user 2015-02-22 09:30:25 +01:00
c0d9eba07f Updating logged in user (email, name, etc ..) 2015-02-17 22:45:20 +01:00
d9085c63e3 Handle password change 2015-02-17 21:03:23 +01:00
7781faa0b0 Use a form type for entry 2015-02-16 21:31:58 +01:00
78cedc2262 Cleanup 2015-02-16 21:31:58 +01:00
4d85d7e9ba Implement simple config 2015-02-16 21:31:58 +01:00
7a577c519f Fix indentation in templates 2015-02-16 21:31:58 +01:00
55f58c9c5e Update UserConfig schema 2015-02-16 21:31:58 +01:00
2f6a596760 Merge pull request #1070 from wallabag/v2-api-tests
1st draft for testing API
2015-02-12 08:50:06 +01:00
8c7e0f95b9 remove debug lines 2015-02-12 08:46:40 +01:00
d9b7175593 test if GET /api/entries returns 1 or more results 2015-02-11 18:22:59 +01:00
59f18f9a85 create single test for bad headers 2015-02-11 16:08:13 +01:00
9ca5fd43f9 test with bad headers 2015-02-11 15:35:40 +01:00
f170f31594 add test for empty salt 2015-02-11 15:15:06 +01:00
874e3e10a4 phpdoc 2015-02-11 11:52:10 +01:00
f8c2736a10 remove docs 2015-02-11 09:39:42 +01:00
70b54da2b1 test line, forgot to remove it 2015-02-11 07:52:58 +01:00
c9fa9677c1 DELETE entry and use of query for fetch entries 2015-02-11 07:43:43 +01:00
fa8d563934 Merge pull request #1072 from wallabag/v2-entry-test
Add more tests to Entry controller + security
2015-02-11 06:45:14 +01:00
19aee7cd54 refactor and test one entry 2015-02-11 06:41:44 +01:00
2725de8efb cs 2015-02-11 06:31:16 +01:00
91f78f26f2 first test for API, need refactor 2015-02-11 06:28:23 +01:00
2734044aca add test for api/salts 2015-02-11 06:28:23 +01:00
0536b809b0 Test for GET on empty database 2015-02-11 06:27:50 +01:00
e1dd7f70c5 first test for API, need refactor 2015-02-11 06:27:05 +01:00
f5deb024a2 add test for api/salts 2015-02-11 06:27:04 +01:00
68c6f1bd7f Test for GET on empty database 2015-02-11 06:27:04 +01:00
da93261a7d Quick fix in build.xml
We don't need to purge the database since it was just re-created
2015-02-10 22:56:48 +01:00
3d2b2d62be Avoid user to see other entries
hehe :)
2015-02-10 22:56:44 +01:00
eb3bd7efb7 Add more tests on Entry controller
Also add more fixtures
2015-02-10 22:32:42 +01:00
f59f45d740 Merge pull request #1069 from wallabag/v2-fix-return-entries
GET /api/entries returns object, no more array
2015-02-10 14:51:32 +01:00
017e20895f findEntries returns array 2015-02-10 13:53:00 +01:00
2c0ffcf397 Merge pull request #1068 from wallabag/v2-api-authentication
V2 api authentication
2015-02-10 13:49:57 +01:00
3d3368cfd5 change test if we have no entry in GET /api/entries 2015-02-10 13:47:57 +01:00
92504e0dd4 move dir check into constructor 2015-02-10 13:35:34 +01:00
11204db45a change phpdoc 2015-02-10 12:14:09 +01:00
d4c029f46e review from @j0k3r 2015-02-10 12:12:44 +01:00
c5e8ba25bb getSalt method 2015-02-10 08:35:43 +01:00
eaf95758dc GET /api/entries returns object, no more array 2015-02-10 06:44:38 +01:00
7ffb1e80bf replace services.xml into services.yml 2015-02-09 22:54:29 +01:00
5078e8360a PSR 3 2015-02-09 22:43:06 +01:00
d29bfaf139 fix return on API call and fix id in clear for user 2015-02-09 22:40:20 +01:00
2a94b1d1b7 log for authentication on API 2015-02-09 22:07:39 +01:00
cbce162b40 Merge pull request #1063 from wallabag/v2-rename-tags-entity
Rename Tags entity
2015-02-09 15:52:10 +01:00
fb8389f463 change settings for TagsEntries model 2015-02-09 15:41:07 +01:00
970c40bb93 restore TagsEntries 2015-02-09 15:07:48 +01:00
0ac38198ab authentication on API 2015-02-09 13:59:48 +01:00
653e8be4c1 rename Tags entity
why did I delete this file?

rename Tags entity

rename Tags entity
2015-02-09 12:58:44 +01:00
89c03230c3 Merge pull request #1062 from wallabag/v2-relation-entry-user
add a real relation between user and entry
2015-02-09 12:52:06 +01:00
3b815d2de5 Add some fixtures
Improve test, so user can login
Fix some leftJoin
Cleanup EntryController
2015-02-08 23:13:40 +01:00
d91691573f Add custom auth encoder & provider
These custom classes allow Wallabag v2 to be compatible with Wallabag v1 salted password
2015-02-08 23:13:40 +01:00
7812f508bc create an Entry with a User in parameter 2015-02-08 23:13:40 +01:00
5f09650eef add a real relation between user and entry 2015-02-08 23:13:40 +01:00
8af35ad932 Merge pull request #1066 from wallabag/v2-api-tests-entry
V2 api tests entry
2015-02-07 20:39:03 +01:00
9c0c882006 Add some tests on EntryController
Also, create database schema on test initialisation
2015-02-07 18:30:46 +01:00
94f2364cd8 Fix #1057
Unexisting function
2015-02-07 18:29:05 +01:00
8125b415d8 Avoid raw javascript in template
It kills the Symfony Crawler :)
2015-02-07 18:28:31 +01:00
d01db0c71d Update deps 2015-02-06 22:52:51 +01:00
ed4d5cf2d7 Merge pull request #1065 from FabienM/v2-bundles-cleanup
Cleanup default assets symlinks
2015-02-06 22:43:19 +01:00
427b61a35b Cleanup default assets symlinks 2015-02-06 22:36:02 +01:00
7f2d9f9613 Do not display download progress in Travis 2015-02-06 15:38:10 +01:00
c64a14787d Merge pull request #1061 from wallabag/v2-cleanup-entities
Remove temporary entities
2015-02-06 14:56:47 +01:00
02b225a82e Remove temporary entities 2015-02-06 14:26:37 +01:00
15d33c24dc Merge pull request #1060 from wallabag/api-rename-user
rename User entity
2015-02-06 14:23:55 +01:00
2f69eb4afa rename User entity 2015-02-06 14:18:01 +01:00
29c4517f7a Merge pull request #1059 from wallabag/rename-entry
Rename entry
2015-02-06 09:55:16 +01:00
be463487cc rename Entries to Entry 2015-02-06 07:45:32 +01:00
905ae369bd normalize entries fields 2015-02-05 22:33:36 +01:00
c8dee95396 Merge pull request #1055 from wallabag/v2-api-patch-methid
PATCH method, boolean for some parameters and change entity methods name
2015-02-05 21:51:05 +01:00
c0284f6182 remove persist() for PATCH and DELETE 2015-02-05 21:36:39 +01:00
93e28e4d2e remove unused files 2015-02-05 21:33:22 +01:00
5644c2d88e Merge pull request #1054 from wallabag/v2-api-set-title-post
we can now set a title to the article when we use POST /api/entries
2015-02-05 19:07:30 +01:00
de00c9208d Merge pull request #1048 from wallabag/v2-sort-entries
sort entries in repository
2015-02-05 19:06:48 +01:00
2c093b03de PATCH method, boolean for some parameters and change entity methods name 2015-02-05 18:21:31 +01:00
9e0fff7cb0 simplify code 2015-02-05 18:19:34 +01:00
77bb7b92a2 we can now set a title to the article when we use POST /api/entries 2015-02-05 18:05:27 +01:00
3bb7c5ffec Update branch name in README 2015-02-05 09:19:17 +01:00
c2e2906c8d fix travis configuration 2015-02-05 09:06:13 +01:00
bc782eaa72 sort entries in repository 2015-02-05 07:54:04 +01:00
34d15eb4d0 change database structure for Entries 2015-02-04 22:25:44 +01:00
1b0e6e9ae6 forgot one parameter 2015-02-04 21:34:03 +01:00
61b9fdd5e4 restore full database settings 2015-02-04 21:26:15 +01:00
eacaf7f864 change type for isRead, isFav and isDeleted fields, as said @j0k3r 2015-02-04 18:21:45 +01:00
6079aaa33d change delete status for GET /api/entries method 2015-02-04 18:12:13 +01:00
6e334aba68 for GET /api/entries, star, delete and archive status are no more necessary 2015-02-04 18:06:42 +01:00
42a9064620 implement delete method 2015-02-04 17:54:23 +01:00
889249804f disable authentication for the moment 2015-02-02 12:54:14 +01:00
c5772d118f Installation should be launch manually
Also upadte readme for v2 and define a test database (for the future)
2015-02-02 07:48:16 +01:00
2e45e7bebc New wallabag installer
Instead of the legacy bin/install here is a symfony command that can initialize wallabag.

There are still work to do on the requirements part (to be sure that wallabag can run like a charm).

I've also added (but commented) the fixtures load part (which will need an extra doctrine package). We'll see that point later.
2015-02-01 20:16:27 +01:00
8394ab4619 Merge pull request #1036 from j0k3r/refactor-update-composer
Update composer
2015-01-31 21:49:44 +01:00
4cfbd5d893 Merge pull request #1037 from j0k3r/refactor-cs
CS
2015-01-31 21:24:20 +01:00
7df80cb32c CS 2015-01-31 19:12:49 +01:00
daacffefa6 Use tagged version in composer 2015-01-31 19:02:59 +01:00
1990517b22 remove Acme and AppBundle 2015-01-31 15:36:04 +01:00
c3235553dd first implementation of security 2015-01-31 15:14:10 +01:00
71691fe44a Merge pull request #1035 from j0k3r/refactor
Tests are working again
2015-01-31 10:29:30 +01:00
aa6e27cf4f Tests are working again 2015-01-31 09:35:50 +01:00
4ffc77d9f5 Move phpunit into app folder 2015-01-30 15:47:27 +01:00
fdcbdda1ad grrr, remove call to bootstrap 2015-01-30 11:29:50 +01:00
367664ee87 finally fix phpunit and travis? 2015-01-30 11:23:18 +01:00
e11e03cb32 fix phpunit 2015-01-30 10:58:59 +01:00
3ba208b205 fix phpunit configuration 2015-01-30 10:49:47 +01:00
127915f4ea remove bootstrap in phpunit 2015-01-30 09:11:59 +01:00
03493be075 tell to travis that I code in PHP 2015-01-30 09:09:53 +01:00
843dbe5195 create entry via API 2015-01-30 09:05:54 +01:00
a8c90c5c1b add documentation for API 2015-01-30 07:50:52 +01:00
a65f5d5563 fix config for rest bundle 2015-01-29 21:49:44 +01:00
27f15aa4ca improve API 2015-01-29 20:32:11 +01:00
f8bf895254 routing for API, trying to respect #414 2015-01-29 16:56:58 +01:00
589dce52c6 disable dev environment 2015-01-28 21:28:12 +01:00
38ba7ed972 skeleton for DELETE and PATCH methods 2015-01-28 18:18:57 +01:00
3e5a342f65 bundle for API 2015-01-28 18:14:04 +01:00
e4788de51e 1st implementation of wallabag api, yeah 2015-01-28 17:09:27 +01:00
569f8d6851 add dependencies for API 2015-01-28 16:15:06 +01:00
19f2f11ee8 fix themes symlinks 2015-01-28 13:58:12 +01:00
9e11bfa4a6 wrong path for database file 2015-01-28 13:54:24 +01:00
7dfc3c2b58 fix config.yml 2015-01-28 13:46:51 +01:00
80709502c7 fix parameters config 2015-01-28 13:43:23 +01:00
2cdb0b8f40 change gitignore, last time, I promised 2015-01-28 13:28:12 +01:00
b2d9357c78 change gitignore 2015-01-28 13:27:00 +01:00
c4b1e79018 change gitignore 2015-01-28 13:26:36 +01:00
dc61832a9e change gitignore 2015-01-28 13:23:07 +01:00
33767049a5 change gitignore 2015-01-28 13:10:59 +01:00
0c678cf24a rename test file 2015-01-27 13:17:37 +01:00
b9ec99e25b replace legacy calls with new one 2015-01-27 13:08:02 +01:00
d692b3b08d remove legacy code 2015-01-27 13:07:27 +01:00
6b767d1cc0 refactoring for fetching content 2015-01-26 22:15:19 +01:00
ad4d1caa9e move WallabagBundle into Wallabag:CoreBundle 2015-01-23 16:28:37 +01:00
b84a80559a some parameters, new entry form, etc. 2015-01-23 14:58:17 +01:00
163eae0bb1 toggle archive / fav actions 2015-01-23 12:45:24 +01:00
bd9f08157c article view, fav list, archive list 2015-01-22 21:11:22 +01:00
9d50517cea migrating legacy to symfony 2015-01-22 17:18:56 +01:00
2b9fe72b39 remove foo test 2015-01-22 10:14:37 +01:00
93fd4692f6 symfony is there 2015-01-22 08:30:07 +01:00
0440249631 move templates into resources 2015-01-21 16:04:05 +01:00
3eb951572d add some documentation at the end of installation 2015-01-21 15:50:51 +01:00
9de6a0a7cc gitignore for app/cache 2015-01-21 15:02:29 +01:00
19875ef0da add install script after composer install 2015-01-21 14:45:39 +01:00
00fcfd299b whoops, deleted install folder 2015-01-20 14:43:57 +01:00
79e051a1f2 restructure folders 2015-01-20 14:11:26 +01:00
97a2dd74c8 phinx needs a sqlite3 file 2015-01-20 07:51:07 +01:00
8d6ff10e8e test for migration 2015-01-20 07:50:50 +01:00
9a5c1bc62a move install files into bin folder 2015-01-20 07:42:20 +01:00
6ad93dff69 new folders 2015-01-20 07:40:39 +01:00
c78c1a3f08 @fivefilters via composer 2015-01-19 21:27:22 +01:00
9e7f6caf03 htmlawed via composer 2015-01-19 16:53:59 +01:00
820d81aa61 simplepie via composer 2015-01-19 14:48:03 +01:00
3329f1bf3d tcpdf via composer 2015-01-19 14:36:17 +01:00
90c67dbd12 update composer.lock 2015-01-19 13:50:31 +01:00
96b2c59c04 update composer 2015-01-19 13:38:57 +01:00
3d99ce9dad travis configuration 2015-01-19 13:37:32 +01:00
99410a21eb phpepub via composer 2015-01-19 13:00:33 +01:00
1345a10788 phinx for database migration 2015-01-19 12:21:49 +01:00
f3052b4542 foo test 2015-01-19 11:59:22 +01:00
e342acf7ba add phpunit 2015-01-19 11:47:44 +01:00
2b17e0aa77 bin folder 2015-01-19 11:29:43 +01:00
dda7884ace pagination with composer and move FlattrItem 2015-01-19 11:29:25 +01:00
10939766de replace session class 2015-01-18 22:25:29 +01:00
a20f96b76d replace flash messages library 2015-01-18 22:11:41 +01:00
adf17b677e remove 3rd libraries 2015-01-18 20:07:46 +01:00
894cd087f4 remove autoload section in composer.json 2015-01-16 20:56:46 +01:00
44f1fef018 packagist 2015-01-16 20:45:23 +01:00
170a1407fe Merge pull request #690 from doc75/log_auth_error
Add message in web server log in case of authentication failure
2015-01-16 20:06:57 +01:00
b68f0a81e5 Merge pull request #1003 from vpmalley/dev
[RSS] introducing query param 'limit' for max items in RSS feed
2015-01-16 20:04:56 +01:00
7fe8a9adc4 [RSS] introducing query param 'limit' to restrict the number of items to display in RSS feeds. 2015-01-16 11:42:39 -05:00
af5c371e95 Merge pull request #999 from moparisthebest/additions_dev
Miscellaneous additions
2015-01-13 22:45:33 +01:00
13c7f9a462 Add ability to mark all articles from a tag as read 2015-01-12 19:52:41 -05:00
512e5e5bd1 Add ability to delete all articles matching a search 2015-01-12 19:52:41 -05:00
7f782e4496 Add ability to tag an article on creation 2015-01-12 19:52:41 -05:00
c86b40f014 add message in web server log in case of authentication failure to enable the usage of fail2ban on failed login attempts 2015-01-05 10:21:04 +01:00
8ae45e7fe2 fixes #963 and use our own readability.php file for mobiClass 2015-01-03 13:03:26 +01:00
166ff0a093 updated french mo file (see #986) 2015-01-03 11:40:19 +01:00
82978fbd57 Merge branch 'master' into dev
To get the errors
2015-01-03 11:38:32 +01:00
1186b3b67a Merge pull request #986 from goofy-bz/patch-2
Update fr_FR.utf8.po
2015-01-02 21:23:42 +01:00
30b948e68b Update fr_FR.utf8.po
formulation (trivial)
2015-01-02 21:13:54 +01:00
1aa1461a2e Merge pull request #974 from jbfavre/fix_ftrss_call_can_break_import
Make call to FTRSS silent to avoid warnings which can break import
2014-12-26 10:31:15 +01:00
92ae99bd29 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-12-26 10:27:30 +01:00
d4d33a4130 deleted (again) courgette 2014-12-26 10:25:49 +01:00
7a21c308be Merge pull request #975 from wallabag/fixflattrcalls
don't call flattr if flattr is disabled
2014-12-23 15:34:05 +01:00
37cad52229 don't call flattr if flattr is disabled 2014-12-22 16:26:23 +01:00
81315897f0 Make call to FTRSS silent to avoid warnings which can break import 2014-12-21 22:41:04 +01:00
9254b6cf46 Merge pull request #971 from wallabag/fix-jquery-installation
Fix jquery installation
2014-12-19 21:06:06 +01:00
0e65fa85d3 remove idea files 2014-12-18 10:37:17 +01:00
4eb71ab555 change jquery path into installation script 2014-12-18 10:36:47 +01:00
e9a64ef8a9 Merge pull request #923 from wallabag/add-html-doc
add HTML documentation
2014-12-17 22:59:28 +01:00
a50d7f0f20 link to doc inside wallabag:about 2014-12-17 22:55:33 +01:00
2903ffc54f Merge branch 'add-html-doc' of https://github.com/wallabag/wallabag into documentation-integration 2014-12-17 22:44:36 +01:00
5ea5310ab4 enable showing or not for epub/mobi/pdf export buttons 2014-12-14 15:17:39 +01:00
1256e4c645 Merge branch 'tcitworld-ebook' into dev 2014-12-14 00:16:39 +01:00
dc69d3e8d8 merge epub with all the dev evolutions 2014-12-14 00:16:22 +01:00
9c55ed0923 diaspora on all themes 2014-12-07 22:24:25 +01:00
7c2c49d9b1 added diaspora sharing 2014-12-06 18:42:29 +01:00
41bd2be68a Merge pull request #958 from etiess/patch-2
Update wallabag_compatibility_test.php
2014-11-26 14:08:51 +01:00
66d7a4dcd8 Update wallabag_compatibility_test.php
Explain how to install Tidy
2014-11-26 14:07:27 +01:00
b9c026ce32 Merge branch 'remove-courgette' into dev
Conflicts:
	themes/courgette/_view.twig
2014-11-24 22:56:10 +01:00
c4457fba85 upgrade documentation 2014-11-24 13:46:39 +01:00
d4b42995f7 add link to documentation into installation 2014-11-24 13:46:11 +01:00
485d57972e Merge pull request #939 from jsit/globaljs
_global-izing some more js & css
2014-11-24 13:23:53 +01:00
85c5a1ff8d failover if theme folder doesn't exist 2014-11-24 13:11:57 +01:00
7b8bb75228 Merge pull request #942 from wallabag/carrot
implementing carrot into wallabag
2014-11-21 22:15:17 +01:00
fe16457efc Merge pull request #945 from jsit/carrot
Fixing icon text on unread page
2014-11-21 22:10:02 +01:00
46533cac7d Fixing icon text on unread page 2014-11-21 16:07:15 -05:00
747a15841d Merge pull request #944 from jsit/carrot
Globalizing and creating two variants of Carrot.org icon
2014-11-21 21:47:37 +01:00
fc01f94387 Globalizing and creating two variants of Carrot.org icon; tidying up some CSS 2014-11-21 15:30:59 -05:00
e9d4d17693 fix merge confict 2014-11-19 16:54:28 +01:00
25f9c66834 Merge pull request #943 from wallabag/fixFlattrs
fix Flattrs
2014-11-19 16:40:36 +01:00
d25a3f13c2 default deactivated 2014-11-19 16:40:02 +01:00
b13376e918 fix Flattrs 2014-11-19 16:35:44 +01:00
c8b4ef7fed implementing carrot into wallabag 2014-11-19 16:27:56 +01:00
b0f9f5ac21 Merge pull request #938 from jsit/firefoxiconfix
Fix for favicons in Firefox
2014-11-18 22:36:53 +01:00
6062f74c6b Updating Baggy theme's head.twig to locate _global js/css 2014-11-18 10:07:32 -05:00
eb365a01fb _global-izing some more js & css 2014-11-18 10:01:37 -05:00
eb0c88a9d4 Fix for favicons in Firefox (FF only uses the last declared favicon, not the most appropriate: https://bugzilla.mozilla.org/show_bug.cgi?id=751712) 2014-11-18 09:28:39 -05:00
db3bffa284 Merge pull request #937 from jsit/favicons
Moving favicons to new _global theme dir and adjusting <link> tags
2014-11-17 23:15:47 +01:00
ca6c0de380 Adjusting Template class so that _global is ignored as a theme 2014-11-17 17:11:33 -05:00
d91ff81ca6 Modifying Courgette theme to comply with new app icon image location 2014-11-17 16:59:53 -05:00
9d2140c9a1 Fixing earlier commit wherein I lowercased some JS calls 2014-11-17 16:54:15 -05:00
7a0f454d39 Removing app icons from previous locations 2014-11-17 16:51:38 -05:00
d5b717dc77 Moving app icon images to /themes/_global/img/appicon/, updating Baggy and Default themes to point there 2014-11-17 16:49:34 -05:00
7cb517ce54 Adding/fixing favicon <link>s in Baggy theme header 2014-11-17 14:28:07 -05:00
a460404252 Merge pull request #933 from wallabag/dev
1.8.1b
2014-11-16 21:12:47 +01:00
d0287608b6 update constant version 2014-11-16 02:29:01 +01:00
1532376710 Merge pull request #932 from wallabag/dev
1.8.1
2014-11-15 20:48:49 +01:00
d3122db7b2 add DS_Store in gitignore 2014-11-08 08:25:00 +01:00
b46b8933ab Merge pull request #926 from jsit/aboutlink
Fixing URL typo on about page
2014-11-05 17:24:05 +01:00
62f3e6db75 Fixing URL typo on about page 2014-11-05 11:22:22 -05:00
a0c57b35a3 add HTML documentation 2014-11-04 08:33:05 +01:00
217f3ca0b4 Merge pull request #921 from wallabag/about-page
add about page
2014-11-03 23:01:23 +01:00
3eba7538a4 Merge pull request #920 from jsit/uifixes
Many small UI changes/fixes to Baggy theme and English translation files
2014-11-03 22:48:07 +01:00
fa6f5db97f Merge pull request #922 from jsit/menuhiding
Fixing menu hiding behavior when switching from mobile width to desktop width
2014-11-03 22:42:49 +01:00
ebea829d80 Improving class names for menu hiding 2014-11-03 13:32:20 -05:00
e319c49891 Fixing menu hiding behavior when switching from mobile width to desktop width 2014-11-03 13:28:58 -05:00
efd0a9f5f1 Applying changes to config.twig to default theme as well 2014-11-03 12:06:44 -05:00
94888d5fd4 Removing title text from bookmarklet 2014-11-03 09:13:42 -05:00
ac8b064f47 Restoring change password section in config 2014-11-03 09:11:25 -05:00
3c133bff49 add about page 2014-11-03 07:44:56 +01:00
20bb3f7f2a Merge pull request #919 from jsit/popupjs_
Improving JavaScript for popup forms
2014-11-03 06:46:18 +01:00
cc1f78a83d Many small UI changes/fixes to Baggy theme and English translation files. May need review. 2014-11-02 13:37:44 -05:00
ff02fd8aca Improving JavaScript for popup forms 2014-11-02 11:19:21 -05:00
063a2fadaa Removing spaces before colons on config screen 2014-11-02 10:30:13 -05:00
266b7328ef Merge branch 'dev' into uitextcase 2014-11-01 18:29:41 -04:00
893b8e4cef Merge pull request #917 from jsit/menuopacity
Fixing opacity issue when using mobile menu (#912)
2014-10-31 20:45:40 +01:00
1772de2531 Changing my tabs to spaces :) 2014-10-31 15:38:25 -04:00
75dc3a71b7 Fixing opacity issue when using mobile menu 2014-10-31 15:37:08 -04:00
0be82dedb6 Capitalizing "EPUB" as is defined by IDPF: http://idpf.org/epub 2014-10-31 15:26:33 -04:00
8a76674568 Merge pull request #913 from jsit/hotfix
Fixing regression in popup close button styling
2014-10-31 19:35:35 +01:00
40800c97b2 Fixing regression in popup close button styling 2014-10-31 14:34:10 -04:00
6926f6dcc7 Merge branch 'jsit-duplicateformstyles' into dev 2014-10-31 18:54:20 +01:00
a63cd1b06f fix merge errors 2014-10-31 18:54:08 +01:00
9cf370cfb6 Merge branch 'jsit-duplicateformstyles' into dev 2014-10-31 18:48:02 +01:00
ccaefcf69a merge 2014-10-31 18:47:54 +01:00
15eb5ca4b8 Merging changes with dev 2014-10-31 13:47:45 -04:00
224528f1de Merge pull request #909 from jsit/closebutton
Standardizing class names and styles for close buttons
2014-10-31 18:44:42 +01:00
ad2b61db80 Removing left border on popup forms on mobile widths 2014-10-31 13:32:34 -04:00
344c8f6b5c Fixing popup form width issue on narrow width 2014-10-31 13:28:39 -04:00
4bc70ed401 Making visual styling of search and bag it popup forms more consistent 2014-10-31 12:48:35 -04:00
b95a6f57bf Removing duplicate popup form styles 2014-10-31 12:37:54 -04:00
87e37e82fd Merge pull request #910 from jsit/default-theme-search-form-css
Moving search-form style out of messages css and into style.css
2014-10-31 17:34:03 +01:00
8519cc796f Moving search-form style out of messages css and into style.css 2014-10-31 12:31:13 -04:00
827bd1f899 Standardizing class names and styles for close buttons 2014-10-31 11:10:38 -04:00
ed0436d21e Merge pull request #908 from jsit/closemessage
Changing close message button to use &times; instead of X
2014-10-31 16:10:16 +01:00
242746fd17 Changing close message button to use &times; instead of X 2014-10-31 10:44:20 -04:00
f23fd0ee5e Merge pull request #907 from jsit/login
Some small design tweaks to the login page: Moving 'Stay signed in'...
2014-10-31 15:10:01 +01:00
1087b3cb4e Adding right margin to labels (to compensate for now-missing left margin on input fields) 2014-10-31 09:53:01 -04:00
f60c9b00ab Some small design tweaks to the login page: Moving 'Stay signed in' label and removing left margin on input boxes 2014-10-31 09:30:57 -04:00
6fe9b616aa Merge pull request #894 from wallabag/change-password-field
Fix #891: change type for password field in installation
2014-10-31 11:51:13 +01:00
655550e23a Merge pull request #904 from wallabag/vagrantfile
Vagrantfile
2014-10-31 11:50:53 +01:00
4bada2b954 Merge pull request #906 from jsit/tagstitle
Uppercasing 'tags' page title
2014-10-30 21:55:46 +01:00
a87a1b7d3b Uppercasing 'tags' page title 2014-10-30 16:54:24 -04:00
4fae3b0a85 Merge pull request #898 from jsit/previewtext
Fixing issue #874, displaying preview text when in list mode
2014-10-30 21:43:21 +01:00
052bdfc17e Merge pull request #897 from jsit/displaymode
Fixing display mode switching in Baggy theme (issue #896)
2014-10-30 21:43:15 +01:00
476b8902bb Merge pull request #905 from jsit/closebutton
Making the close button more visually consistent on the menu popup forms
2014-10-30 21:25:26 +01:00
6f0b92138f Merge pull request #903 from jsit/uitextcase
Fixing some more text case issues
2014-10-30 21:08:11 +01:00
cd271fc485 Making the close button more visually consistent on the menu popup forms 2014-10-30 16:00:18 -04:00
0bf65303ca change database name 2014-10-30 20:43:39 +01:00
c4800fc6da ignore vagrant directory 2014-10-30 20:42:17 +01:00
d51c2e05d3 Vagrantfile, from @fguillot for kanboard 2014-10-30 20:40:56 +01:00
ce096afed7 Fixing some more text case issues 2014-10-30 15:37:59 -04:00
06e7e7ff7b Merge pull request #902 from jsit/en_us
Adding 'en_US' locale (issue #901)
2014-10-30 20:34:08 +01:00
bbbda080bf Adding 'en_US' locale (issue #901) 2014-10-30 15:32:00 -04:00
574f3faf06 Adding 'en_US' locale (issue #901) 2014-10-30 15:30:09 -04:00
b56c86457c Merge pull request #900 from jsit/uitextcase
Fixing a bunch of English translation letter casing and syntax (issue #899)
2014-10-30 18:37:58 +01:00
7212386e98 Fixing a bunch of English translation letter casing and syntax (issue #899) 2014-10-30 12:17:26 -04:00
b73a175386 Fixing issue #874, displaying preview text when in list mode 2014-10-30 11:23:18 -04:00
c9e6fec4bf Fixing display mode switching in Baggy theme (issue #896) 2014-10-30 11:20:05 -04:00
fcd37d0c7b change type for password field in installation 2014-10-29 21:02:07 +01:00
b40cd4e73f Merge pull request #889 from wallabag/fix#871
Fix#871
2014-10-27 20:58:13 +01:00
1b6e21d7a6 translation fix finished for #871 and bring add tag from search feature to all themes 2014-10-27 15:12:46 +01:00
7ee1972599 translation fix for #887 and tiny display fix 2014-10-27 14:00:47 +01:00
24479b479d Merge pull request #888 from wallabag/updated-site-config
updated site_config
2014-10-27 09:28:30 +01:00
90a1a78b1e updated site_config 2014-10-27 06:46:13 +01:00
4a50075784 Merge pull request #883 from wallabag/hotfixepub
fix #882
2014-10-22 15:12:49 +02:00
606bea72e1 fix #882 2014-10-22 15:10:38 +02:00
4eb603430d Merge pull request #879 from Marmo/patch-1
update zeit.de.txt for removal of inline ads
2014-10-21 19:42:21 +02:00
76b1e0babe update zeit.de.txt for removal of inline ads 2014-10-21 19:33:40 +02:00
f2248e604d Merge pull request #878 from wallabag/greybuttonread
fix #873
2014-10-20 15:07:24 +02:00
f56791e6c4 fix #873 2014-10-19 11:12:25 +02:00
750d904a16 fix translation issues 2014-10-17 21:08:08 +02:00
691a03f176 Merge pull request #868 from wallabag/popupoverlap
fix for #830
2014-10-15 16:53:06 +02:00
48fb171d7a fix for #830 2014-10-15 16:47:38 +02:00
8fd0512a3c Merge pull request #848 from 11mariom/dev
Add support for custom http port
2014-10-14 19:57:16 +02:00
5b16d508b5 Merge pull request #843 from rros/mysql-utf8mb4
Convert the MySQL charset to utf8mb4 to support the full range of unicode
2014-10-14 19:56:50 +02:00
05e313ad28 Merge pull request #867 from wallabag/zindex-menu-bug
fix z-index-menu mobile view bug #834
2014-10-14 19:50:28 +02:00
b9fa7d2c9c fix z-index-menu mobile view bug #834 2014-10-12 10:24:07 +02:00
8ce508cab0 Create adme.ru.txt
Siteconfig
2014-10-12 10:00:35 +02:00
dffbec1c44 Merge pull request #865 from Marmo/patch-1
update heise.de.txt
2014-10-11 15:30:51 +02:00
ad0eccb4cd update heise.de.txt
Multi-page Telepolis-articles (www.heise.de/tp/...) are not fetched correctly atm. My addition to the single_page_link makes it work (tested with http://www.heise.de/tp/artikel/42/42579/1.html).
2014-10-11 15:22:53 +02:00
44d35257e8 Merge branch 'dev' 2014-10-10 13:33:54 +02:00
cf8a5e1eed Merge branch 'master' into dev
Conflicts:
	index.php
2014-10-10 13:33:36 +02:00
6b0894c66a Merge pull request #860 from wallabag/compatibility_file
Move compatibility file (fixes #858)
2014-10-08 21:36:51 +02:00
a7058a5a13 Right redirect from the new path 2014-10-08 21:35:21 +02:00
1403af5be3 Merge pull request #861 from wallabag/fix-query-sqlite-install
query for populate mysql/postgres was called when we choosed sqlite
2014-10-08 21:32:03 +02:00
20b4d7d621 query for populate mysql/postgres was called when we choosed sqlite 2014-10-08 21:23:34 +02:00
7331ed3e80 change href in install/index.php 2014-10-08 21:11:56 +02:00
79dd109e37 Fixes #858: move compatibility file into install folder 2014-10-08 21:08:21 +02:00
a305326973 Merge pull request #787 from wallabag/data-for-mysql
Add data for mysql installation, see #624
2014-10-08 19:32:39 +02:00
3dca040a0b Fix bug for #787 2014-10-08 19:31:15 +02:00
8327f1c371 Merge branch 'dev' into data-for-mysql 2014-10-08 19:26:26 +02:00
73c833780c Merge pull request #855 from wallabag/fix-828
Fix #828
2014-10-04 21:27:05 +02:00
f2cc1db1a8 Merge pull request #856 from wallabag/fix-826
Fix #826
2014-10-04 20:34:40 +02:00
34c2d1bdd1 get content 2014-10-04 20:17:00 +02:00
29e95769b5 Merge pull request #854 from wallabag/saveclick2search
Saveclick2search (fix for #831)
2014-10-04 20:13:10 +02:00
e3c44f9c0f get full content 2014-10-04 19:45:02 +02:00
40d2042228 small fix for better width for search translations full display 2014-10-04 19:08:56 +02:00
ab494e4ede translate search messages 2014-10-04 19:01:43 +02:00
1cd02d55fb autofocus on all themes 2014-10-04 18:51:43 +02:00
f183f72bf4 Merge branch 'dev' into saveclick2search 2014-10-04 18:47:56 +02:00
8b6c710b09 fixed bug in config screen for default theme 2014-10-04 18:45:43 +02:00
04b589420e search field selected 2014-10-04 18:44:18 +02:00
e38e46ecdb Merge pull request #853 from wallabag/fix-for-#797
Fix for #797
2014-10-04 17:50:01 +02:00
ace428669b fix for #758 2014-09-28 19:12:28 +02:00
b37110cc82 Merge branch 'issue-844' of https://github.com/rros/wallabag into dev 2014-09-28 17:48:06 +02:00
cde2fc3842 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-09-28 17:32:50 +02:00
ffcd442989 get up to date for merge 2014-09-28 17:31:02 +02:00
76dd27e7f7 Merge pull request #802 from tcitworld/traductionfix
Traductionfix
2014-09-28 17:25:40 +02:00
9f86454b48 deleting send to kindle function 2014-09-28 17:20:35 +02:00
b852df020c add extension for pdf file 2014-09-28 12:18:47 +02:00
fa926fb47c offering download for pdf file and comment in code 2014-09-27 19:59:43 +02:00
6fc2c29daa revert routing bad deleting 2014-09-27 19:47:50 +02:00
a1b31d93b6 get up to date 2014-09-27 19:42:37 +02:00
824f8c45ed changed mpdf with tcpdf 2014-09-27 19:34:17 +02:00
a0822259e7 Merge pull request #841 from wallabag/fixGDdetection
Fix #766 - GD detection
2014-09-27 18:13:35 +02:00
9b8283d0fc Merge branch 'refactor' into dev 2014-09-27 17:54:24 +02:00
04a7674bdd merge refactor and dev 2014-09-27 17:54:13 +02:00
2d4cfc58ec Add support for custom http port
Now you can use wallabag behind reverse proxy (i.e Squid or Varnish)
without problem with urls like wallabag.example.com:8080.
2014-09-23 18:44:14 +02:00
0dc4797a4c Fix the PostgreSQL install errors 2014-09-21 00:39:40 +02:00
b668db242d Convert the MySQL charset to utf8mb4 to support the full range of unicode characters 2014-09-18 22:29:22 +02:00
bbfe6fa50b Fix #766 - GD detection 2014-09-17 16:36:10 +02:00
a15108e65b Merge pull request #839 from wallabag/fixlocalpictures
fix pictures display when DOWNLOAD_PICTURES is enabled
2014-09-16 21:18:41 +02:00
aa1083bdac fix pictures display when DOWNLOAD_PICTURES is enabled 2014-09-16 20:27:03 +02:00
b3c720b1c3 Merge pull request #836 from akoenig/x-forwarded-port
Implemented additional check for using the 'X-Forwarded-Port' header.
2014-09-16 20:09:58 +02:00
657245dcbd Merge pull request #771 from tcitworld/refactor
fixed bug for epub export #755 ; also better metadata title
2014-09-16 15:21:12 +02:00
5af2555f59 Implemented additional check for using the 'X-Forwarded-Port' header. 2014-09-11 13:17:19 +02:00
49882dc151 Merge pull request #819 from wallabag/fixSQLiteDownloadDB
Fix downloading SQLite database from all users
2014-09-10 20:05:07 +02:00
19438d3021 Merge pull request #816 from zinnober/dev
Complete rework of faz.net-template
2014-09-03 13:14:29 +02:00
d5c481c2f4 remove old function 2014-08-28 21:01:43 +02:00
8763e4efde Fix downloading SQLite database from all users 2014-08-26 12:43:56 +02:00
ecb8c1389c Complete rework of faz.net-template adding multipage support and major article cleanup 2014-08-23 16:47:29 +02:00
d4690a8fa1 removed unnecessary fonts 2014-08-21 18:54:25 +02:00
d05f5eeb1d added moreQueries for postgressql 2014-08-21 19:07:19 +03:00
4362417495 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-08-21 16:42:22 +02:00
a9bbe11169 Merge pull request #814 from wallabag/fix-issue813
vendor dir is not accessible before install, sqlite db dir write check moved into db class
2014-08-21 16:28:16 +02:00
45e60cb52a Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-08-21 16:24:13 +02:00
211068ce50 vendor dir is not accessible before install, sqlite db dir write check moved into db class 2014-08-21 17:17:36 +03:00
051f7fb28c Merge pull request #783 from wallabag/message-after-login
#763 fix to display the login successful message with the translation
2014-08-18 14:41:09 +02:00
79666a3046 Merge pull request #784 from wallabag/fix-successful-add-message
fix display of 'Done' message when we add a link from 'save a link' item
2014-08-18 14:40:54 +02:00
78abff6a52 Merge pull request #785 from wallabag/change-default-pagination
change default pagination, set it to 12, to have a nice baggy display
2014-08-18 14:40:17 +02:00
1daa8e4a0f merge fix 776 2014-08-16 00:54:46 +02:00
dc76489221 minimum of control on server side added 2014-08-15 19:22:55 +03:00
7c503c4438 Fix for #797 2014-08-05 22:19:46 +02:00
b83690ebd8 removing examples for mpdf 2014-08-04 21:34:44 +02:00
a34d920847 Improved instructions 2014-08-03 18:17:43 +02:00
358c689cec little fix in locale files 2014-08-03 18:06:37 +02:00
2e8625c25f little fix 2014-07-29 22:18:15 +02:00
ab86a5124a more translations 2014-07-26 13:04:12 +02:00
280972a66c changes in all themes 2014-07-26 12:44:55 +02:00
200c758ff4 Translations 2014-07-26 12:42:48 +02:00
8492f37323 translation stuff (en & fr done) 2014-07-26 12:22:33 +02:00
f8c3798522 little better 2014-07-26 11:52:43 +02:00
9f3477a279 precision 2014-07-25 08:42:30 +02:00
046b931624 added email field 2014-07-25 08:42:03 +02:00
70549136ba link to guidelines in contributing file 2014-07-25 07:52:00 +02:00
6c0c750000 thank you @mariroz & @tcitworld :) 2014-07-25 07:50:56 +02:00
2f3c05651e guidelines for wallabag 2014-07-25 07:50:15 +02:00
fa9a7bbb3c Merge branch 'fix/securityAllowedActions' into dev 2014-07-25 07:27:21 +02:00
830612f555 typo 2014-07-25 07:26:56 +02:00
d49446ff98 bug with extension in the filename 2014-07-25 01:38:28 +02:00
dc59f164a9 send2kindle 2014-07-25 01:33:31 +02:00
deab6280d3 mobi (not tested on actual device) and pdf working 2014-07-25 00:33:19 +02:00
d07abb5c42 updated mpdf to 5.7.2 2014-07-24 22:01:35 +02:00
fb9df0c269 use directly MOBIClass 2014-07-24 21:56:04 +02:00
af8292c1de Merge branch 'fix/securityMaster' 2014-07-24 21:41:16 +02:00
38cf3413df 1.7.2 2014-07-24 21:41:01 +02:00
800868e27e security fix 2014-07-24 17:47:23 +03:00
c70bfefc68 add mobi and pdf to routing 2014-07-24 15:59:08 +02:00
15317991f3 from epub to all kind of ebooks 2014-07-24 15:53:23 +02:00
4188f38ad5 add pdf and mobi libraries 2014-07-24 15:49:36 +02:00
7dd8b5026d security issue 2014-07-24 16:48:41 +03:00
6da20812ce Merge branch 'dev' of github.com:wallabag/wallabag into dev 2014-07-23 13:45:07 +02:00
887b015def Merge branch 'refactor' into dev 2014-07-23 13:44:48 +02:00
505a74ad1d Merge branch 'dev' into refactor
Conflicts:
	check_setup.php
	index.php
2014-07-23 13:42:30 +02:00
83cac9ac05 Merge pull request #789 from wallabag/feature/someMoreSitesConfig
config for habrahabr.ru to grab articles with comments
2014-07-23 13:38:21 +02:00
a818ff2000 removed permissions test on htmlpurifier 2014-07-23 13:35:19 +02:00
0ce85e0a7f config for habrahabr.ru to grep articles with comments 2014-07-23 14:27:57 +03:00
86edff4447 Add data for mysql installation, see #624 2014-07-22 21:48:21 +02:00
ebd6bf6007 Merge branch 'anno1337-dev' into dev 2014-07-22 21:45:21 +02:00
1f78bd8471 Merge branch 'dev' of github.com:anno1337/wallabag into anno1337-dev 2014-07-22 21:26:02 +02:00
f83ffc3ac3 Merge branch 'feature/programmingCodeSyntaxHighlighting' into dev 2014-07-22 19:33:34 +02:00
392f9a1b9c Merge branch 'dev' into feature/programmingCodeSyntaxHighlighting 2014-07-22 19:32:24 +02:00
9f8541ef2a highlight.js library added to highlight programming code examples in article view 2014-07-22 20:17:15 +03:00
cca9284b6a change default pagination, set it to 12, to have a nice baggy display 2014-07-22 18:14:41 +02:00
3e87066506 fix display of 'Done' message when we add a link from 'save a link' item 2014-07-22 18:12:03 +02:00
9cf6bac1a5 fix to display the login successful message with the translation 2014-07-22 18:01:27 +02:00
b738bea9ca Fix #776 2014-07-22 16:37:13 +02:00
9c67b1b829 Split up check_setup.php into two files. The new file check_essentials.php takes care of stuff like the PHP version and is executed before the config files are included which are needed by check_setup. This patch addresses issue #773 2014-07-22 11:52:18 +02:00
955fc67438 Merge pull request #775 from wallabag/feature/someMoreSitesConfig
issue #750 - config for dn.pt site added
2014-07-21 21:31:45 +02:00
91b6be3186 Merge branch 'skibbipl-dev' into dev 2014-07-21 21:22:34 +02:00
17065e613f Merge branch 'dev' of github.com:skibbipl/wallabag into skibbipl-dev
Conflicts:
	locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.mo
	locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po
2014-07-21 21:21:55 +02:00
cec19bd866 Updated polish translation 2014-07-21 20:58:58 +02:00
5594d7d054 issue #750 - config for dn.pt site added 2014-07-21 19:34:59 +03:00
2b58426b2d fixed bug for epub export #755 ; also better metadata title 2014-07-20 00:45:45 +02:00
6a4bbf0fe5 Merge branch 'refactor' of github.com:wallabag/wallabag into refactor 2014-07-18 11:29:05 +02:00
8e68391a57 remove .idea in gitignore 2014-07-18 11:28:49 +02:00
93edcab52e Merge pull request #764 from tcitworld/refactor
Refactor Flattr class.
2014-07-17 16:06:53 +02:00
ccd0b381b6 camelCase for FlattrItem class (following) 2014-07-17 15:42:59 +02:00
d259f73665 camelCase for FlattrItem class 2014-07-17 15:34:55 +02:00
0f6273cdb8 Merge pull request #761 from wallabag/dev
1.7.1
2014-07-15 11:49:24 +02:00
4e067ceabd updated specific configuration for parsing 2014-07-13 10:15:40 +02:00
58dbe10388 #584 check permissions for HTMLPurifier/DefinitionCache/Serializer folder 2014-07-12 22:08:48 +02:00
d423113b00 #683 Rename « home » into « unread » 2014-07-12 21:50:29 +02:00
26452f891f Merge pull request #752 from mariroz/dev
fix of issue #650, #619 and other similar, error in JSLikeHTMLElement: node no longer exists.
2014-07-12 19:28:16 +02:00
2f26729c84 Refactor 2014-07-12 19:01:11 +02:00
b6a3c8866a forgot run() call 2014-07-12 16:41:55 +02:00
d610968932 ignore my PHPStorm config 2014-07-12 16:40:00 +02:00
26b77483ee remove PicoFarad
I’ll implement it an other day.
2014-07-12 16:39:31 +02:00
d14e3f1e22 Merge pull request #754 from sinisterstuf/about.com
Add support for *.about.com
2014-07-12 15:10:05 +02:00
b3cda72e93 PicoFarad framework for routing 2014-07-11 17:06:51 +02:00
3602405ec0 WHAT. A. BIG. REFACTOR. + new license (we moved to MIT one) 2014-07-11 16:03:59 +02:00
d59536deea Add support for *.about.com
Includes next_page_link for multi-page articles and strips pesky in-line
'next' links from the article body. Also includes an Xpath for author
but I can't see where this is used in the wallabag UI.

The 'tidy' option is turned off because it messed up bulleted lists.

Tested with psychology.about.com and food.about.com.
2014-07-11 00:04:24 +02:00
6400371ff9 I removed my previous commit. We have to create a new branch for that. 2014-07-10 13:17:04 +02:00
c1aad6d574 fix of issue #619 and other similar, error in JSLikeHTMLElement: node no longer exists. 2014-07-09 16:56:52 +03:00
cc1ec61b85 fix of issue #619 and other similar, error in JSLikeHTMLElement: node no longer exists. 2014-07-09 16:50:52 +03:00
c710f977b2 new call for having domain name in entry view 2014-07-08 21:57:53 +02:00
5425b0dd82 new fields in database, reading time / date and domain name are stored 2014-07-08 21:46:32 +02:00
4247b37551 Merge pull request #751 from mariroz/dev
quick fix of issue #750: mulipage content for politico.com/magazine articles
2014-07-07 21:11:07 +02:00
82980a148b quick fix of issue #750: mulipage content for politico.com/magazine articles 2014-07-07 19:17:55 +03:00
c13aac1bc3 1.7.1 2014-07-05 15:49:40 +02:00
da87848cee new config file, fix for #740 2014-07-01 10:18:44 +02:00
25052a76ca fix for #738 2014-06-30 23:24:46 +02:00
a13ff95777 security check 2014-06-30 22:15:55 +02:00
cdda041a90 Merge pull request #737 from mariroz/dev
fix of issue #677: When downloading images, wallabag doesnt respect html "base" tag, tnx to @fivefilters
2014-06-25 19:33:28 +02:00
6924253423 fix of issue #677: When downloading images, wallabag doesnt respect html "base" tag, tnx to @fivefilters 2014-06-25 20:00:00 +03:00
69213014d1 Merge pull request #736 from mariroz/dev
fix of issue #718: Error parsing file imported from Pocket #718
2014-06-25 18:54:39 +02:00
aa126ba458 fix of issue #718: Error parsing file imported from Pocket #718 2014-06-25 19:34:14 +03:00
c9563378ea Merge pull request #728 from Draky50110/dev
typo FR après vérif.
2014-06-12 23:30:53 +02:00
ba22fb1cef typo mineure 2014-06-12 23:10:26 +02:00
29cd317aff fin de correction typo FR 2014-06-12 22:21:44 +02:00
0bf95d865a Revert "Typo FR (suite)"
This reverts commit 7f186e21e0.

Conflicts:
	locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo
	locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po
2014-06-12 22:16:04 +02:00
ae43ec99d9 typo FR 3 2014-06-12 20:32:02 +02:00
7f186e21e0 Typo FR (suite) 2014-06-12 18:55:38 +02:00
bca2853ade Merge pull request #724 from Draky50110/dev
typo FR
2014-06-12 09:34:05 +02:00
97d54f2ac8 typo FR 2014-06-12 01:00:49 +02:00
8142d4b1e6 Merge pull request #722 from tcitworld/dev
do not output debug while generating epub
2014-06-07 16:38:39 +02:00
35d4e27588 up to date 2014-06-07 16:36:57 +02:00
ec15d0a784 do not debug inside an epub 2014-06-07 15:53:39 +02:00
c93a5c137f Merge pull request #716 from mariroz/dev
error reporting level set in E_ALL & ~E_NOTICE by default, can be overriden in config
2014-06-05 16:59:39 +02:00
752cd4a8ef error reporting level set in E_ALL & ~E_NOTICE by default, can be overriden in config 2014-06-02 18:00:09 +03:00
5d198e2b98 Merge pull request #715 from mariroz/dev
fix of undefined ATOM constant warning in full-text-rss, will fix ios-app issue #14
2014-06-01 19:06:45 +02:00
1d14e65315 fix of undefined ATOM constant warning in full-text-rss, will fix ios-app issue #14 2014-06-01 19:49:22 +03:00
67a8848aed Merge pull request #713 from mariroz/dev
small xss vulnerability and translation ability fix
2014-05-30 16:51:13 +02:00
30bd273580 small xss vulnerability and translation ability fix 2014-05-30 17:17:34 +03:00
cbc75befb5 small xss vulnerability and translation ability fix 2014-05-30 17:14:53 +03:00
a9f5e572dd Merge pull request #712 from wallabag/dev
1.7, call me "Premium version"
2014-05-29 18:54:06 +02:00
8038b38802 1.7, premium version :) 2014-05-29 18:52:34 +02:00
79024eb004 fix #344 FQDN with non-standard ports broken 2014-05-29 18:32:55 +02:00
0c3db64585 Merge pull request #711 from mariroz/dev
fix of uninitialized object warning, issue #710
2014-05-29 16:04:26 +02:00
3dc8d84229 fix of uninitialized object warning, issue #710 2014-05-29 16:35:00 +03:00
87f01ea2e9 Merge pull request #707 from mariroz/dev
update to 3.2 version of full-text-rss, issue #694
2014-05-29 12:50:28 +02:00
0b9bb8cb78 add dailymotion videos, issue #708 2014-05-26 14:29:18 +03:00
009669360d fix of onmouseover displaying of wallbabag a link in wallabag form in default theme 2014-05-24 11:21:43 +03:00
a342945b61 fix of rearch form popup in default theme 2014-05-24 11:08:39 +03:00
1fce49fac7 full-text rss config file for ted.com, issue #676 2014-05-23 19:29:01 +03:00
a50583fb97 last 3 important changes to 3.2 version of full-text-rss, issue #694 2014-05-23 19:27:17 +03:00
d18ff7d956 two small unimportant forgotten changes to 3.2 version of full-text-rss, issue #694 2014-05-23 19:25:48 +03:00
3ec62cf95a update to 3.2 version of full-text-rss, issue #694 2014-05-22 17:16:38 +03:00
ab157bbb75 Merge pull request #706 from gboudreau/dev
Fixed Baggy theme CSS for Chrome Extension (and < 500px width layout)
2014-05-21 22:13:31 +02:00
f61ffec352 Fixed Baggy theme CSS for Chrome Extension (and < 500px width layout) 2014-05-21 15:54:54 -04:00
88f0e31622 Merge pull request #703 from tcitworld/images_security
Security fixes for downloaded images (thanks @leblanc-simon)
2014-05-20 11:55:20 +02:00
38eecef26b Added info for DOWNLOAD_PICTURES
We regenerate pictures, it might take some time
2014-05-20 11:46:05 +02:00
99408dfcf3 Merge pull request #1 from leblanc-simon/images_security
Optimisation et gestion des erreurs
2014-05-20 11:42:22 +02:00
0bf0dfe10d Optimisation et gestion des erreurs 2014-05-20 00:42:51 +02:00
e3b00bcaf5 Fixed bug for png images 2014-05-19 15:59:18 +02:00
6caba976ec Bug with bracket 2014-05-19 15:34:49 +02:00
1d6a9ac25a Option for setting quality 2014-05-19 15:24:11 +02:00
03e501dedd Merge branch 'dev' into images_security 2014-05-19 15:04:09 +02:00
18209292a4 Fix bad character encoding when downloading images 2014-05-19 15:01:36 +02:00
007f26e582 Security fix for Download Images 2014-05-18 22:11:56 +02:00
04b43dc097 Merge pull request #697 from tcitworld/dev
Up-to-date with me
2014-05-18 19:00:51 +02:00
becc5bfbf2 Fix for #678 2014-05-18 18:56:20 +02:00
230fa05eb7 Better Grammar 2014-05-17 20:32:38 +02:00
96834a47b0 Added PHPePub 2014-05-16 17:38:19 +02:00
e212e6b12a Cleaned epub fonction 2014-05-16 16:49:09 +02:00
404adf970d Merge branch 'epub' into dev
Conflicts:
	themes/baggy/home.twig
2014-05-16 16:31:18 +02:00
7d5d9ea449 Merge pull request #693 from tcitworld/dev
better wallabag in wallabag button (see #685)
2014-05-16 15:54:54 +02:00
74e09e562b better wallabag in wallabag button (see #685) 2014-05-16 15:34:13 +02:00
60c3a4d3e1 Merge pull request #689 from tcitworld/dev
Tag-related features
2014-05-16 13:31:53 +02:00
f3f0b11393 Better names for epub files and epub in all themes now 2014-05-15 15:42:36 +02:00
f2b6b4e230 Fix bugs and improved epub rendering 2014-05-14 22:03:16 +02:00
6a3c510157 Merge branch 'dev' of https://github.com/wallabag/wallabag into epub 2014-05-14 19:17:51 +02:00
4555c38d3b Changed theme for better translation method 2014-05-14 19:08:33 +02:00
24696800e5 Simplifed function which does tag cleanup 2014-05-14 18:51:02 +02:00
818b186f8a Merge pull request #680 from m-r-r/fr-1.6.1
French translation update
2014-05-13 16:44:16 +02:00
4910af33ff Removed unnecessary function for cleaning tags 2014-05-11 16:14:47 +02:00
0626e52f3c Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-05-11 15:44:43 +02:00
f034640ca3 Added advices to submit a bug
Discussion at #662.
2014-05-11 15:33:44 +02:00
1829b362fc Updated the french translation 2014-05-10 20:11:00 +02:00
34acb02cbb Added translation capabilities for epub system 2014-05-07 12:48:46 +02:00
4877836b12 Many improvements to epub produced : better cover, better tags 2014-05-07 12:40:09 +02:00
07ed2b0231 #568 missing rss.png files 2014-05-02 17:04:08 +02:00
9c743ab965 Clean old unused tags when deleting a tag 2014-04-30 12:14:20 +02:00
78bddb22be Remove unnecessary line 2014-04-30 11:31:21 +02:00
decc23aaf2 Added save search as tag functionality 2014-04-30 11:25:03 +02:00
2395a3802a Changed template organisation 2014-04-29 19:57:59 +02:00
7ec445b06e Big changes for epub export. Now possible to do it from a tag, a category and a search. Also, improved ebook rendering. 2014-04-25 16:20:25 +02:00
21f29fe492 Merge pull request #667 from mariroz/dev
fix of putenv warning under safe mode, issue #646
2014-04-25 13:03:09 +02:00
5b5e47c3ae fix of already defined constant notice, issue #653 2014-04-25 13:41:42 +03:00
b6413975c3 fix of putenv warning under safe mode, issue #646 2014-04-25 13:25:03 +03:00
d151b51c67 Merge pull request #665 from mariroz/dev
fix of rss headers problem
2014-04-24 18:05:16 +02:00
827f5b42a6 fix of rss headers problem 2014-04-24 11:48:00 +03:00
ef17914960 Fix for #664 - Missing source url attribute in RSS feeds 2014-04-24 09:39:50 +02:00
72a857158c Fixed a bug into PHPePub with special caracters 2014-04-24 03:08:31 +02:00
87090d8ae7 Added epub export function 2014-04-24 03:04:02 +02:00
8af31ae0f7 Added default statement for db system 2014-04-23 22:48:33 +02:00
feecea2806 Fix #657 and postgresql problems 2014-04-23 22:39:43 +02:00
07da861126 Added multi-user functionnality in all themes 2014-04-23 10:53:57 +02:00
c97d23c533 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-04-23 10:34:22 +02:00
4d99bae893 Fixed Multi-user system 2014-04-23 10:29:53 +02:00
2a6440c134 Merge pull request #659 from mariroz/dev
last error: config.inc.default.php missed
2014-04-22 21:44:12 +02:00
4dbba60439 last error: config.inc.default.php missed 2014-04-22 22:38:10 +03:00
29cf52b677 Merge pull request #658 from mariroz/dev
inc/poche/config.inc.php.new removed
2014-04-22 20:48:42 +02:00
fd86559a5b inc/poche/config.inc.php.new removed 2014-04-22 21:39:03 +03:00
d70dd7ac69 Merge pull request #653 from mariroz/dev
print view fixed in baggy; print link added; read percent added in default theme; archive and favorite re-factored to be ajax action in article view
2014-04-22 20:18:46 +02:00
43c7b978c3 config.inc.php.new renamed in config.inc.default.php 2014-04-22 20:58:40 +03:00
dfff18f81b Merge pull request #655 from julien-m/patch-2
parse mobile.lemondeinformatique.fr
2014-04-22 18:24:17 +02:00
a4a870e1ec default config is included after user config to prevent undefined constant warning 2014-04-22 19:11:26 +03:00
03303cd71b parse mobile.lemondeinformatique.fr
site_config file created because the title isn't parsed by default for mobile version of lemondeinformatique.fr
2014-04-22 14:44:31 +02:00
c2cf7075c2 print view fixed in baggy; print link added; read percent added in default theme; archive and favorite re-factored to be ajax action in article view 2014-04-22 10:45:09 +03:00
bfe1ad6dbc Merge pull request #643 from wallabag/fix-636
[fix] rss feed content type set to text/xml #636
2014-04-15 21:49:37 +02:00
6212acfc81 [fix] rss feed content type set to text/xml #636 2014-04-15 21:49:00 +02:00
847f57686e Merge pull request #642 from jplock/patch-2
Added IF NOT EXISTS
2014-04-14 15:42:09 +02:00
44fd0faa23 Added IF NOT EXISTS 2014-04-14 09:40:35 -04:00
df6c8b3be9 Merge pull request #637 from Bubbendorf/dev
Improvements on french translation
2014-04-13 12:50:48 +02:00
a192c21c6a Improved french translation 2014-04-13 00:02:03 +02:00
f3312ce58d Merge pull request #635 from DmitrySandalov/dev
added missing image to dmagenta theme
2014-04-11 22:56:59 +02:00
603ecb0052 added missing image to dmagenta theme 2014-04-12 00:08:11 +04:00
4a74d9857c Merge pull request #634 from wallabag/dev
1.6.1
2014-04-11 17:22:04 +02:00
7256e9e139 1.6.1 version 2014-04-11 17:08:11 +02:00
f09d76b0ea Merge pull request #633 from mariroz/dev
error with empty content by import fixed. Also youtube and vimeo videos are allowd in content now.
2014-04-11 16:56:59 +02:00
0f859c6f32 error with empty content by import fixed. Also youtube and vimeo videos are allowd in content now. 2014-04-11 17:21:54 +03:00
389d751e92 Merge pull request #632 from mariroz/dev
logging by import added; error by creation table if exists in postgresql...
2014-04-11 14:00:04 +02:00
5ce3978472 logging by import added; error by creation table if exists in postgresql fixed. 2014-04-11 14:43:17 +03:00
d5f36a8d9e Merge pull request #623 from wallabag/fix-610
Fix display problem with smartphone and Baggy #610
2014-04-08 22:43:39 +02:00
08f539f738 responsive for search form #610 2014-04-08 22:42:34 +02:00
6e8030a0db [fix] display problem with smartphone and Baggy #610 2014-04-08 22:33:28 +02:00
b96b075b55 Merge pull request #622 from wallabag/fix-612
[fix] Escap key displays save a link form #612
2014-04-08 22:11:17 +02:00
f8e9d8bdbc [fix] Escap key displays save a link form #612 2014-04-08 22:10:40 +02:00
bf20b541ae Merge pull request #621 from wallabag/fix-613
can't close search popup with the cross picture #613
2014-04-08 21:59:40 +02:00
3945335f39 can't close search popup with the cross picture #613 2014-04-08 21:58:44 +02:00
2c534c184d Merge pull request #618 from mariroz/dev
remove duplicates by import; code formatting changes: tabs replaced with spaces
2014-04-08 10:54:17 +02:00
a8ef1f3f43 code formatting changes: tabs replaced with spaces, some other small formatting enhancements 2014-04-08 11:49:41 +03:00
86da39886d remove duplicates by import, code changes: tabs replaced with spaces 2014-04-08 11:41:06 +03:00
a7f39918bf Merge pull request #614 from wallabag/fix-host-getpocheurl
[fix] with some config, http host is different
2014-04-07 15:45:26 +02:00
69c57493e7 [fix] with some config, http host is different 2014-04-07 15:44:05 +02:00
5fe1948097 Merge pull request #611 from wallabag/fix-french-locale
update french locale, thx to @goofy-bz and @Draky50110 #596
2014-04-07 15:15:42 +02:00
d9b51a21fa update french locale, thx to @goofy-bz and @Draky50110 #596 2014-04-07 15:14:50 +02:00
9cb9ab552b Merge pull request #609 from wallabag/fix-desciption-typo
remove unnecessary variable declaration
2014-04-06 20:54:20 +02:00
7a873ef1d7 remove unnecessary variable declaration 2014-04-06 20:53:31 +02:00
292cd0dbd5 Merge pull request #606 from wallabag/fix-556
in RSS feed, add link to wallabag URL #556
2014-04-06 16:40:17 +02:00
f86784c22d in RSS feed, add link to wallabag URL #556 2014-04-06 16:39:11 +02:00
2dd5c1e4a3 Merge pull request #605 from wallabag/fix-604
[fix] Use of undefined constant ATOM #604
2014-04-06 16:22:57 +02:00
29d9c0ffe1 [fix] Use of undefined constant ATOM #604 2014-04-06 16:21:48 +02:00
d7ee9f986b Merge pull request #603 from mariroz/dev
postgres sequence error fix, issue #602
2014-04-05 12:36:20 +02:00
1bcbe8bebf postgres sequence error fix, issue #602 2014-04-05 11:22:33 +03:00
db117db3c5 Fix to #600 2014-04-04 22:36:33 +02:00
4a16f33dcc Changed copyright to 2014
Happy new year !
2014-04-04 22:13:06 +02:00
0d67b00d5d Merge pull request #595 from wallabag/dev
wallabag 1.6.0
2014-04-03 14:42:03 +02:00
7d2f1aa279 [add] link on config page to fetch content 2014-04-03 14:39:13 +02:00
bfa32856bc yeah, 1.6, one year after the 1st commit 2014-04-03 13:54:06 +02:00
06e1a9a98a import w/o cron: fix of "click to finish import" in baggy theme 2014-04-03 14:35:50 +03:00
d9bb0cdeb8 import w/o cron: explanation added 2014-04-03 13:53:47 +03:00
4d2bd6e507 import w/o cron: error in url fix 2014-04-03 13:19:54 +03:00
a297fb1e38 import w/o cron 2014-04-03 12:18:49 +03:00
a4585f7eaa import without cron 2014-04-02 22:33:06 +03:00
182faf2696 import without cron 2014-04-02 20:55:19 +03:00
d967a1fa14 Important fixes for search engine (thx @mariroz)
So sorry for the mess... :(
* search only in users' own articles
* sanitized what is searched
* display what is searched
* pagination, sorting available when searching
* use existing function to query db
* bad encoding caracters fixed
* link to JQuery into default theme, no longer in each theme
* some spaces instead of tabs
2014-04-02 17:44:47 +02:00
22db488d21 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-03-30 21:17:28 +02:00
1be13ba1fc oops, restore @tcitworld commit. I'm so tired 2014-03-30 21:16:45 +02:00
d6d8a045e6 Merge pull request #588 from mariroz/dev
fix of bug with default theme constant
2014-03-30 20:04:55 +02:00
1d0995bb8e [fix] undefined vars in install script 2014-03-30 19:57:39 +02:00
3345c9dc39 fix of bug with default theme constant 2014-03-28 21:19:08 +02:00
fecb62a396 Improvements to install script
* automatically remove install/ folder
* go easier though the compatibility test <-> install script pages
* Small fixes which raised php warnings
2014-03-28 20:00:02 +01:00
ad697686c0 Final Fix of #570
Adds a date information to the exported data file.
2014-03-28 16:53:06 +01:00
cdada41505 Merge pull request #587 from mariroz/dev
problem with resources and localhost url fix
2014-03-28 10:30:51 +01:00
08718c01e4 problem with resources and localhost url fix 2014-03-28 11:26:48 +02:00
b152f2b6ba Fix to bug #570
Forces the download of the data exported file as a poche-export file.
2014-03-28 00:57:07 +01:00
04fbe8f5ef Merge pull request #586 from mariroz/wb-link-in-wb
wallabag a link in wallabag now in default theme, issue #505
2014-03-27 19:44:28 +01:00
e68348f627 wallabag a link in wallabag now in default theme, issue #505 2014-03-27 18:21:30 +02:00
9591ee2603 Merge pull request #585 from kevmeyer/dev
updated german localisation
2014-03-27 13:56:40 +01:00
5814ef0d25 updated german localisation 2014-03-27 13:44:19 +01:00
d607330557 Improvements for compatibility_test file
- gettext detection (not default on WAMP) ; part fix of #579
- added colors to make viewing what's wrong better and quicker
(green/orange/red)
- added a link to index.php if it's good
2014-03-26 18:46:46 +01:00
ad03eb6286 Fix of #580 : Add some random for Windows hosts 2014-03-26 17:19:57 +01:00
cc60cbbbab Finished search engine function
Now searches also in title and in original url
2014-03-26 16:36:42 +01:00
d619120fc4 Merge pull request #582 from mariroz/fix-session-livetime
fix of localhost cookie related to nginx binding to 0.0.0.0
2014-03-24 11:12:56 +01:00
2c4e7a1cea Fixes to search engine
Changed the search parameter from POST to GET.
Also, adapted the Baggy theme.
2014-03-23 23:52:05 +01:00
a33a3d2afb Implemented rudimental search engine 2014-03-22 11:09:18 +01:00
03832b45e1 fix of localhost cookie related to nginx binding to 0.0.0.0 2014-03-21 21:56:40 +02:00
028e34b6c4 Merge pull request #581 from mariroz/fix-session-livetime
fix of issue under nginx and php-fpm
2014-03-21 14:05:51 +01:00
ad53faf25c fix of issue under nginx and php-fpm 2014-03-21 14:59:30 +02:00
0c51bfea6f Merge pull request #576 from mariroz/fix-session-livetime
fix of  _SESSION - indefined variable
2014-03-19 19:26:05 +01:00
6fa3f70bc2 fix of _SESSION - indefined variable 2014-03-19 19:22:04 +02:00
db41c907aa Merge pull request #572 from mariroz/fix-session-livetime
fix of #115, server relater config value added
2014-03-18 21:29:58 +01:00
2a97194253 fix of #115, server relater config value added 2014-03-18 17:39:19 +02:00
a7048bc45d Merge pull request #567 from mariroz/fix-session-livetime
fix of #115 - stay connected and session livetime
2014-03-17 21:49:42 +01:00
eb5b677250 fix of #115 - stay connected and session livetime 2014-03-17 22:22:05 +02:00
897b2b5302 Merge pull request #566 from camporez/dev
Update brazilian traslation title to "Português (Brasil)"
2014-03-17 08:09:18 +01:00
5805ac4574 Update brazilian traslation title to "Português (Brasil)" 2014-03-16 16:43:46 -03:00
07e028fe5c Merge pull request #563 from camporez/dev
Update brazilian translation
2014-03-16 18:55:59 +01:00
08dde123b1 Correct README.md 2014-03-16 11:58:16 -03:00
82cff5af70 Update brazilian translation 2014-03-15 17:23:34 -03:00
8754bd88a5 Merge remote-tracking branches 'upstream/dev' and 'origin/master' into dev 2014-03-15 15:03:26 -03:00
6a915551ab acc 2014-03-14 14:15:26 -03:00
ed02e38e1d [fix] in RSS, link to original article 2014-03-14 09:35:48 +01:00
8d7cd2ccd5 [add] remove import file in CACHE when import is over 2014-03-14 08:54:44 +01:00
c0586a906c [fix] new import section in old themes #559 2014-03-14 08:37:40 +01:00
181d16fe22 Merge pull request #557 from mariroz/feature-add-link-inside-article-issue-505
saving link form now sends ajax request, article view is now justified (issue #554)
2014-03-13 20:57:22 +01:00
3ee27ee6ba saving link form now sends ajax request, article view is now justified 2014-03-13 18:37:08 +02:00
6775da70a8 feature #505 - it is now possible to add link from bagged article (TODO: redev it to ajax action). Some enhancements to "save a link" popup div 2014-03-12 17:36:04 +02:00
f7382cd8c3 Merge pull request #549 from mariroz/fix-tagform-and-shortcat-toggle-savelinkform-conflict
fix of conflict of s shortcat and entering s in input fields
2014-03-12 12:55:48 +01:00
7339b0b08d fix of conflict of s shortcat and entering s in input fields 2014-03-12 13:00:37 +02:00
1acd18510a Merge pull request #544 from mariroz/feature-tags-autocomplete
a lot of enhancements related to tags: tags list is now sorted, shows number of articles, autocomplete added according to #477, #542
2014-03-10 18:14:43 +01:00
fb26cc9375 a lot of enhancements related to tags: tags list is now sorted, shows number of articles, autocomplete added according to #477, #542 2014-03-10 16:28:47 +02:00
d47a05a9a5 Merge pull request #535 from bobmaerten/clarify-import-process
Changed config section to clarify import process.
2014-03-10 13:14:26 +01:00
17b2afefad [fix] test if user_id doesn't exist in feeds generation 2014-03-10 08:10:03 +01:00
4744cb0e1d bagit link + overlay save link + listmode 2014-03-08 13:47:15 +01:00
7c6aa8d826 Changed text to clarify import process. 2014-03-07 16:46:46 +01:00
b3f7b7d200 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-03-07 14:49:46 +01:00
1ab567f6e3 [add] clean content articles in cron 2014-03-07 14:49:36 +01:00
f0d584503f Merge pull request #533 from mariroz/dev
fix of #530 - import fail from Poche
2014-03-07 13:59:38 +01:00
042486c511 fix of #530 - import fail from Poche 2014-03-07 14:52:52 +02:00
ded2c63312 Merge pull request #532 from wallabag/upload-file
New import system
2014-03-07 13:26:56 +01:00
bf79463070 Merge pull request #531 from mariroz/upload-file
getPageContent moved to Tools, fix of #426
2014-03-07 11:57:11 +01:00
f98373cc34 getPageContent moved to Tools, fix of #426 2014-03-07 12:54:08 +02:00
25114854b3 [fix] remember scroll position for baggy theme #519 2014-03-06 18:57:04 +01:00
4ca17924a1 [fix] links for firefox / android / ios apps 2014-03-06 18:45:15 +01:00
9a010227d7 Merge pull request #524 from kevmeyer/dev
updated german localization
2014-03-04 12:40:43 +01:00
e1a625ad35 added missing german localization strings 2014-03-04 11:53:40 +01:00
eace9f914d updated german localization 2014-03-04 11:32:45 +01:00
d3b52886f5 [change] ignore tmp files in HTML purifier 2014-03-02 08:52:03 +01:00
71b0d53c5e [fix] #115 cookie lifetime was empty 2014-03-02 08:38:26 +01:00
11c680f97a [add] display last check of wallabag release 2014-03-01 19:10:17 +01:00
223268c2fa [fix] RSS Feeds don't validate / W3C #384 2014-03-01 13:09:37 +01:00
53e3158dfe [add] cron to fetch content on imported entries 2014-02-28 21:49:38 +01:00
31a10069a5 [add] upload form for import 2014-02-28 20:36:32 +01:00
4c14936353 road to 1.5.3 2014-02-28 14:57:04 +01:00
2bb207d005 [fix] #483 pdo_sqlite not required if we want mysql / pgsql 2014-02-28 14:54:50 +01:00
d429305836 [fix] #490 flattr icon in baggy theme 2014-02-28 14:27:10 +01:00
49c803425c Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-02-28 14:06:59 +01:00
cf75bb31e9 Merge pull request #517 from mariroz/dev
effect of block rebuilding on next page removed, issue #479
2014-02-28 12:17:18 +01:00
fc52df0677 effect of block rebuilding on next page removed, issue #479 2014-02-28 13:13:30 +02:00
6065553c13 effect of block rebuilding on next page removed, issue #479 2014-02-28 13:08:11 +02:00
346380e131 [add] label for brazilian language on config screen 2014-02-27 21:37:25 +01:00
affbd83b48 Merge pull request #515 from mariroz/dev
fix of #509, related to php 5.3
2014-02-27 21:23:10 +01:00
381d182726 Syntax fix.
I think this will be the smallest commit I'll ever make.
2014-02-27 21:16:16 +01:00
2048661b0c Merge pull request #513 from camporez/dev
Brazilian portuguese translation
2014-02-27 20:59:59 +01:00
6a0329f756 Add brazilian portuguese (pt-BR) translation
modified:   locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.mo
	renamed:    locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.mo -> locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.po
2014-02-27 16:36:32 -03:00
35c7e0a69c Create pt_BR.utf8.mo 2014-02-27 16:18:53 -03:00
decb9a5814 fix of #509, related to php 5.3 2014-02-27 18:12:43 +02:00
61e79d9344 Merge pull request #510 from mariroz/dev
some baggy theme fixes and enhancement: issue #479
2014-02-27 15:20:01 +01:00
36a733af8d some baggy theme fixes and enhancement: issue #479 2014-02-27 16:11:37 +02:00
a8464c9719 [fix] hover problem with logout link #489 2014-02-27 13:36:06 +01:00
e145f767f3 [add] empty cache after changing language #492 2014-02-27 13:26:07 +01:00
56532c4e72 [add] Empty cache after changing theme #503 2014-02-27 13:24:29 +01:00
fa37042b32 [fix] Baggy theme navigation bug #485 2014-02-27 13:21:54 +01:00
0e7f04b04e Merge pull request #504 from mariroz/dev
translation related: how-to md file added, script to generate php from all twig templates, polish mo file compiled
2014-02-26 14:56:15 +01:00
cbcae4037c translation related: how-to md file added, script to generate php from all twig templates, polish mo file compiled 2014-02-26 15:43:49 +02:00
72f7ff0589 Merge pull request #502 from skibbipl/patch-1
Update pl_PL.utf8.po
2014-02-26 09:23:26 +01:00
2c83741171 Update pl_PL.utf8.po
First cleanup, more to come.
2014-02-25 18:20:13 +01:00
78dd437928 Merge pull request #501 from mariroz/dev
fix of #498, #493, #494 - because disappeared in last commit
2014-02-25 18:10:32 +01:00
f5b5622a89 fix of #498, #493, #494 - because disappeared in last commit 2014-02-25 19:08:18 +02:00
bb75d2b01a Merge pull request #499 from mariroz/dev
French translation added by @Draky50110, issue #488
2014-02-25 17:57:38 +01:00
2cf87a4da1 French translation added by @Draky50110, issue #488 2014-02-25 18:40:25 +02:00
9fad46bd0e Merge pull request #495 from mariroz/dev
fix of global $http visibility, issues #493, #494
2014-02-25 17:27:51 +01:00
dcc73856a9 "poche" word removed completely, all locales .po files updated, en, pl, ru and uk .mo files recompiled. 2014-02-25 15:45:39 +02:00
4b842b20ce fix of #486 - import issue 2014-02-24 19:13:54 +02:00
49b56f19d8 Polish, Russian and Ukrainian locales updated, Franch locale po file uopdated. issue #488 2014-02-24 15:38:49 +02:00
25e1213d1b fix of global $http visibility, issues #493, #494 2014-02-24 12:19:46 +02:00
92fc97eeb3 [fix] redirect on config page after token generation #491 2014-02-23 09:56:21 +01:00
48e063904d [change] remove old logo #484 2014-02-23 09:50:11 +01:00
99679d0688 Merge pull request #481 from wallabag/dev
1.5.2
2014-02-21 15:57:10 +01:00
d3b47e9470 [release] 1.5.2 2014-02-21 15:44:57 +01:00
1570a65381 [fix] content is now cleaned by HTML purifier from prevent XSS attack 2014-02-21 15:44:13 +01:00
d4949327ef [add] HTML Purifier added to clean code 2014-02-21 15:43:14 +01:00
c9bd17a100 [add] languages well displayed on config page #480 2014-02-21 15:24:33 +01:00
0a022f9a39 [add] slovene language 2014-02-21 15:11:45 +01:00
565bb72d99 [fix] link in footer was unclickable #453 2014-02-21 15:00:21 +01:00
e5382002b4 [change] login button into sign in 2014-02-21 14:58:07 +01:00
3628b24d12 [change] remove some poche terms in old default theme #471 2014-02-21 14:53:43 +01:00
cd425599ce typo in fonts call and in label on config screen 2014-02-21 14:08:20 +01:00
e7345a2c4f Merge branch 'dev' of git://github.com/mariroz/wallabag into dev 2014-02-21 13:44:30 +01:00
032e0ca13a a lot of refactoring: tag action is now handled by home view and uses sorting and pagination. Some small view enhacenments. Fix of #476, #461 for baggy and other themes 2014-02-20 19:28:39 +02:00
3ade95a3d7 [fix] themes sorted A->Z #470 2014-02-20 13:29:53 +01:00
fddf4fbacc Merge branch 'dev' of git://github.com/arnaudmm/wallabag into arnaudmm-dev 2014-02-20 13:15:27 +01:00
926acd7bba Feature #457 : import from pocket now import tags too 2014-02-20 13:09:27 +01:00
8975653d4c Merge branch 'mariroz-dev' into dev 2014-02-20 13:03:59 +01:00
689de3dbcc rename font folder into fonts in baggy theme 2014-02-20 13:02:13 +01:00
ab5bb94b12 Merge branch 'dev' of git://github.com/mariroz/wallabag into mariroz-dev 2014-02-20 12:49:49 +01:00
6203ef8e51 Merge remote-tracking branch 'upstream/dev' into dev 2014-02-20 11:42:18 +02:00
e83cf5a787 multiple tag entry displayed fix, issue #474 2014-02-20 10:41:16 +02:00
d09a5674e9 [add] message in install screen to prevent user when wallabag is already installed 2014-02-20 08:58:59 +01:00
d0a599bbae Merge pull request #473 from nsteinmetz/dev
Baggy Theme - PtSans font is now local
2014-02-20 08:27:54 +01:00
30c12d3927 add font file 2014-02-19 23:30:55 +01:00
860473f33c Update font.css
Add reference for ptsans font in local instead of google fonts
2014-02-19 23:09:12 +01:00
e1cfef7bf1 Update _head.twig
Remove googlefonts now called in font.css - need still to put the woff file in font directory
2014-02-19 23:08:01 +01:00
b4fd2154fe Full-Text RSS included as a script instead of file_get_contents call. Tnx to @Faless. Fix issues #366 and #463 2014-02-19 19:08:19 +02:00
f37891fdb6 [fix] css display with baggy theme 2014-02-19 15:20:13 +01:00
aad8fbab09 Merge branch 'dev' of https://github.com/wallabag/wallabag into dev 2014-02-19 15:19:02 +01:00
7785f0c75f Merge pull request #467 from mariroz/dev
"save a link" added to top menu (default theme) to toggle "save link" form,  issue #461
2014-02-19 15:17:13 +01:00
a71dc5d7d0 Merge branch 'dev' of git://github.com/mariroz/wallabag into dev 2014-02-19 15:12:49 +01:00
655214ab30 Merge pull request #469 from wallabag/dev
version number 1.5.1
2014-02-19 13:56:06 +01:00
60ca369cd3 Merge pull request #468 from wallabag/dev
1.5.1
2014-02-19 13:47:11 +01:00
01cd443441 "save a link" added to top menu (default theme) to toggle "save link" form message, issue #461. "Mark all the entries as read" link added in default theme. 2014-02-16 21:00:30 +02:00
5e98c2183a Merge pull request #450 from wallabag/dev
1.5.0
2014-02-13 19:49:25 +01:00
1450 changed files with 40993 additions and 56923 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
; top-most EditorConfig file
root = true
; Unix-style newlines
[*]
end_of_line = LF
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

46
.gitignore vendored
View File

@ -1,6 +1,40 @@
assets/*
cache/*
vendor
composer.phar
db/poche.sqlite
inc/poche/config.inc.php
# Cache, logs & sessions
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
# Parameters
/app/config/parameters.yml
# Managed by Composer
/vendor/
# Assets and user uploads
/web/bundles/
/web/uploads/
# Build
/app/build
/build
# Composer PHAR
/composer.phar
# Data for wallabag
data/assets/*
data/db/wallabag*.sqlite
# Docker container logs and data
docker/logs/
docker/data/
# To avoid crazy stuff on some PR, we must manually FORCE ADD IT on each new release
composer.lock

28
.scrutinizer.yml Normal file
View File

@ -0,0 +1,28 @@
filter:
paths:
- src/*
excluded_paths:
- 'vendor/*'
- 'app/*'
- 'var/*'
- 'web/*'
- 'src/Wallabag/*Bundle/Tests/*'
- '*Test.php'
tools:
php_cs_fixer: true
php_analyzer: true
php_mess_detector: true
php_changetracking: true
php_code_sniffer: true
php_pdepend: true
sensiolabs_security_checker: true
#external_code_coverage:
# timeout: 3600
php_code_coverage: true
php_sim: false
php_cpd: false
checks:
php:
code_rating: true

51
.travis.yml Normal file
View File

@ -0,0 +1,51 @@
language: php
# faster builds on docker-container setup
sudo: false
# used for HHVM
addons:
apt:
packages:
- tidy
# cache vendor dirs
cache:
directories:
- vendor
- $HOME/.composer/cache
php:
- 5.5
- 5.6
- 7.0
- hhvm
env:
- DB=mysql
- DB=pgsql
- DB=sqlite
matrix:
fast_finish: true
exclude:
- php: hhvm
env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
allow_failures:
- php: hhvm
branches:
only:
- v2
before_script:
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
- composer self-update --no-progress
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
- if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag;' -U postgres; fi;
script:
- travis_wait composer update --no-interaction --no-progress
- ant prepare-$DB
- bin/phpunit -v

View File

@ -1,11 +1,30 @@
# How contributing
# How to contribute
## You found a bug
Please [open a new issue](https://github.com/wallabag/wallabag/issues/new).
To fix the bug quickly, we need some infos:
* your wallabag version (in ./index.php)
* your wallabag version (on top of the ./index.php file, and also on config page)
* your webserver installation :
* type of hosting (shared or dedicated)
* in case of a dedicated server, the server and OS used
* the php version used, eventually `phpinfo()`
* which storage system you choose at install (SQLite, MySQL/MariaDB or PostgreSQL)
* any problem on the `wallabag_compatibility_test.php` page
* any particular details which could be related
If relevant :
* the link you want to save and which causes problem
* the file you want to import into wallabag, or just an extract
If you have the skills :
* enable DEBUG mode and look the output at cache/log.txt
* look for errors into php and server logs
Note : If you have large portions of text, use [Github's Gist service](https://gist.github.com/) or other pastebin-like.
## You want to fix a bug or to add a feature
Please fork wallabag and work with **the dev branch** only. **Do not work on master branch**.
Please fork wallabag and work with **the dev branch** only. **Do not work on master branch**.
[Don't forget to read our guidelines](https://github.com/wallabag/wallabag/blob/dev/GUIDELINES.md).

View File

@ -1,14 +1,19 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
Copyright (c) 2013-2016 Nicolas Lœuillet
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,15 +1,3 @@
wallabag is based on :
* PHP Readability https://bitbucket.org/fivefilters/php-readability
* Full Text RSS http://code.fivefilters.org/full-text-rss/src
* Encoding https://github.com/neitanod/forceutf8
* logo by Maylis Agniel https://github.com/wallabag/logo
* icons http://icomoon.io
* PHP Simple HTML DOM Parser (for Pocket import) http://simplehtmldom.sourceforge.net/
* Session https://github.com/tontof/kriss_feed/blob/master/src/class/Session.php
* Twig http://twig.sensiolabs.org
* Flash messages https://github.com/plasticbrain/PHP-Flash-Messages
* Pagination https://github.com/daveismyname/pagination
wallabag is mainly developed by [Nicolas Lœuillet](https://github.com/nicosomb), [@j0k3r](https://github.com/j0k3r) and [@tcitworld](https://github.com/tcitworld) under the MIT License.
wallabag is developed by Nicolas Lœuillet under the Do What the Fuck You Want to Public License
Contributors : https://github.com/wallabag/wallabag/graphs/contributors
Thank you [to others contributors](https://github.com/wallabag/wallabag/graphs/contributors).

13
Capfile Normal file
View File

@ -0,0 +1,13 @@
set :deploy_config_path, 'app/config/capistrano/deploy.rb'
set :stage_config_path, 'app/config/capistrano/deploy'
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
require 'capistrano/symfony'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

5
Gemfile Normal file
View File

@ -0,0 +1,5 @@
source "https://rubygems.org"
gem 'capistrano', '~> 3.1'
gem 'capistrano-symfony', '~> 0.1', :github => 'capistrano/symfony'
gem 'capistrano-composer', '~> 0.0.3'

41
Gemfile.lock Normal file
View File

@ -0,0 +1,41 @@
GIT
remote: git://github.com/capistrano/symfony.git
revision: ca56a01b817097d2831400ef9b1867fc8e07dcf8
specs:
capistrano-symfony (0.4.0)
capistrano (~> 3.1)
capistrano-composer (~> 0.0.3)
capistrano-file-permissions (~> 0.1.0)
GEM
remote: https://rubygems.org/
specs:
capistrano (3.4.0)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
capistrano-composer (0.0.6)
capistrano (>= 3.0.0.pre)
capistrano-file-permissions (0.1.1)
capistrano (~> 3.1)
colorize (0.7.7)
i18n (0.7.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
rake (10.4.2)
sshkit (1.7.1)
colorize (>= 0.7.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
PLATFORMS
ruby
DEPENDENCIES
capistrano (~> 3.1)
capistrano-composer (~> 0.0.3)
capistrano-symfony (~> 0.1)!
BUNDLED WITH
1.10.6

View File

@ -1,10 +1,26 @@
# what is wallabag ?
wallabag is a self hostable application allowing you to not miss any content anymore. Click, save, read it when you can. It extracts content so that you can read it when you have time.
[![Build Status](https://travis-ci.org/wallabag/wallabag.svg?branch=v2)](https://travis-ci.org/wallabag/wallabag)
[![Code Coverage](https://scrutinizer-ci.com/g/wallabag/wallabag/badges/coverage.png?b=v2)](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=v2)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wallabag/wallabag/badges/quality-score.png?b=v2)](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=v2)
# What is wallabag?
wallabag is a self hostable application allowing you to not miss any content anymore.
Click, save and read it when you can. It extracts content so that you can read it when you have time.
More informations on our website: [wallabag.org](http://wallabag.org)
# Want to test the v2?
Keep in mind it's an **unstable** branch, everything can be broken :)
If you don't have it yet, please [install composer](https://getcomposer.org/download/). Then you can install wallabag by executing the following commands:
```
composer create-project wallabag/wallabag wallabag 2.0.*@alpha
php bin/console wallabag:install
php bin/console server:run
```
## License
Copyright © 2010-2013 Nicolas Lœuillet <nicolas@loeuillet.org>
Copyright © 2013-2016 Nicolas Lœuillet <nicolas@loeuillet.org>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.
terms of the MIT License. See the COPYING file for more details.

7
app/.htaccess Normal file
View File

@ -0,0 +1,7 @@
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

7
app/AppCache.php Normal file
View File

@ -0,0 +1,7 @@
<?php
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
class AppCache extends HttpCache
{
}

68
app/AppKernel.php Normal file
View File

@ -0,0 +1,68 @@
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\RestBundle\FOSRestBundle(),
new FOS\UserBundle\FOSUserBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
new Liip\ThemeBundle\LiipThemeBundle(),
new Wallabag\CoreBundle\WallabagCoreBundle(),
new Wallabag\ApiBundle\WallabagApiBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
}
return $bundles;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}
public function getLogDir()
{
return dirname(__DIR__).'/var/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
}

0
assets/.gitignore → app/Resources/views/.gitkeep Executable file → Normal file
View File

13
app/autoload.php Normal file
View File

@ -0,0 +1,13 @@
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
return $loader;

View File

@ -0,0 +1,23 @@
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, 'wallabag'
set :repo_url, 'git@github.com:wallabag/wallabag.git'
set :ssh_user, 'framasoft_bag'
server '78.46.248.87', user: fetch(:ssh_user), roles: %w{web app db}
set :scm, :git
set :format, :pretty
set :log_level, :info
# set :log_level, :debug
set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --optimize-autoloader'
set :linked_files, %w{app/config/parameters.yml}
set :linked_dirs, %w{app/logs web/uploads data}
set :keep_releases, 3
after 'deploy:finishing', 'deploy:cleanup'

View File

@ -0,0 +1,2 @@
set :branch, 'v2'
set :deploy_to, '/var/www/v2.wallabag.org/web/'

209
app/config/config.yml Normal file
View File

@ -0,0 +1,209 @@
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
framework:
#esi: ~
translator: { fallback: "%locale%" }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: session.handler.native_file
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
fragments: ~
http_method_override: true
assets: ~
wallabag_core:
languages:
en: 'English'
fr: 'Français'
de: 'Deutsch'
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain']
resource_dir: "%kernel.root_dir%/../web/uploads/import"
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
globals:
share_twitter: %share_twitter%
share_mail: %share_mail%
share_shaarli: %share_shaarli%
shaarli_url: %shaarli_url%
share_diaspora: %share_diaspora%
diaspora_url: %diaspora_url%
flattr: %flattr%
flattrable: 1
flattred: 2
carrot: %carrot%
show_printlink: %show_printlink%
export_epub: %export_epub%
export_mobi: %export_mobi%
export_pdf: %export_pdf%
version: %app.version%
twofactor_auth: %twofactor_auth%
warning_message: %warning_message%
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
form_themes:
- "LexikFormFilterBundle:Form:form_div_layout.html.twig"
# Assetic Configuration
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: [ ]
#java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
# Doctrine Configuration
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
auto_mapping: true
stof_doctrine_extensions:
default_locale: "%locale%"
translation_fallback: true
orm:
default:
tree: true
sluggable: true
doctrine_migrations:
dir_name: "%kernel.root_dir%/DoctrineMigrations"
namespace: Application\Migrations
table_name: migration_versions
name: Application Migrations
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
fos_rest:
param_fetcher_listener: true
body_listener: true
format_listener: true
view:
view_response_listener: 'force'
formats:
xml: true
json : true
templating_formats:
html: true
force_redirects:
html: true
failed_validation: HTTP_BAD_REQUEST
default_engine: twig
routing_loader:
default_format: json
nelmio_api_doc:
sandbox:
enabled: false
name: wallabag API documentation
nelmio_cors:
defaults:
allow_credentials: false
allow_origin: []
allow_headers: []
allow_methods: []
expose_headers: []
max_age: 0
hosts: []
#origin_regex: false
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
'^/':
#origin_regex: true
allow_origin: ['^http://localhost:[0-9]+']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
hosts: ['^api\.']
liip_theme:
load_controllers: false
themes:
- baggy
- material
autodetect_theme: wallabag_core.helper.detect_active_theme
path_patterns:
bundle_resource:
- %%bundle_path%%/Resources/views/themes/%%current_theme%%/%%template%%
fos_user:
db_driver: orm
firewall_name: main
user_class: Wallabag\UserBundle\Entity\User
registration:
confirmation:
enabled: true
fos_oauth_server:
db_driver: orm
client_class: Wallabag\ApiBundle\Entity\Client
access_token_class: Wallabag\ApiBundle\Entity\AccessToken
refresh_token_class: Wallabag\ApiBundle\Entity\RefreshToken
auth_code_class: Wallabag\ApiBundle\Entity\AuthCode
service:
user_provider: fos_user.user_manager
scheb_two_factor:
trusted_computer:
enabled: true
cookie_name: wllbg_trusted_computer
cookie_lifetime: 2592000
email:
enabled: %twofactor_auth%
sender_email: %twofactor_sender%
digits: 6
template: WallabagUserBundle:Authentication:form.html.twig
mailer: wallabag_user.auth_code_mailer
kphoen_rulerz:
executors:
doctrine: true

44
app/config/config_dev.yml Normal file
View File

@ -0,0 +1,44 @@
imports:
- { resource: config.yml }
framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: false
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [!event]
console:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: INFO
VERBOSITY_VERY_VERBOSE: DEBUG
channels: [!event, !doctrine]
console_very_verbose:
type: console
bubble: false
verbosity_levels:
VERBOSITY_VERBOSE: NOTICE
VERBOSITY_VERY_VERBOSE: NOTICE
VERBOSITY_DEBUG: DEBUG
channels: [doctrine]
assetic:
use_controller: true
swiftmailer:
# see http://mailcatcher.me/
transport: smtp
host: 'localhost'
port: 1025

View File

@ -0,0 +1,25 @@
imports:
- { resource: config.yml }
#framework:
# validation:
# cache: apc
#doctrine:
# orm:
# metadata_cache_driver: apc
# result_cache_driver: apc
# query_cache_driver: apc
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console

View File

@ -0,0 +1,36 @@
imports:
- { resource: config_dev.yml }
framework:
test: ~
session:
storage_id: session.storage.mock_file
profiler:
collect: false
web_profiler:
toolbar: false
intercept_redirects: false
swiftmailer:
# to be able to read emails sent
spool:
type: file
doctrine:
dbal:
driver: "%test_database_driver%"
host: "%test_database_host%"
port: "%test_database_port%"
dbname: "%test_database_name%"
user: "%test_database_user%"
password: "%test_database_password%"
charset: UTF8
path: "%test_database_path%"
orm:
metadata_cache_driver:
type: service
id: filesystem_cache
query_cache_driver:
type: service
id: filesystem_cache

View File

@ -0,0 +1,75 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
# Uncomment these settings or manually update your parameters.yml
# to use docker-compose
#
# database_driver: %env.database_driver%
# database_host: %env.database_host%
# database_port: %env.database_port%
# database_name: %env.database_name%
# database_user: %env.database_user%
# database_password: %env.database_password%
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: 127.0.0.1
test_database_port: ~
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

33
app/config/routing.yml Normal file
View File

@ -0,0 +1,33 @@
wallabag_import:
resource: "@WallabagImportBundle/Controller/"
type: annotation
prefix: /import
wallabag_api:
resource: "@WallabagApiBundle/Resources/config/routing.yml"
prefix: /
app:
resource: "@WallabagCoreBundle/Controller/"
type: annotation
doc-api:
resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
prefix: /api/doc
rest :
type : rest
resource : "routing_rest.yml"
prefix : /api
homepage:
path: "/{page}"
defaults: { _controller: WallabagCoreBundle:Entry:showUnread, page : 1 }
requirements:
page: \d+
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
fos_oauth_server_token:
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"

View File

@ -0,0 +1,14 @@
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
_errors:
resource: "@TwigBundle/Resources/config/routing/errors.xml"
prefix: /_error
_main:
resource: routing.yml

View File

@ -0,0 +1,3 @@
Rest_Wallabag:
type : rest
resource: "@WallabagApiBundle/Resources/config/routing_rest.yml"

60
app/config/security.yml Normal file
View File

@ -0,0 +1,60 @@
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
providers:
administrators:
entity: { class: WallabagUserBundle:User, property: username }
fos_userbundle:
id: fos_user.user_provider.username
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
oauth_token:
pattern: ^/oauth/v2/token
security: false
api:
pattern: /api/.*
fos_oauth: true
stateless: true
anonymous: true
login_firewall:
pattern: ^/login$
anonymous: ~
secured_area:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
anonymous: true
remember_me:
secret: "%secret%"
lifetime: 31536000
path: /
domain: ~
logout:
path: /logout
target: /
access_control:
- { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: ROLE_USER }

32
app/config/services.yml Normal file
View File

@ -0,0 +1,32 @@
parameters:
lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
services:
# used for tests
filesystem_cache:
class: Doctrine\Common\Cache\FilesystemCache
arguments:
- %kernel.cache_dir%/doctrine/metadata
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }
wallabag.twig_extension:
class: Wallabag\CoreBundle\Twig\WallabagExtension
public: false
tags:
- { name: twig.extension }
wallabag.locale_listener:
class: Wallabag\CoreBundle\EventListener\LocaleListener
arguments: ["%kernel.default_locale%"]
tags:
- { name: kernel.event_subscriber }
wallabag.user_locale_listener:
class: Wallabag\CoreBundle\EventListener\UserLocaleListener
arguments: ["@session"]
tags:
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }

View File

@ -0,0 +1,65 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag
test_database_user: root
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

View File

@ -0,0 +1,65 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_pgsql
test_database_host: localhost
test_database_port:
test_database_name: wallabag
test_database_user: travis
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

View File

@ -0,0 +1,65 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

29
bin/console Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
set_time_limit(0);
/**
* @var Composer\Autoload\ClassLoader $loader
*/
$loader = require __DIR__.'/../app/autoload.php';
$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
if ($debug) {
Debug::enable();
}
$kernel = new AppKernel($env, $debug);
$application = new Application($kernel);
$application->run($input);

1
bin/doctrine Symbolic link
View File

@ -0,0 +1 @@
../vendor/doctrine/orm/bin/doctrine

1
bin/doctrine-dbal Symbolic link
View File

@ -0,0 +1 @@
../vendor/doctrine/dbal/bin/doctrine-dbal

1
bin/doctrine-migrations Symbolic link
View File

@ -0,0 +1 @@
../vendor/doctrine/migrations/bin/doctrine-migrations

1
bin/doctrine.php Symbolic link
View File

@ -0,0 +1 @@
../vendor/doctrine/orm/bin/doctrine.php

1
bin/phpunit Symbolic link
View File

@ -0,0 +1 @@
../vendor/phpunit/phpunit/phpunit

1
bin/security-checker Symbolic link
View File

@ -0,0 +1 @@
../vendor/sensiolabs/security-checker/security-checker

143
bin/symfony_requirements Executable file
View File

@ -0,0 +1,143 @@
#!/usr/bin/env php
<?php
require_once dirname(__FILE__).'/../var/SymfonyRequirements.php';
$lineSize = 70;
$symfonyRequirements = new SymfonyRequirements();
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
echo_title('Symfony2 Requirements Checker');
echo '> PHP is using the following php.ini file:'.PHP_EOL;
if ($iniPath) {
echo_style('green', ' '.$iniPath);
} else {
echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!');
}
echo PHP_EOL.PHP_EOL;
echo '> Checking Symfony requirements:'.PHP_EOL.' ';
$messages = array();
foreach ($symfonyRequirements->getRequirements() as $req) {
/** @var $req Requirement */
if ($helpText = get_error_message($req, $lineSize)) {
echo_style('red', 'E');
$messages['error'][] = $helpText;
} else {
echo_style('green', '.');
}
}
$checkPassed = empty($messages['error']);
foreach ($symfonyRequirements->getRecommendations() as $req) {
if ($helpText = get_error_message($req, $lineSize)) {
echo_style('yellow', 'W');
$messages['warning'][] = $helpText;
} else {
echo_style('green', '.');
}
}
if ($checkPassed) {
echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects');
} else {
echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects');
echo_title('Fix the following mandatory requirements', 'red');
foreach ($messages['error'] as $helpText) {
echo ' * '.$helpText.PHP_EOL;
}
}
if (!empty($messages['warning'])) {
echo_title('Optional recommendations to improve your setup', 'yellow');
foreach ($messages['warning'] as $helpText) {
echo ' * '.$helpText.PHP_EOL;
}
}
echo PHP_EOL;
echo_style('title', 'Note');
echo ' The command console could use a different php.ini file'.PHP_EOL;
echo_style('title', '~~~~');
echo ' than the one used with your web server. To be on the'.PHP_EOL;
echo ' safe side, please check the requirements from your web'.PHP_EOL;
echo ' server using the ';
echo_style('yellow', 'web/config.php');
echo ' script.'.PHP_EOL;
echo PHP_EOL;
exit($checkPassed ? 0 : 1);
function get_error_message(Requirement $requirement, $lineSize)
{
if ($requirement->isFulfilled()) {
return;
}
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
$errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;
return $errorMessage;
}
function echo_title($title, $style = null)
{
$style = $style ?: 'title';
echo PHP_EOL;
echo_style($style, $title.PHP_EOL);
echo_style($style, str_repeat('~', strlen($title)).PHP_EOL);
echo PHP_EOL;
}
function echo_style($style, $message)
{
// ANSI color codes
$styles = array(
'reset' => "\033[0m",
'red' => "\033[31m",
'green' => "\033[32m",
'yellow' => "\033[33m",
'error' => "\033[37;41m",
'success' => "\033[37;42m",
'title' => "\033[34m",
);
$supports = has_color_support();
echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
}
function echo_block($style, $title, $message)
{
$message = ' '.trim($message).' ';
$width = strlen($message);
echo PHP_EOL.PHP_EOL;
echo_style($style, str_repeat(' ', $width).PHP_EOL);
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_repeat(' ', $width).PHP_EOL);
}
function has_color_support()
{
static $support;
if (null === $support) {
if (DIRECTORY_SEPARATOR == '\\') {
$support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
} else {
$support = function_exists('posix_isatty') && @posix_isatty(STDOUT);
}
}
return $support;
}

90
build.xml Normal file
View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="wallabag" default="build">
<target name="build" depends="clean,prepare,phpunit"/>
<target name="prepare-mysql" depends="clean,db_mysql,prepare"/>
<target name="prepare-sqlite" depends="clean,db_sqlite,prepare"/>
<target name="prepare-pgsql" depends="clean,db_pgsql,prepare"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/var/cache"/>
</target>
<target name="prepare" description="Prepare for build">
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:schema:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:fixtures:load"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="db_mysql" description="Run test for MySQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
<arg value="${basedir}/app/config/parameters.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="db_sqlite" description="Run test for SQLite">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
<arg value="${basedir}/app/config/parameters.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="db_pgsql" description="Run test for PostgreSQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
<arg value="${basedir}/app/config/parameters.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
<exec executable="phpunit" failonerror="true">
<arg value="--coverage-html"/>
<arg value="build/coverage"/>
</exec>
</target>
</project>

1
cache/.gitignore vendored
View File

@ -1 +0,0 @@
!.htaccess

2
cache/.htaccess vendored
View File

@ -1,2 +0,0 @@
Order deny,allow
Deny from all

View File

@ -1,40 +0,0 @@
<?php
// PHP 5.3 minimum
if (version_compare(PHP_VERSION, '5.3.3', '<')) {
die('This software require PHP 5.3.3 minimum');
}
// Short tags must be enabled for PHP < 5.4
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"');
}
}
// Check PDO Sqlite
if (! extension_loaded('pdo_sqlite')) {
die('PHP extension required: pdo_sqlite');
}
// Check ZIP
if (! extension_loaded('zip')) {
die('PHP extension required: zip');
}
// Check if /cache is writeable
if (! is_writable('cache')) {
die('The directory "cache" must be writeable by your web server user');
}
// Check if /db is writeable
if (! is_writable('db')) {
die('The directory "db" must be writeable by your web server user');
}
// install folder still present, need to install wallabag
if (is_dir('install')) {
require('install/index.php');
exit;
}

View File

@ -1,7 +1,119 @@
{
"name": "wallabag/wallabag",
"type": "project",
"description": "open source self hostable read-it-later web application",
"keywords": ["read-it-later","read it later"],
"homepage": "https://github.com/wallabag/wallabag",
"license": "MIT",
"authors": [
{
"name": "Nicolas Lœuillet",
"email": "nicolas@loeuillet.org",
"homepage": "http://www.cdetc.fr",
"role": "Developer"
},
{
"name": "Thomas Citharel",
"homepage": "http://tcit.fr",
"role": "Developer"
},
{
"name": "Jérémy Benoist",
"homepage": "http://www.j0k3r.net",
"role": "Developer"
}
],
"support": {
"email": "hello@wallabag.org",
"issues": "https://github.com/wallabag/wallabag/issues"
},
"require": {
"twig/twig": "1.*",
"twig/extensions": "1.0.*",
"umpirsky/twig-gettext-extractor": "1.1.*"
}
}
"php": ">=5.5.9",
"symfony/symfony": "3.0.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"nelmio/cors-bundle": "~1.4.0",
"friendsofsymfony/rest-bundle": "~1.4",
"jms/serializer-bundle": "~1.0",
"nelmio/api-doc-bundle": "~2.7",
"ezyang/htmlpurifier": "~4.6",
"mgargano/simplehtmldom": "~1.5",
"tecnickcom/tcpdf": "~6.2",
"simplepie/simplepie": "~1.3.1",
"willdurand/hateoas-bundle": "~1.0",
"htmlawed/htmlawed": "~1.1.19",
"liip/theme-bundle": "~1.1",
"pagerfanta/pagerfanta": "~1.0.3",
"lexik/form-filter-bundle": "~5.0",
"j0k3r/graby": "~1.0",
"friendsofsymfony/user-bundle": "dev-master",
"friendsofsymfony/oauth-server-bundle": "^1.5@dev",
"stof/doctrine-extensions-bundle": "^1.2@dev",
"scheb/two-factor-bundle": "~2.0",
"grandt/phpepub": "~4.0",
"wallabag/php-mobi": "~1.0.0",
"kphoen/rulerz-bundle": "~0.10",
"guzzlehttp/guzzle": "^5.2.0",
"doctrine/doctrine-migrations-bundle": "^1.0",
"paragonie/random_compat": "~1.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2",
"sensio/generator-bundle": "^3.0",
"phpunit/phpunit": "~4.4",
"symfony/phpunit-bridge": "^2.7"
},
"scripts": {
"build-parameters": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
],
"post-cmd": [
"@build-parameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@post-cmd"
],
"post-update-cmd": [
"@post-cmd"
]
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml",
"env-map": {
"mailer_host": "WALLABAG_MAILER_HOST",
"mailer_user": "WALLABAG_MAILER_USER",
"mailer_password": "WALLABAG_MAILER_PASSWORD",
"secret": "WALLABAG_SECRET"
}
}
},
"autoload": {
"psr-4": { "": "src/" },
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"prefer-stable": true
}

6992
composer.lock generated

File diff suppressed because it is too large Load Diff

0
themes/baggy/css/font.css → data/assets/.gitignore vendored Executable file → Normal file
View File

0
themes/courgette/css/knacss.css → data/db/.gitignore vendored Executable file → Normal file
View File

View File

@ -1,2 +0,0 @@
Order deny,allow
Deny from all

42
docker-compose.yml Normal file
View File

@ -0,0 +1,42 @@
nginx:
image: nginx
ports:
- "8080:80"
volumes:
- ./docker/nginx/nginx.conf:/nginx.conf
- ./docker/logs/nginx:/var/log/nginx
- .:/var/www/html
links:
- php:php
command: nginx -c /nginx.conf
php:
build: docker/php
ports:
- "9000:9000"
volumes:
- .:/var/www/html
#links:
# - "postgres:rdbms"
# - "mariadb:rdbms"
env_file:
- ./docker/php/env
# Comment non-used DBMS lines
# If all DBMS are commented out, sqlite will be used as default
# - ./docker/postgres/env
# - ./docker/mariadb/env
#postgres:
# image: postgres:9
# ports:
# - "5432:5432"
# volumes:
# - ./docker/data/pgsql:/var/lib/postgresql/data
# env_file:
# - ./docker/postgres/env
#mariadb:
# image: mariadb:10
# ports:
# - "3306:3306"
# volumes:
# - ./docker/data/mariadb:/var/lib/mysql
# env_file:
# - ./docker/mariadb/env

10
docker/mariadb/env Normal file
View File

@ -0,0 +1,10 @@
MYSQL_ROOT_PASSWORD=wallaroot
MYSQL_USER=wallabag
MYSQL_PASSWORD=wallapass
MYSQL_DATABASE=wallabag
SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
SYMFONY__ENV__DATABASE_HOST=rdbms
SYMFONY__ENV__DATABASE_PORT=3306
SYMFONY__ENV__DATABASE_NAME=wallabag
SYMFONY__ENV__DATABASE_USER=wallabag
SYMFONY__ENV__DATABASE_PASSWORD=wallapass

89
docker/nginx/nginx.conf Normal file
View File

@ -0,0 +1,89 @@
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
use epoll;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log off;
gzip on;
gzip_disable "msie6";
open_file_cache max=100;
upstream php-upstream {
server php:9000;
}
server {
#server_name domain.tld www.domain.tld;
root /var/www/html/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
# DEV
# This rule should only be placed on your development environment
# In production, don't include this and don't deploy app_dev.php or config.php
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
# PROD
location ~ ^/app\.php(/|$) {
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/app.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}
}
daemon off;

10
docker/php/Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM php:fpm
RUN apt-get update && apt-get install -y \
libmcrypt-dev libicu-dev libpq-dev libxml2-dev \
&& docker-php-ext-install \
iconv mcrypt mbstring intl pdo pdo_mysql pdo_pgsql
RUN usermod -u 1000 www-data
CMD ["php-fpm"]

6
docker/php/env Normal file
View File

@ -0,0 +1,6 @@
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite
SYMFONY__ENV__DATABASE_HOST=127.0.0.1
SYMFONY__ENV__DATABASE_PORT=~
SYMFONY__ENV__DATABASE_NAME=symfony
SYMFONY__ENV__DATABASE_USER=root
SYMFONY__ENV__DATABASE_PASSWORD=~

9
docker/postgres/env Normal file
View File

@ -0,0 +1,9 @@
POSTGRES_USER=wallabag
POSTGRES_PASSWORD=wallapass
POSTGRES_DB=wallabag
export SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
export SYMFONY__ENV__DATABASE_HOST=rdbms
export SYMFONY__ENV__DATABASE_PORT=5432
export SYMFONY__ENV__DATABASE_NAME=wallabag
export SYMFONY__ENV__DATABASE_USER=wallabag
export SYMFONY__ENV__DATABASE_PASSWORD=wallapass

0
docs/README.rst Normal file
View File

55
docs/en/conf.py Normal file
View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
#
# wallabag documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
import sys
import os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'wallabag'
copyright = u'2013-2016, Nicolas Lœuillet - MIT Licence'
version = '2.0.0'
release = version
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'default'
html_static_path = ['_static']
htmlhelp_basename = 'wallabagdoc'
latex_elements = {
}
latex_documents = [
('index', 'wallabag.tex', u'wallabag Documentation',
u'Nicolas Lœuillet', 'manual'),
]
man_pages = [
('index', 'wallabag', u'wallabag Documentation',
[u'Nicolas Lœuillet'], 1)
]
texinfo_documents = [
('index', 'wallabag', u'wallabag Documentation',
u'Nicolas Lœuillet', 'wallabag', 'wallabag is an opensource read-it-later.',
'Miscellaneous'),
]
##### Guzzle sphinx theme
import guzzle_sphinx_theme
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")

View File

@ -0,0 +1,51 @@
Run Wallabag in docker-compose
==============================
In order to run your own development instance of wallabag, you may
want to use the pre-configured docker compose files.
Requirements
------------
Make sure to have `Docker
<https://docs.docker.com/installation/ubuntulinux/>`__ and `Docker
Compose <https://docs.docker.com/compose/install/>`__ availables on
your system and up to date.
Switch DBMS
-----------
By default, Wallabag will start with a sqlite database.
Since Wallabag provide support for Postgresql and MySQL, docker
containers are also available for these ones.
In ``docker-compose.yml``, for the chosen DBMS uncomment :
- the container definition (``postgres`` or ``mariadb`` root level
block)
- the container link in the ``php`` container
- the container env file in the ``php`` container
In order to keep running Symfony commands on your host (such as
``wallabag:install``), you also should :
- source the proper env files on your command line, so variables
like ``SYMFONY__ENV__DATABASE_HOST`` will exist.
- create a ``127.0.0.1 rdbms`` on your system ``hosts`` file
Run Wallabag
------------
#. Fork and clone the project
#. Edit ``app/config/parameters.yml`` to replace ``database_*``
properties with commented ones (with values prefixed by ``env.``)
#. ``composer install`` the project dependencies
#. ``php app/console wallabag:install`` to create the schema
#. ``docker-compose up`` to run the containers
#. Finally, browse to http://localhost:8080/ to find your freshly
installed wallabag.
At various step, you'll probably run into UNIX permission problems,
bad paths in generated cache, etc…
Operations like removing cache files or changing files owners might
be frequently required, so don't be afraid !

37
docs/en/index.rst Normal file
View File

@ -0,0 +1,37 @@
wallabag documentation
======================
.. image:: ../img/wallabag.png
:alt: wallabag logo
:align: center
**wallabag** is a read-it-later application: it saves a web page by
keeping content only. Elements like navigation or ads are deleted.
The main documentation for this application is organized into a couple sections:
* :ref:`user-docs`
* :ref:`dev-docs`
.. _user-docs:
.. toctree::
:maxdepth: 2
:caption: User documentation
user/create_account
user/login
user/configuration
user/first_article
user/import
user/download_articles
user/filters
user/tags
.. _dev-docs:
.. toctree::
:maxdepth: 2
:caption: Developer documentation
developer/docker

2
docs/en/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Sphinx>=1.3.0,<1.4.0
guzzle_sphinx_theme>=0.7.0,<0.8.0

View File

@ -0,0 +1,99 @@
Configuration
=============
Now you're logged in, it's time to configure your account as you want.
Click on ``Config`` menu. You have five tabs: ``Settings``, ``RSS``, ``User information``, ``Password`` and ``Tagging rules``.
Settings
--------
Theme
~~~~~
wallabag is customizable. You can choose your prefered theme here. You can also create a new one, a chapter is dedicated for this. The default theme is ``Material``, it's the theme used in the documentation screenshots.
Items per page
~~~~~~~~~~~~~~
You can change the number of articles displayed on each page.
Language
~~~~~~~~
You can change the language of wallabag interface.
RSS
---
wallabag provides RSS feeds for each article status: unread, starred and archive.
Firstly, you need to create a personal token: click on ``Create your token``.
It's possible to change your token by clicking on ``Reset your token``.
Now you have three links, one for each status: add them into your favourite RSS reader.
You can also define how many articles you want in each RSS feed (default value: 50).
User information
----------------
You can change your name, your email address and enable ``Two factor authentication``.
Two factor authentication
~~~~~~~~~~~~~~~~~~~~~~~~~
Two-factor authentication (also known as 2FA) is a technology patented in 1984 that provides identification of users by means of the combination of two different components.
https://en.wikipedia.org/wiki/Two-factor_authentication
If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email. You have to put this code on the following form.
.. image:: ../../img/user/2FA_form.png
:alt: Two factor authentication
:align: center
If you don't want to receive a code each time you want to login, you can check the ``I'm on a trusted computer`` checkbox: wallabag will remember you for 15 days.
Password
--------
You can change your password here.
Tagging rules
-------------
If you want to automatically assign a tag to new articles, this part of the configuration is for you.
What does « tagging rules » mean?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
They are rules used by wallabag to automatically tag new entries.
Each time a new entry is added, all the tagging rules will be used to add the tags you configured, thus saving you the trouble to manually classify your entries.
How do I use them?
~~~~~~~~~~~~~~~~~~
Let assume you want to tag new entries as *« short reading »* when the reading time is inferior to 3 minutes.
In that case, you should put « readingTime <= 3 » in the **Rule** field and *« short reading »* in the **Tags** field.
Several tags can added simultaneously by separating them by a comma: *« short reading, must read »*.
Complex rules can be written by using predefined operators: if *« readingTime >= 5 AND domainName = "github.com" »* then tag as *« long reading, github »*.
Which variables and operators can I use to write rules?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following variables and operators can be used to create tagging rules:
=========== ============================================== ======== ==========
Variable Meaning Operator Meaning
----------- ---------------------------------------------- -------- ----------
title Title of the entry <= Less than…
url URL of the entry < Strictly less than…
isArchived Whether the entry is archived or not => Greater than…
isStared Whether the entry is starred or not > Strictly greater than…
content The entry's content = Equal to…
language The entry's language != Not equal to…
mimetype The entry's mime-type OR One rule or another
readingTime The estimated entry's reading time, in minutes AND One rule and another
domainName The domain name of the entry matches Tests that a subject is matches a search (case-insensitive). Example: title matches "football"
=========== ============================================== ======== ==========

View File

@ -0,0 +1,43 @@
Create an account
=================
On the login page, click on ``Register`` button.
.. image:: ../../img/user/registration_form.png
:alt: Registration form
:align: center
You have to fill the form. Please sure to type a valid email address, we'll send you an activation email.
.. image:: ../../img/user/sent_email.png
:alt: Email was sent to activate account
:align: center
Check your inbox, you now have a new mail with a link like this ``http://wallabag/register/confirm/Ba19wokGovN-DdBQNfg4YgRkUQWRP4-k2g0Bk-hBTX4``. Click on it to activate your account.
Your account is now activated.
.. image:: ../../img/user/activated_account.png
:alt: Welcome on board!
:align: center
Frequently asked questions
--------------------------
I can't valid the registration form
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make sure that all fields are well filled:
* valid email address
* same passwords in two fields
I don't receive my activation email
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Are you sure your email address was correct? Did you check your spams folder?
When I click on the activation link, I've got this message: ``The user with confirmation token "DtrOPfbQeVkWf6N" does not exist``.
~~~~~~~~~~~~~~~
You already enabled your account or the URL of the activation email is wrong.

View File

@ -0,0 +1,16 @@
Download articles
=================
You can download each article in several formats: ePUB, MOBI, PDF, XML, JSON, CSV.
On the article view, click on this icon, in the sidebar:
.. image:: ../../img/user/download_article.png
:alt: download article
:align: center
You can also download a full category in these formats. For example, on **Unread** view, click on this icon in the top bar:
.. image:: ../../img/user/download_articles.png
:alt: download articles
:align: center

2
docs/en/user/filters.rst Normal file
View File

@ -0,0 +1,2 @@
Filters
=======

View File

@ -0,0 +1,62 @@
Save your first article
=======================
The main purpose of wallabag is to save web articles. You have many ways to do it.
.. note::
A quickstart will be displayed in the application until you save your first article.
By using a bookmarklet
----------------------
On the ``Howto`` page, you have a ``Bookmarklet`` tab. Drag and drop the ``bag it!`` link to your bookmarks bar of your browser.
Now, each time you're reading an article on the web and you want to save it, click on the ``bag it!`` link in your bookmarks bar. The article is saved.
By using the classic form
-------------------------
In the top bar of your screen, you have 3 icons. With the first one, a plus sign, you can easily save a new article.
.. image:: ../../img/user/topbar.png
:alt: Top bar
:align: center
Click on it to display a new field, paste the article URL inside and press your ``Return`` key. The article is saved.
By using a browser add-on
-------------------------
Firefox
~~~~~~~
*This addon is not yet available for wallabag v2*.
Chrome
~~~~~~
*This addon is not yet available for wallabag v2*.
By using your smarphone application
-----------------------------------
Android
~~~~~~~
*This application is not yet available for wallabag v2*.
Firefox OS
~~~~~~~~~~
*This application is not yet available for wallabag v2*.
Windows Phone
~~~~~~~~~~~~~
*This application is not yet available for wallabag v2*.
iOS
~~~
*This application is not yet available for wallabag v2*.

64
docs/en/user/import.rst Normal file
View File

@ -0,0 +1,64 @@
Migrate to wallabag
===================
From wallabag 1.x
-----------------
Export your data from your wallabag 1.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On your config page, click on ``JSON export`` in the ``Export your wallabag data`` section.
.. image:: ../../img/user/export_wllbg_1.png
:alt: Export from wallabag 1.x
:align: center
You will have a ``wallabag-export-1-1970-01-01.json`` file.
Import your data into wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Click on ``Import`` link in the menu, select your export file on your computer and import it.
.. image:: ../../img/user/import_wllbg.png
:alt: Import from wallabag 1.x
:align: center
All your wallabag 1.x articles will be imported.
From Pocket
-----------
Create a new applicaton on Pocket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To import your data from Pocket, we use the Pocket API. You need to create a new application on their developer website to continue.
* Create a new application `on the developer website <https://getpocket.com/developer/apps/new>`_
* Fill in the required fields: application name, application description, permissions (only **retrieve**), platform (**web**), accept the terms of service and submit your new application
Pocket will give you a **Consumer Key** (for example, `49961-985e4b92fe21fe4c78d682c1`). You need to configure the ``pocket_consumer_key`` into the ``app/config/parameters.yml`` file in wallabag.
Now, all is fine to migrate from Pocket.
Import your data into wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Click on ``Import`` link in the menu, on ``Import contents`` in Pocket section and then on ``Connect to Pocket and import data``.
You need to authorize wallabag to interact with your Pocket account. Your data will be imported. Data import can be a demanding process for your server (we need to work on this import to improve it).
From Instapaper
---------------
*Feature not yet implemented in wallabag v2.*
From Readability
----------------
*Feature not yet implemented in wallabag v2.*
From HTML or JSON file
----------------------
*Feature not yet implemented in wallabag v2.*

20
docs/en/user/login.rst Normal file
View File

@ -0,0 +1,20 @@
Login
=====
Your account is now enabled, congratulations!
To login to wallabag, fill the form on login page.
If you are on your personal computer and you want to stay connected, you can check the ``Keep me logged in`` checkbox: wallabag will remember you for one year.
.. image:: ../../img/user/login_form.png
:alt: Login form
:align: center
Frequently asked questions
--------------------------
I forgot my password
~~~~~~~~~~~~~~~~~~~~
You can reset your password by clicking on ``Forgot your password?`` link, on the login page. Then, fill the form with your email address

2
docs/en/user/tags.rst Normal file
View File

@ -0,0 +1,2 @@
Tags
====

55
docs/fr/conf.py Normal file
View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
#
# wallabag documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
import sys
import os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'wallabag-fr'
copyright = u'2013-2016, Nicolas Lœuillet - MIT Licence'
version = '2.0.0'
release = version
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'default'
html_static_path = ['_static']
htmlhelp_basename = 'wallabagfrdoc'
latex_elements = {
}
latex_documents = [
('index', 'wallabag-fr.tex', u'wallabag Documentation',
u'Nicolas Lœuillet', 'manual'),
]
man_pages = [
('index', 'wallabagfr', u'wallabag Documentation',
[u'Nicolas Lœuillet'], 1)
]
texinfo_documents = [
('index', 'wallabag', u'wallabag Documentation',
u'Nicolas Lœuillet', 'wallabag', 'wallabag is an opensource read-it-later.',
'Miscellaneous'),
]
##### Guzzle sphinx theme
import guzzle_sphinx_theme
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")

17
docs/fr/index.rst Normal file
View File

@ -0,0 +1,17 @@
Documentation de wallabag
=========================
.. image:: ../img/wallabag.png
:alt: wallabag logo
:align: center
**wallabag** est une application de lecture différée : elle permet
simplement darchiver une page web en ne conservant que le contenu. Les
éléments superflus (menu, publicité, etc.) sont supprimés.
La documentation principale de cette application est découpée en plusieurs sections :
.. toctree::
:maxdepth: 2
index

2
docs/fr/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Sphinx>=1.3.0,<1.4.0
guzzle_sphinx_theme>=0.7.0,<0.8.0

BIN
docs/img/user/2FA_form.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/img/user/topbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
docs/img/wallabag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

55
docs/pt-br/conf.py Normal file
View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
#
# wallabag documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
import sys
import os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'wallabag-pt'
copyright = u'2013-2016, Nicolas Lœuillet - MIT Licence'
version = '2.0.0'
release = version
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'default'
html_static_path = ['_static']
htmlhelp_basename = 'wallabagfrdoc'
latex_elements = {
}
latex_documents = [
('index', 'wallabag-pt.tex', u'wallabag Documentation',
u'Nicolas Lœuillet', 'manual'),
]
man_pages = [
('index', 'wallabagpt', u'wallabag Documentation',
[u'Nicolas Lœuillet'], 1)
]
texinfo_documents = [
('index', 'wallabag', u'wallabag Documentation',
u'Nicolas Lœuillet', 'wallabag', 'wallabag is an opensource read-it-later.',
'Miscellaneous'),
]
##### Guzzle sphinx theme
import guzzle_sphinx_theme
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")

36
docs/pt-br/index.rst Normal file
View File

@ -0,0 +1,36 @@
wallabag documentation
======================
.. image:: ../img/wallabag.png
:alt: wallabag logo
:align: center
**wallabag** É uma aplicação "leia mais tarde": Ele salva páginas da web mantendo apenas o conteúdo. Elementos como ícones de navegação ou propaganda são deletedos.
A documentação principal desta aplicação é organizada em duas seções:
* :ref:`doc-usuario`
* :ref:`doc-desenvolvedor`
.. _user-docs:
.. toctree::
:maxdepth: 2
:caption: Documentação do usuário
user/criar_conta
user/login
user/configuração
user/primeiro_artigo
user/importar
user/baixar_artigos
user/filtros
user/tags
.. _dev-docs:
.. toctree::
:maxdepth: 2
:caption: Documentação do desenvolvedor
developer/docker

View File

@ -0,0 +1,2 @@
Sphinx>=1.3.0,<1.4.0
guzzle_sphinx_theme>=0.7.0,<0.8.0

View File

@ -1,49 +0,0 @@
<?php
/*
* Class for Flattr querying
*/
class FlattrItem {
public $status;
public $urltoflattr;
public $flattrItemURL;
public $numflattrs;
public function checkItem($urltoflattr,$id) {
$this->cacheflattrfile($urltoflattr, $id);
$flattrResponse = file_get_contents(CACHE . "/flattr/".$id.".cache");
if($flattrResponse != FALSE) {
$result = json_decode($flattrResponse);
if (isset($result->message)){
if ($result->message == "flattrable") {
$this->status = FLATTRABLE;
}
}
elseif (is_object($result) && $result->link) {
$this->status = FLATTRED;
$this->flattrItemURL = $result->link;
$this->numflattrs = $result->flattrs;
}
else {
$this->status = NOT_FLATTRABLE;
}
}
else {
$this->status = "FLATTR_ERR_CONNECTION";
}
}
private function cacheflattrfile($urltoflattr, $id) {
if (!is_dir(CACHE . '/flattr')) {
mkdir(CACHE . '/flattr', 0777);
}
// if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache
if ((!file_exists(CACHE . "/flattr/".$id.".cache")) || (time() - filemtime(CACHE . "/flattr/".$id.".cache") > 86400)) {
$askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr);
$flattrCacheFile = fopen(CACHE . "/flattr/".$id.".cache", 'w+');
fwrite($flattrCacheFile, $askForFlattr);
fclose($flattrCacheFile);
}
}
}

View File

@ -1,286 +0,0 @@
<?php
/**
* Session management class
*
* http://www.developpez.net/forums/d51943/php/langage/sessions/
* http://sebsauvage.net/wiki/doku.php?id=php:session
* http://sebsauvage.net/wiki/doku.php?id=php:shaarli
*
* Features:
* - Everything is stored on server-side (we do not trust client-side data,
* such as cookie expiration)
* - IP addresses are checked on each access to prevent session cookie hijacking
* (such as Firesheep)
* - Session expires on user inactivity (Session expiration date is
* automatically updated everytime the user accesses a page.)
* - A unique secret key is generated on server-side for this session
* (and never sent over the wire) which can be used to sign forms (HMAC)
* (See $_SESSION['uid'])
* - Token management to prevent XSRF attacks
* - Brute force protection with ban management
*
* TODOs
* - Replace globals with variables in Session class
*
* How to use:
* - http://tontof.net/kriss/php5/session
*/
class Session
{
// Personnalize PHP session name
public static $sessionName = '';
// If the user does not access any page within this time,
// his/her session is considered expired (3600 sec. = 1 hour)
public static $inactivityTimeout = 86400;
// Extra timeout for long sessions (if enabled) (82800 sec. = 23 hours)
public static $longSessionTimeout = 31536000;
// If you get disconnected often or if your IP address changes often.
// Let you disable session cookie hijacking protection
public static $disableSessionProtection = false;
// Ban IP after this many failures.
public static $banAfter = 4;
// Ban duration for IP address after login failures (in seconds).
// (1800 sec. = 30 minutes)
public static $banDuration = 1800;
// File storage for failures and bans. If empty, no ban management.
public static $banFile = '';
/**
* Initialize session
*/
public static function init()
{
// Force cookie path (but do not change lifetime)
$cookie = session_get_cookie_params();
// Default cookie expiration and path.
$cookiedir = '';
if (dirname($_SERVER['SCRIPT_NAME'])!='/') {
$cookiedir = dirname($_SERVER["SCRIPT_NAME"]).'/';
}
$ssl = false;
if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$ssl = true;
}
session_set_cookie_params($cookie['lifetime'], $cookiedir, $_SERVER['HTTP_HOST'], $ssl);
// Use cookies to store session.
ini_set('session.use_cookies', 1);
// Force cookies for session (phpsessionID forbidden in URL)
ini_set('session.use_only_cookies', 1);
if (!session_id()) {
// Prevent php to use sessionID in URL if cookies are disabled.
ini_set('session.use_trans_sid', false);
if (!empty(self::$sessionName)) {
session_name(self::$sessionName);
}
session_start();
}
}
/**
* Returns the IP address
* (Used to prevent session cookie hijacking.)
*
* @return string IP addresses
*/
private static function _allIPs()
{
$ip = $_SERVER["REMOTE_ADDR"];
$ip.= isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? '_'.$_SERVER['HTTP_X_FORWARDED_FOR'] : '';
$ip.= isset($_SERVER['HTTP_CLIENT_IP']) ? '_'.$_SERVER['HTTP_CLIENT_IP'] : '';
return $ip;
}
/**
* Check that user/password is correct and then init some SESSION variables.
*
* @param string $login Login reference
* @param string $password Password reference
* @param string $loginTest Login to compare with login reference
* @param string $passwordTest Password to compare with password reference
* @param array $pValues Array of variables to store in SESSION
*
* @return true|false True if login and password are correct, false
* otherwise
*/
public static function login (
$login,
$password,
$loginTest,
$passwordTest,
$longlastingsession,
$pValues = array())
{
self::banInit();
if (self::banCanLogin()) {
if ($login === $loginTest && $password === $passwordTest) {
self::banLoginOk();
// Generate unique random number to sign forms (HMAC)
$_SESSION['uid'] = sha1(uniqid('', true).'_'.mt_rand());
$_SESSION['ip'] = self::_allIPs();
$_SESSION['username'] = $login;
// Set session expiration.
$_SESSION['expires_on'] = time() + self::$inactivityTimeout;
if ($longlastingsession) {
$_SESSION['longlastingsession'] = self::$longSessionTimeout;
$_SESSION['expires_on'] += $_SESSION['longlastingsession'];
}
foreach ($pValues as $key => $value) {
$_SESSION[$key] = $value;
}
return true;
}
self::banLoginFailed();
}
return false;
}
/**
* Unset SESSION variable to force logout
*/
public static function logout()
{
unset($_SESSION['uid'],$_SESSION['ip'],$_SESSION['expires_on'],$_SESSION['tokens'], $_SESSION['login'], $_SESSION['pass'], $_SESSION['longlastingsession'], $_SESSION['poche_user']);
}
/**
* Make sure user is logged in.
*
* @return true|false True if user is logged in, false otherwise
*/
public static function isLogged()
{
if (!isset ($_SESSION['uid'])
|| (self::$disableSessionProtection === false
&& $_SESSION['ip'] !== self::_allIPs())
|| time() >= $_SESSION['expires_on']) {
self::logout();
return false;
}
// User accessed a page : Update his/her session expiration date.
$_SESSION['expires_on'] = time() + self::$inactivityTimeout;
if (!empty($_SESSION['longlastingsession'])) {
$_SESSION['expires_on'] += $_SESSION['longlastingsession'];
}
return true;
}
/**
* Create a token, store it in SESSION and return it
*
* @param string $salt to prevent birthday attack
*
* @return string Token created
*/
public static function getToken($salt = '')
{
if (!isset($_SESSION['tokens'])) {
$_SESSION['tokens']=array();
}
// We generate a random string and store it on the server side.
$rnd = sha1(uniqid('', true).'_'.mt_rand().$salt);
$_SESSION['tokens'][$rnd]=1;
return $rnd;
}
/**
* Tells if a token is ok. Using this function will destroy the token.
*
* @param string $token Token to test
*
* @return true|false True if token is correct, false otherwise
*/
public static function isToken($token)
{
if (isset($_SESSION['tokens'][$token])) {
unset($_SESSION['tokens'][$token]); // Token is used: destroy it.
return true; // Token is ok.
}
return false; // Wrong token, or already used.
}
/**
* Signal a failed login. Will ban the IP if too many failures:
*/
public static function banLoginFailed()
{
if (self::$banFile !== '') {
$ip = $_SERVER["REMOTE_ADDR"];
$gb = $GLOBALS['IPBANS'];
if (!isset($gb['FAILURES'][$ip])) {
$gb['FAILURES'][$ip] = 0;
}
$gb['FAILURES'][$ip]++;
if ($gb['FAILURES'][$ip] > (self::$banAfter - 1)) {
$gb['BANS'][$ip]= time() + self::$banDuration;
}
$GLOBALS['IPBANS'] = $gb;
file_put_contents(self::$banFile, "<?php\n\$GLOBALS['IPBANS']=".var_export($gb, true).";\n?>");
}
}
/**
* Signals a successful login. Resets failed login counter.
*/
public static function banLoginOk()
{
if (self::$banFile !== '') {
$ip = $_SERVER["REMOTE_ADDR"];
$gb = $GLOBALS['IPBANS'];
unset($gb['FAILURES'][$ip]); unset($gb['BANS'][$ip]);
$GLOBALS['IPBANS'] = $gb;
file_put_contents(self::$banFile, "<?php\n\$GLOBALS['IPBANS']=".var_export($gb, true).";\n?>");
}
}
/**
* Ban init
*/
public static function banInit()
{
if (self::$banFile !== '') {
if (!is_file(self::$banFile)) {
file_put_contents(self::$banFile, "<?php\n\$GLOBALS['IPBANS']=".var_export(array('FAILURES'=>array(), 'BANS'=>array()), true).";\n?>");
}
include self::$banFile;
}
}
/**
* Checks if the user CAN login. If 'true', the user can try to login.
*
* @return boolean true if user is banned, false otherwise
*/
public static function banCanLogin()
{
if (self::$banFile !== '') {
$ip = $_SERVER["REMOTE_ADDR"];
$gb = $GLOBALS['IPBANS'];
if (isset($gb['BANS'][$ip])) {
// User is banned. Check if the ban has expired:
if ($gb['BANS'][$ip] <= time()) {
// Ban expired, user can try to login again.
unset($gb['FAILURES'][$ip]);
unset($gb['BANS'][$ip]);
file_put_contents(self::$banFile, "<?php\n\$GLOBALS['IPBANS']=".var_export($gb, true).";\n?>");
return true; // Ban has expired, user can login.
}
return false; // User is banned.
}
}
return true; // User is not banned.
}
}

View File

@ -1,231 +0,0 @@
<?php
//--------------------------------------------------------------------------------------------------
// Session-Based Flash Messages v1.0
// Copyright 2012 Mike Everhart (http://mikeeverhart.net)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//------------------------------------------------------------------------------
// Description:
//------------------------------------------------------------------------------
//
// Stores messages in Session data to be easily retrieved later on.
// This class includes four different types of messages:
// - Success
// - Error
// - Warning
// - Information
//
// See README for basic usage instructions, or see samples/index.php for more advanced samples
//
//--------------------------------------------------------------------------------------------------
// Changelog
//--------------------------------------------------------------------------------------------------
//
// 2011-05-15 - v1.0 - Initial Version
//
//--------------------------------------------------------------------------------------------------
class Messages {
//-----------------------------------------------------------------------------------------------
// Class Variables
//-----------------------------------------------------------------------------------------------
var $msgId;
var $msgTypes = array( 'help', 'info', 'warning', 'success', 'error' );
var $msgClass = 'messages';
var $msgWrapper = "<div class='%s %s'><a href='#' class='closeMessage'>X</a>\n%s</div>\n";
var $msgBefore = '<p>';
var $msgAfter = "</p>\n";
/**
* Constructor
* @author Mike Everhart
*/
public function __construct() {
// Generate a unique ID for this user and session
$this->msgId = md5(uniqid());
// Create the session array if it doesnt already exist
if( !array_key_exists('flash_messages', $_SESSION) ) $_SESSION['flash_messages'] = array();
}
/**
* Add a message to the queue
*
* @author Mike Everhart
*
* @param string $type The type of message to add
* @param string $message The message
* @param string $redirect_to (optional) If set, the user will be redirected to this URL
* @return bool
*
*/
public function add($type, $message, $redirect_to=null) {
if( !isset($_SESSION['flash_messages']) ) return false;
if( !isset($type) || !isset($message[0]) ) return false;
// Replace any shorthand codes with their full version
if( strlen(trim($type)) == 1 ) {
$type = str_replace( array('h', 'i', 'w', 'e', 's'), array('help', 'info', 'warning', 'error', 'success'), $type );
// Backwards compatibility...
} elseif( $type == 'information' ) {
$type = 'info';
}
// Make sure it's a valid message type
if( !in_array($type, $this->msgTypes) ) die('"' . strip_tags($type) . '" is not a valid message type!' );
// If the session array doesn't exist, create it
if( !array_key_exists( $type, $_SESSION['flash_messages'] ) ) $_SESSION['flash_messages'][$type] = array();
$_SESSION['flash_messages'][$type][] = $message;
if( !is_null($redirect_to) ) {
header("Location: $redirect_to");
exit();
}
return true;
}
//-----------------------------------------------------------------------------------------------
// display()
// print queued messages to the screen
//-----------------------------------------------------------------------------------------------
/**
* Display the queued messages
*
* @author Mike Everhart
*
* @param string $type Which messages to display
* @param bool $print True = print the messages on the screen
* @return mixed
*
*/
public function display($type='all', $print=true) {
$messages = '';
$data = '';
if( !isset($_SESSION['flash_messages']) ) return false;
if( $type == 'g' || $type == 'growl' ) {
$this->displayGrowlMessages();
return true;
}
// Print a certain type of message?
if( in_array($type, $this->msgTypes) ) {
foreach( $_SESSION['flash_messages'][$type] as $msg ) {
$messages .= $this->msgBefore . $msg . $this->msgAfter;
}
$data .= sprintf($this->msgWrapper, $this->msgClass, $type, $messages);
// Clear the viewed messages
$this->clear($type);
// Print ALL queued messages
} elseif( $type == 'all' ) {
foreach( $_SESSION['flash_messages'] as $type => $msgArray ) {
$messages = '';
foreach( $msgArray as $msg ) {
$messages .= $this->msgBefore . $msg . $this->msgAfter;
}
$data .= sprintf($this->msgWrapper, $this->msgClass, $type, $messages);
}
// Clear ALL of the messages
$this->clear();
// Invalid Message Type?
} else {
return false;
}
// Print everything to the screen or return the data
if( $print ) {
echo $data;
} else {
return $data;
}
}
/**
* Check to see if there are any queued error messages
*
* @author Mike Everhart
*
* @return bool true = There ARE error messages
* false = There are NOT any error messages
*
*/
public function hasErrors() {
return empty($_SESSION['flash_messages']['error']) ? false : true;
}
/**
* Check to see if there are any ($type) messages queued
*
* @author Mike Everhart
*
* @param string $type The type of messages to check for
* @return bool
*
*/
public function hasMessages($type=null) {
if( !is_null($type) ) {
if( !empty($_SESSION['flash_messages'][$type]) ) return $_SESSION['flash_messages'][$type];
} else {
foreach( $this->msgTypes as $type ) {
if( !empty($_SESSION['flash_messages']) ) return true;
}
}
return false;
}
/**
* Clear messages from the session data
*
* @author Mike Everhart
*
* @param string $type The type of messages to clear
* @return bool
*
*/
public function clear($type='all') {
if( $type == 'all' ) {
unset($_SESSION['flash_messages']);
} else {
unset($_SESSION['flash_messages'][$type]);
}
return true;
}
public function __toString() { return $this->hasMessages(); }
public function __destruct() {
//$this->clear();
}
} // end class
?>

View File

@ -1,405 +0,0 @@
<?php
/* Full-Text RSS config */
// ......IMPORTANT......................................
// .....................................................
// Please do not change this file (config.php) directly.
// Save a copy as custom_config.php and make your
// changes to that instead. It will automatically
// override anything in config.php. Because config.php
// always gets loaded anyway, you can simply specify
// options you'd like to override in custom_config.php.
// .....................................................
// Create config object
if (!isset($options)) $options = new stdClass();
// Enable service
// ----------------------
// Set this to false if you want to disable the service.
// If set to false, no feed is produced and users will
// be told that the service is disabled.
$options->enabled = true;
// Debug mode
// ----------------------
// Enable or disable debugging. When enabled debugging works by passing
// &debug to the makefulltextfeed.php querystring.
// Valid values:
// true or 'user' (default) - let user decide
// 'admin' - debug works only for logged in admin users
// false - disabled
$options->debug = true;
// Default entries (without access key)
// ----------------------
// The number of feed items to process when no API key is supplied
// and no &max=x value is supplied in the querystring.
$options->default_entries = 5;
// Max entries (without access key)
// ----------------------
// The maximum number of feed items to process when no access key is supplied.
// This limits the user-supplied &max=x value. For example, if the user
// asks for 20 items to be processed (&max=20), if max_entries is set to
// 10, only 10 will be processed.
$options->max_entries = 10;
// Rewrite relative URLs
// ----------------------
// With this enabled relative URLs found in the extracted content
// block are automatically rewritten as absolute URLs.
$options->rewrite_relative_urls = true;
// Exclude items if extraction fails
// ---------------------------------
// Excludes items from the resulting feed
// if we cannot extract any content from the
// item URL.
// Possible values...
// Enable: true
// Disable: false (default)
// User decides: 'user' (this option will appear on the form)
$options->exclude_items_on_fail = 'user';
// Enable multi-page support
// -------------------------
// If enabled, we will try to follow next page links on multi-page articles.
// Currently this only happens for sites where next_page_link has been defined
// in a site config file.
$options->multipage = true;
// Enable caching
// ----------------------
// Enable this if you'd like to cache results
// for 10 minutes. Cache files are written to disk (in cache/ subfolders
// - which must be writable).
// Initially it's best to keep this disabled to make sure everything works
// as expected. If you have APC enabled, please also see smart_cache in the
// advanced section.
$options->caching = false;
// Cache directory
// ----------------------
// Only used if caching is true
$options->cache_dir = dirname(__FILE__).'/cache';
// Message to prepend (without access key)
// ----------------------
// HTML to insert at the beginning of each feed item when no access key is supplied.
// Substitution tags:
// {url} - Feed item URL
// {effective-url} - Feed item URL after we've followed all redirects
$options->message_to_prepend = '';
// Message to append (without access key)
// ----------------------
// HTML to insert at the end of each feed item when no access key is supplied.
// Substitution tags:
// {url} - Feed item URL
// {effective-url} - Feed item URL after we've followed all redirects
$options->message_to_append = '';
// Error message when content extraction fails (without access key)
// ----------------------
$options->error_message = '[unable to retrieve full-text content]';
// Keep enclosure in feed items
// If enabled, we will try to preserve enclosures if present.
// ----------------------
$options->keep_enclosures = true;
// Detect language
// ---------------
// Should we try and find/guess the language of the article being processed?
// Values will be placed inside the <dc:language> element inside each <item> element
// Possible values:
// * Ignore language: 0
// * Use article/feed metadata (e.g. HTML lang attribute): 1 (default)
// * As above, but guess if not present: 2
// * Always guess: 3
// * User decides: 'user' (value of 0-3 can be passed in querystring: e.g. &l=2)
$options->detect_language = 1;
// Registration key
// ---------------
// The registration key is optional. It is not required to use Full-Text RSS,
// and does not affect the normal operation of Full-Text RSS. It is currently
// only used on admin pages which help you update site patterns with the
// latest version offered by FiveFilters.org. For these admin-related
// tasks to complete, we will require a valid registration key.
// If you would like one, you can purchase the latest version of Full-Text RSS
// at http://fivefilters.org/content-only/
// Your registration key will automatically be sent in the confirmation email.
// Once you have it, simply copy and paste it here.
$options->registration_key = '';
/////////////////////////////////////////////////
/// RESTRICT ACCESS /////////////////////////////
/////////////////////////////////////////////////
// Admin credentials
// ----------------------
// Certain pages/actions, e.g. updating site patterns with our online tool, will require admin credentials.
// To use these pages, enter a password here and you'll be prompted for it when you try to access those pages.
// If no password or username is set, pages requiring admin privelages will be inaccessible.
// The default username is 'admin'.
// If overriding with an environment variable, separate username and password with a colon, e.g.:
// ftr_admin_credentials: admin:my-secret-password
// Example: $options->admin_credentials = array('username'=>'admin', 'password'=>'my-secret-password');
$options->admin_credentials = array('username'=>'admin', 'password'=>'admin');
// URLs to allow
// ----------------------
// List of URLs (or parts of a URL) which the service will accept.
// If the list is empty, all URLs (except those specified in the blocked list below)
// will be permitted.
// Empty: array();
// Non-empty example: array('example.com', 'anothersite.org');
$options->allowed_urls = array();
// URLs to block
// ----------------------
// List of URLs (or parts of a URL) which the service will not accept.
// Note: this list is ignored if allowed_urls is not empty
$options->blocked_urls = array();
// Key holder(s) only?
// ----------------------
// Set this to true if you want to restrict access only to
// those with a key (see below to specify key(s)).
// If set to true, no feed is produced unless a valid
// key is provided.
$options->key_required = false;
// Favour item titles in feed
// ----------------------
// By default, when processing feeds, we assume item titles in the feed
// have not been truncated. So after processing web pages, the extracted titles
// are not used in the generated feed. If you prefer to have extracted titles in
// the feed you can either set this to false, in which case we will always favour
// extracted titles. Alternatively, if set to 'user' (default) we'll use the
// extracted title if you pass '&use_extracted_title' in the querystring.
// Possible values:
// * Favour feed titles: true
// * Favour extracted titles: false
// * Favour feed titles with user override: 'user' (default)
// Note: this has no effect when the input URL is to a web page - in these cases
// we always use the extracted title in the generated feed.
$options->favour_feed_titles = 'user';
// Access keys (password protected access)
// ------------------------------------
// NOTE: You do not need an API key from fivefilters.org to run your own
// copy of the code. This is here if you'd like to restrict access to
// _your_ copy.
// Keys let you group users - those with a key and those without - and
// restrict access to the service to those without a key.
// If you want everyone to access the service in the same way, you can
// leave the array below empty and ignore the access key options further down.
// The options further down let you control how the service should behave
// in each mode.
// Note: Explicitly including the index number (1 and 2 in the examples below)
// is highly recommended (when generating feeds, we encode the key and
// refer to it by index number and hash).
$options->api_keys = array();
// Example:
// $options->api_keys[1] = 'secret-key-1';
// $options->api_keys[2] = 'secret-key-2';
// Default entries (with access key)
// ----------------------
// The number of feed items to process when a valid access key is supplied.
$options->default_entries_with_key = 5;
// Max entries (with access key)
// ----------------------
// The maximum number of feed items to process when a valid access key is supplied.
$options->max_entries_with_key = 10;
/////////////////////////////////////////////////
/// ADVANCED OPTIONS ////////////////////////////
/////////////////////////////////////////////////
// Enable XSS filter?
// ----------------------
// We have not enabled this by default because we assume the majority of
// our users do not display the HTML retrieved by Full-Text RSS
// in a web page without further processing. If you subscribe to our generated
// feeds in your news reader application, it should, if it's good software, already
// filter the resulting HTML for XSS attacks, making it redundant for
// Full-Text RSS do the same. Similarly with frameworks/CMS which display
// feed content - the content should be treated like any other user-submitted content.
//
// If you are writing an application yourself which is processing feeds generated by
// Full-Text RSS, you can either filter the HTML yourself to remove potential XSS attacks
// or enable this option. This might be useful if you are processing our generated
// feeds with JavaScript on the client side - although there's client side xss
// filtering available too, e.g. https://code.google.com/p/google-caja/wiki/JsHtmlSanitizer
//
// If enabled, we'll pass retrieved HTML content through htmLawed with
// safe flag on and style attributes denied, see
// http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/htmLawed_README.htm#s3.6
// Note: if enabled this will also remove certain elements you may want to preserve, such as iframes.
//
// Valid values:
// true - enabled, all content will be filtered
// 'user' (default) - user must pass &xss in makefulltextfeed.php querystring to enable
// false - disabled
$options->xss_filter = 'user';
// Allowed parsers
// ----------------------
// Full-Text RSS attempts to use PHP's libxml extension to process HTML.
// While fast, on some sites it may not always produce good results.
// For these sites, you can specify an alternative HTML parser:
// parser: html5lib
// The html5lib parser is bundled with Full-Text RSS.
// see http://code.google.com/p/html5lib/
//
// To disable HTML parsing with html5lib, you can remove it from this list.
// By default we allow both: libxml and html5lib.
$options->allowed_parsers = array('libxml', 'html5lib');
//$options->allowed_parsers = array('libxml'); //disable html5lib - forcing libxml in all cases
// Enable Cross-Origin Resource Sharing (CORS)
// ----------------------
// If enabled we'll send the following HTTP header
// Access-Control-Allow-Origin: *
// see http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
$options->cors = false;
// Use APC user cache?
// ----------------------
// If enabled we will store site config files (when requested
// for the first time) in APC's user cache. Keys prefixed with 'sc.'
// This improves performance by reducing disk access.
// Note: this has no effect if APC is unavailable on your server.
$options->apc = true;
// Smart cache (experimental)
// ----------------------
// With this option enabled we will not cache to disk immediately.
// We will store the cache key in APC and if it's requested again
// we will cache results to disk. Keys prefixed with 'cache.'
// This improves performance by reducing disk access.
// Note: this has no effect if APC is disabled or unavailable on your server,
// or if you have caching disabled.
$options->smart_cache = true;
// Fingerprints
// ----------------------
// key is fingerprint (fragment to find in HTML)
// value is host name to use for site config lookup if fingerprint matches
$options->fingerprints = array(
// Posterous
'<meta name="generator" content="Posterous"' => array('hostname'=>'fingerprint.posterous.com', 'head'=>true),
// Blogger
'<meta content=\'blogger\' name=\'generator\'' => array('hostname'=>'fingerprint.blogspot.com', 'head'=>true),
'<meta name="generator" content="Blogger"' => array('hostname'=>'fingerprint.blogspot.com', 'head'=>true),
// WordPress (hosted)
// '<meta name="generator" content="WordPress.com"' => array('hostname'=>'fingerprint.wordpress.com', 'head'=>true),
// WordPress (self-hosted and hosted)
'<meta name="generator" content="WordPress' => array('hostname'=>'fingerprint.wordpress.com', 'head'=>true)
);
// User Agent strings - mapping domain names
// ----------------------
// e.g. $options->user_agents = array('example.org' => 'PHP/5.2');
$options->user_agents = array( 'lifehacker.com' => 'PHP/5.2',
'gawker.com' => 'PHP/5.2',
'deadspin.com' => 'PHP/5.2',
'kotaku.com' => 'PHP/5.2',
'jezebel.com' => 'PHP/5.2',
'io9.com' => 'PHP/5.2',
'jalopnik.com' => 'PHP/5.2',
'gizmodo.com' => 'PHP/5.2',
'.wikipedia.org' => 'Mozilla/5.2',
'.fok.nl' => 'Googlebot/2.1',
'getpocket.com' => 'PHP/5.2'
);
// URL Rewriting
// ----------------------
// Currently allows simple string replace of URLs.
// Useful for rewriting certain URLs to point to a single page
// or HTML view. Although using the single_page_link site config
// instruction is the preferred way to do this, sometimes, as
// with Google Docs URLs, it's not possible.
// Note: this might move to the site config file at some point.
$options->rewrite_url = array(
// Rewrite public Google Docs URLs to point to HTML view:
// if a URL contains docs.google.com, replace /Doc? with /View?
'docs.google.com' => array('/Doc?' => '/View?'),
'tnr.com' => array('tnr.com/article/' => 'tnr.com/print/article/'),
'.m.wikipedia.org' => array('.m.wikipedia.org' => '.wikipedia.org'),
'm.vanityfair.com' => array('m.vanityfair.com' => 'www.vanityfair.com')
);
// Content-Type exceptions
// -----------------------
// Here you can define different actions based
// on the Content-Type header returned by server.
// MIME type as key, action as value.
// Valid actions:
// * 'exclude' - exclude this item from the result
// * 'link' - create HTML link to the item
$options->content_type_exc = array(
'application/pdf' => array('action'=>'link', 'name'=>'PDF'),
'image' => array('action'=>'link', 'name'=>'Image'),
'audio' => array('action'=>'link', 'name'=>'Audio'),
'video' => array('action'=>'link', 'name'=>'Video')
);
// Cache directory level
// ----------------------
// Spread cache files over different directories (only used if caching is enabled).
// Used to prevent large number of files in one directory.
// This corresponds to Zend_Cache's hashed_directory_level
// see http://framework.zend.com/manual/en/zend.cache.backends.html
// It's best not to change this if you're unsure.
$options->cache_directory_level = 0;
// Cache cleanup
// -------------
// 0 = script will not clean cache (rename cachecleanup.php and use it for scheduled (e.g. cron) cache cleanup)
// 1 = clean cache everytime the script runs (not recommended)
// 100 = clean cache roughly once every 100 script runs
// x = clean cache roughly once every x script runs
// ...you get the idea :)
$options->cache_cleanup = 100;
/////////////////////////////////////////////////
/// DO NOT CHANGE ANYTHING BELOW THIS ///////////
/////////////////////////////////////////////////
if (!defined('_FF_FTR_VERSION')) define('_FF_FTR_VERSION', '3.1');
if (basename(__FILE__) == 'config.php') {
if (file_exists(dirname(__FILE__).'/custom_config.php')) {
require_once dirname(__FILE__).'/custom_config.php';
}
// check for environment variables - often used on cloud platforms
// environment variables should be prefixed with 'ftr_', e.g.
// ftr_max_entries: 1
// will set the max_entries value to 1.
foreach ($options as $_key=>&$_val) {
$_key = "ftr_$_key";
if (($_env = getenv($_key)) !== false) {
if (is_array($_val)) {
if ($_key === 'ftr_admin_credentials') {
$_val = array_combine(array('username', 'password'), array_map('trim', explode(':', $_env, 2)));
if ($_val === false) $_val = array('username'=>'admin', 'password'=>'');
}
} elseif ($_env === 'true' || $_env === 'false') {
$_val = ($_env === 'true');
} elseif (is_numeric($_env)) {
$_val = (int)$_env;
} else { // string
$_val = $_env;
}
}
}
unset($_key, $_val, $_env);
}

View File

@ -1,250 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Cache.php 24656 2012-02-26 06:02:53Z adamlundrigan $
*/
/**
* @package Zend_Cache
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Cache
{
/**
* Standard frontends
*
* @var array
*/
public static $standardFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page');
/**
* Standard backends
*
* @var array
*/
public static $standardBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform',
'Xcache', 'TwoLevels', 'WinCache', 'ZendServer_Disk', 'ZendServer_ShMem');
/**
* Standard backends which implement the ExtendedInterface
*
* @var array
*/
public static $standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Libmemcached', 'Sqlite', 'WinCache');
/**
* Only for backward compatibility (may be removed in next major release)
*
* @var array
* @deprecated
*/
public static $availableFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page');
/**
* Only for backward compatibility (may be removed in next major release)
*
* @var array
* @deprecated
*/
public static $availableBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', 'Xcache', 'WinCache', 'TwoLevels');
/**
* Consts for clean() method
*/
const CLEANING_MODE_ALL = 'all';
const CLEANING_MODE_OLD = 'old';
const CLEANING_MODE_MATCHING_TAG = 'matchingTag';
const CLEANING_MODE_NOT_MATCHING_TAG = 'notMatchingTag';
const CLEANING_MODE_MATCHING_ANY_TAG = 'matchingAnyTag';
/**
* Factory
*
* @param mixed $frontend frontend name (string) or Zend_Cache_Frontend_ object
* @param mixed $backend backend name (string) or Zend_Cache_Backend_ object
* @param array $frontendOptions associative array of options for the corresponding frontend constructor
* @param array $backendOptions associative array of options for the corresponding backend constructor
* @param boolean $customFrontendNaming if true, the frontend argument is used as a complete class name ; if false, the frontend argument is used as the end of "Zend_Cache_Frontend_[...]" class name
* @param boolean $customBackendNaming if true, the backend argument is used as a complete class name ; if false, the backend argument is used as the end of "Zend_Cache_Backend_[...]" class name
* @param boolean $autoload if true, there will no require_once for backend and frontend (useful only for custom backends/frontends)
* @throws Zend_Cache_Exception
* @return Zend_Cache_Core|Zend_Cache_Frontend
*/
public static function factory($frontend, $backend, $frontendOptions = array(), $backendOptions = array(), $customFrontendNaming = false, $customBackendNaming = false, $autoload = false)
{
if (is_string($backend)) {
$backendObject = self::_makeBackend($backend, $backendOptions, $customBackendNaming, $autoload);
} else {
if ((is_object($backend)) && (in_array('Zend_Cache_Backend_Interface', class_implements($backend)))) {
$backendObject = $backend;
} else {
self::throwException('backend must be a backend name (string) or an object which implements Zend_Cache_Backend_Interface');
}
}
if (is_string($frontend)) {
$frontendObject = self::_makeFrontend($frontend, $frontendOptions, $customFrontendNaming, $autoload);
} else {
if (is_object($frontend)) {
$frontendObject = $frontend;
} else {
self::throwException('frontend must be a frontend name (string) or an object');
}
}
$frontendObject->setBackend($backendObject);
return $frontendObject;
}
/**
* Backend Constructor
*
* @param string $backend
* @param array $backendOptions
* @param boolean $customBackendNaming
* @param boolean $autoload
* @return Zend_Cache_Backend
*/
public static function _makeBackend($backend, $backendOptions, $customBackendNaming = false, $autoload = false)
{
if (!$customBackendNaming) {
$backend = self::_normalizeName($backend);
}
if (in_array($backend, Zend_Cache::$standardBackends)) {
// we use a standard backend
$backendClass = 'Zend_Cache_Backend_' . $backend;
// security controls are explicit
require_once realpath(dirname(__FILE__).'/..').DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php';
} else {
// we use a custom backend
if (!preg_match('~^[\w\\\\]+$~D', $backend)) {
Zend_Cache::throwException("Invalid backend name [$backend]");
}
if (!$customBackendNaming) {
// we use this boolean to avoid an API break
$backendClass = 'Zend_Cache_Backend_' . $backend;
} else {
$backendClass = $backend;
}
if (!$autoload) {
$file = str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php';
if (!(self::_isReadable($file))) {
self::throwException("file $file not found in include_path");
}
require_once $file;
}
}
return new $backendClass($backendOptions);
}
/**
* Frontend Constructor
*
* @param string $frontend
* @param array $frontendOptions
* @param boolean $customFrontendNaming
* @param boolean $autoload
* @return Zend_Cache_Core|Zend_Cache_Frontend
*/
public static function _makeFrontend($frontend, $frontendOptions = array(), $customFrontendNaming = false, $autoload = false)
{
if (!$customFrontendNaming) {
$frontend = self::_normalizeName($frontend);
}
if (in_array($frontend, self::$standardFrontends)) {
// we use a standard frontend
// For perfs reasons, with frontend == 'Core', we can interact with the Core itself
$frontendClass = 'Zend_Cache_' . ($frontend != 'Core' ? 'Frontend_' : '') . $frontend;
// security controls are explicit
require_once realpath(dirname(__FILE__).'/..').DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php';
} else {
// we use a custom frontend
if (!preg_match('~^[\w\\\\]+$~D', $frontend)) {
Zend_Cache::throwException("Invalid frontend name [$frontend]");
}
if (!$customFrontendNaming) {
// we use this boolean to avoid an API break
$frontendClass = 'Zend_Cache_Frontend_' . $frontend;
} else {
$frontendClass = $frontend;
}
if (!$autoload) {
$file = str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php';
if (!(self::_isReadable($file))) {
self::throwException("file $file not found in include_path");
}
require_once $file;
}
}
return new $frontendClass($frontendOptions);
}
/**
* Throw an exception
*
* Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
* @param string $msg Message for the exception
* @throws Zend_Cache_Exception
*/
public static function throwException($msg, Exception $e = null)
{
// For perfs reasons, we use this dynamic inclusion
require_once 'Zend/Cache/Exception.php';
throw new Zend_Cache_Exception($msg, 0, $e);
}
/**
* Normalize frontend and backend names to allow multiple words TitleCased
*
* @param string $name Name to normalize
* @return string
*/
protected static function _normalizeName($name)
{
$name = ucfirst(strtolower($name));
$name = str_replace(array('-', '_', '.'), ' ', $name);
$name = ucwords($name);
$name = str_replace(' ', '', $name);
if (stripos($name, 'ZendServer') === 0) {
$name = 'ZendServer_' . substr($name, strlen('ZendServer'));
}
return $name;
}
/**
* Returns TRUE if the $filename is readable, or FALSE otherwise.
* This function uses the PHP include_path, where PHP's is_readable()
* does not.
*
* Note : this method comes from Zend_Loader (see #ZF-2891 for details)
*
* @param string $filename
* @return boolean
*/
private static function _isReadable($filename)
{
if (!$fh = @fopen($filename, 'r', true)) {
return false;
}
@fclose($fh);
return true;
}
}

View File

@ -1,290 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Backend.php 24989 2012-06-21 07:24:13Z mabe $
*/
/**
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Cache_Backend
{
/**
* Frontend or Core directives
*
* =====> (int) lifetime :
* - Cache lifetime (in seconds)
* - If null, the cache is valid forever
*
* =====> (int) logging :
* - if set to true, a logging is activated throw Zend_Log
*
* @var array directives
*/
protected $_directives = array(
'lifetime' => 3600,
'logging' => false,
'logger' => null
);
/**
* Available options
*
* @var array available options
*/
protected $_options = array();
/**
* Constructor
*
* @param array $options Associative array of options
* @throws Zend_Cache_Exception
* @return void
*/
public function __construct(array $options = array())
{
while (list($name, $value) = each($options)) {
$this->setOption($name, $value);
}
}
/**
* Set the frontend directives
*
* @param array $directives Assoc of directives
* @throws Zend_Cache_Exception
* @return void
*/
public function setDirectives($directives)
{
if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
while (list($name, $value) = each($directives)) {
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
$name = strtolower($name);
if (array_key_exists($name, $this->_directives)) {
$this->_directives[$name] = $value;
}
}
$this->_loggerSanity();
}
/**
* Set an option
*
* @param string $name
* @param mixed $value
* @throws Zend_Cache_Exception
* @return void
*/
public function setOption($name, $value)
{
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
$name = strtolower($name);
if (array_key_exists($name, $this->_options)) {
$this->_options[$name] = $value;
}
}
/**
* Returns an option
*
* @param string $name Optional, the options name to return
* @throws Zend_Cache_Exceptions
* @return mixed
*/
public function getOption($name)
{
$name = strtolower($name);
if (array_key_exists($name, $this->_options)) {
return $this->_options[$name];
}
if (array_key_exists($name, $this->_directives)) {
return $this->_directives[$name];
}
Zend_Cache::throwException("Incorrect option name : {$name}");
}
/**
* Get the life time
*
* if $specificLifetime is not false, the given specific life time is used
* else, the global lifetime is used
*
* @param int $specificLifetime
* @return int Cache life time
*/
public function getLifetime($specificLifetime)
{
if ($specificLifetime === false) {
return $this->_directives['lifetime'];
}
return $specificLifetime;
}
/**
* Return true if the automatic cleaning is available for the backend
*
* DEPRECATED : use getCapabilities() instead
*
* @deprecated
* @return boolean
*/
public function isAutomaticCleaningAvailable()
{
return true;
}
/**
* Determine system TMP directory and detect if we have read access
*
* inspired from Zend_File_Transfer_Adapter_Abstract
*
* @return string
* @throws Zend_Cache_Exception if unable to determine directory
*/
public function getTmpDir()
{
$tmpdir = array();
foreach (array($_ENV, $_SERVER) as $tab) {
foreach (array('TMPDIR', 'TEMP', 'TMP', 'windir', 'SystemRoot') as $key) {
if (isset($tab[$key]) && is_string($tab[$key])) {
if (($key == 'windir') or ($key == 'SystemRoot')) {
$dir = realpath($tab[$key] . '\\temp');
} else {
$dir = realpath($tab[$key]);
}
if ($this->_isGoodTmpDir($dir)) {
return $dir;
}
}
}
}
$upload = ini_get('upload_tmp_dir');
if ($upload) {
$dir = realpath($upload);
if ($this->_isGoodTmpDir($dir)) {
return $dir;
}
}
if (function_exists('sys_get_temp_dir')) {
$dir = sys_get_temp_dir();
if ($this->_isGoodTmpDir($dir)) {
return $dir;
}
}
// Attemp to detect by creating a temporary file
$tempFile = tempnam(md5(uniqid(rand(), TRUE)), '');
if ($tempFile) {
$dir = realpath(dirname($tempFile));
unlink($tempFile);
if ($this->_isGoodTmpDir($dir)) {
return $dir;
}
}
if ($this->_isGoodTmpDir('/tmp')) {
return '/tmp';
}
if ($this->_isGoodTmpDir('\\temp')) {
return '\\temp';
}
Zend_Cache::throwException('Could not determine temp directory, please specify a cache_dir manually');
}
/**
* Verify if the given temporary directory is readable and writable
*
* @param string $dir temporary directory
* @return boolean true if the directory is ok
*/
protected function _isGoodTmpDir($dir)
{
if (is_readable($dir)) {
if (is_writable($dir)) {
return true;
}
}
return false;
}
/**
* Make sure if we enable logging that the Zend_Log class
* is available.
* Create a default log object if none is set.
*
* @throws Zend_Cache_Exception
* @return void
*/
protected function _loggerSanity()
{
if (!isset($this->_directives['logging']) || !$this->_directives['logging']) {
return;
}
if (isset($this->_directives['logger'])) {
if ($this->_directives['logger'] instanceof Zend_Log) {
return;
}
Zend_Cache::throwException('Logger object is not an instance of Zend_Log class.');
}
// Create a default logger to the standard output stream
require_once 'Zend/Log.php';
require_once 'Zend/Log/Writer/Stream.php';
require_once 'Zend/Log/Filter/Priority.php';
$logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output'));
$logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<='));
$this->_directives['logger'] = $logger;
}
/**
* Log a message at the WARN (4) priority.
*
* @param string $message
* @throws Zend_Cache_Exception
* @return void
*/
protected function _log($message, $priority = 4)
{
if (!$this->_directives['logging']) {
return;
}
if (!isset($this->_directives['logger'])) {
Zend_Cache::throwException('Logging is enabled but logger is not set.');
}
$logger = $this->_directives['logger'];
if (!$logger instanceof Zend_Log) {
Zend_Cache::throwException('Logger object is not an instance of Zend_Log class.');
}
$logger->log($message, $priority);
}
}

View File

@ -1,127 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ExtendedInterface.php 24593 2012-01-05 20:35:02Z matthew $
*/
/**
* @see Zend_Cache_Backend_Interface
*/
//require_once 'Zend/Cache/Backend/Interface.php';
require_once dirname(__FILE__).'/Interface.php';
/**
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Cache_Backend_ExtendedInterface extends Zend_Cache_Backend_Interface
{
/**
* Return an array of stored cache ids
*
* @return array array of stored cache ids (string)
*/
public function getIds();
/**
* Return an array of stored tags
*
* @return array array of stored tags (string)
*/
public function getTags();
/**
* Return an array of stored cache ids which match given tags
*
* In case of multiple tags, a logical AND is made between tags
*
* @param array $tags array of tags
* @return array array of matching cache ids (string)
*/
public function getIdsMatchingTags($tags = array());
/**
* Return an array of stored cache ids which don't match given tags
*
* In case of multiple tags, a logical OR is made between tags
*
* @param array $tags array of tags
* @return array array of not matching cache ids (string)
*/
public function getIdsNotMatchingTags($tags = array());
/**
* Return an array of stored cache ids which match any given tags
*
* In case of multiple tags, a logical AND is made between tags
*
* @param array $tags array of tags
* @return array array of any matching cache ids (string)
*/
public function getIdsMatchingAnyTags($tags = array());
/**
* Return the filling percentage of the backend storage
*
* @return int integer between 0 and 100
*/
public function getFillingPercentage();
/**
* Return an array of metadatas for the given cache id
*
* The array must include these keys :
* - expire : the expire timestamp
* - tags : a string array of tags
* - mtime : timestamp of last modification time
*
* @param string $id cache id
* @return array array of metadatas (false if the cache id is not found)
*/
public function getMetadatas($id);
/**
* Give (if possible) an extra lifetime to the given cache id
*
* @param string $id cache id
* @param int $extraLifetime
* @return boolean true if ok
*/
public function touch($id, $extraLifetime);
/**
* Return an associative array of capabilities (booleans) of the backend
*
* The array must include these keys :
* - automatic_cleaning (is automating cleaning necessary)
* - tags (are tags supported)
* - expired_read (is it possible to read expired cache records
* (for doNotTestCacheValidity option for example))
* - priority does the backend deal with priority when saving
* - infinite_lifetime (is infinite lifetime can work with this backend)
* - get_list (is it possible to get the list of cache ids and the complete list of tags)
*
* @return array associative of with capabilities
*/
public function getCapabilities();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,99 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 24593 2012-01-05 20:35:02Z matthew $
*/
/**
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Cache_Backend_Interface
{
/**
* Set the frontend directives
*
* @param array $directives assoc of directives
*/
public function setDirectives($directives);
/**
* Test if a cache is available for the given id and (if yes) return it (false else)
*
* Note : return value is always "string" (unserialization is done by the core not by the backend)
*
* @param string $id Cache id
* @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
* @return string|false cached datas
*/
public function load($id, $doNotTestCacheValidity = false);
/**
* Test if a cache is available or not (for the given id)
*
* @param string $id cache id
* @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
*/
public function test($id);
/**
* Save some string datas into a cache record
*
* Note : $data is always "string" (serialization is done by the
* core not by the backend)
*
* @param string $data Datas to cache
* @param string $id Cache id
* @param array $tags Array of strings, the cache record will be tagged by each string entry
* @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
* @return boolean true if no problem
*/
public function save($data, $id, $tags = array(), $specificLifetime = false);
/**
* Remove a cache record
*
* @param string $id Cache id
* @return boolean True if no problem
*/
public function remove($id);
/**
* Clean some cache records
*
* Available modes are :
* Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
* Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
* ($tags can be an array of strings or a single string)
* Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
* ($tags can be an array of strings or a single string)
*
* @param string $mode Clean mode
* @param array $tags Array of tags
* @return boolean true if no problem
*/
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array());
}

View File

@ -1,765 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Core.php 24989 2012-06-21 07:24:13Z mabe $
*/
/**
* @package Zend_Cache
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Cache_Core
{
/**
* Messages
*/
const BACKEND_NOT_SUPPORTS_TAG = 'tags are not supported by the current backend';
const BACKEND_NOT_IMPLEMENTS_EXTENDED_IF = 'Current backend doesn\'t implement the Zend_Cache_Backend_ExtendedInterface, so this method is not available';
/**
* Backend Object
*
* @var Zend_Cache_Backend_Interface $_backend
*/
protected $_backend = null;
/**
* Available options
*
* ====> (boolean) write_control :
* - Enable / disable write control (the cache is read just after writing to detect corrupt entries)
* - Enable write control will lightly slow the cache writing but not the cache reading
* Write control can detect some corrupt cache files but maybe it's not a perfect control
*
* ====> (boolean) caching :
* - Enable / disable caching
* (can be very useful for the debug of cached scripts)
*
* =====> (string) cache_id_prefix :
* - prefix for cache ids (namespace)
*
* ====> (boolean) automatic_serialization :
* - Enable / disable automatic serialization
* - It can be used to save directly datas which aren't strings (but it's slower)
*
* ====> (int) automatic_cleaning_factor :
* - Disable / Tune the automatic cleaning process
* - The automatic cleaning process destroy too old (for the given life time)
* cache files when a new cache file is written :
* 0 => no automatic cache cleaning
* 1 => systematic cache cleaning
* x (integer) > 1 => automatic cleaning randomly 1 times on x cache write
*
* ====> (int) lifetime :
* - Cache lifetime (in seconds)
* - If null, the cache is valid forever.
*
* ====> (boolean) logging :
* - If set to true, logging is activated (but the system is slower)
*
* ====> (boolean) ignore_user_abort
* - If set to true, the core will set the ignore_user_abort PHP flag inside the
* save() method to avoid cache corruptions in some cases (default false)
*
* @var array $_options available options
*/
protected $_options = array(
'write_control' => true,
'caching' => true,
'cache_id_prefix' => null,
'automatic_serialization' => false,
'automatic_cleaning_factor' => 10,
'lifetime' => 3600,
'logging' => false,
'logger' => null,
'ignore_user_abort' => false
);
/**
* Array of options which have to be transfered to backend
*
* @var array $_directivesList
*/
protected static $_directivesList = array('lifetime', 'logging', 'logger');
/**
* Not used for the core, just a sort a hint to get a common setOption() method (for the core and for frontends)
*
* @var array $_specificOptions
*/
protected $_specificOptions = array();
/**
* Last used cache id
*
* @var string $_lastId
*/
private $_lastId = null;
/**
* True if the backend implements Zend_Cache_Backend_ExtendedInterface
*
* @var boolean $_extendedBackend
*/
protected $_extendedBackend = false;
/**
* Array of capabilities of the backend (only if it implements Zend_Cache_Backend_ExtendedInterface)
*
* @var array
*/
protected $_backendCapabilities = array();
/**
* Constructor
*
* @param array|Zend_Config $options Associative array of options or Zend_Config instance
* @throws Zend_Cache_Exception
* @return void
*/
public function __construct($options = array())
{
if ($options instanceof Zend_Config) {
$options = $options->toArray();
}
if (!is_array($options)) {
Zend_Cache::throwException("Options passed were not an array"
. " or Zend_Config instance.");
}
while (list($name, $value) = each($options)) {
$this->setOption($name, $value);
}
$this->_loggerSanity();
}
/**
* Set options using an instance of type Zend_Config
*
* @param Zend_Config $config
* @return Zend_Cache_Core
*/
public function setConfig(Zend_Config $config)
{
$options = $config->toArray();
while (list($name, $value) = each($options)) {
$this->setOption($name, $value);
}
return $this;
}
/**
* Set the backend
*
* @param Zend_Cache_Backend $backendObject
* @throws Zend_Cache_Exception
* @return void
*/
public function setBackend(Zend_Cache_Backend $backendObject)
{
$this->_backend= $backendObject;
// some options (listed in $_directivesList) have to be given
// to the backend too (even if they are not "backend specific")
$directives = array();
foreach (Zend_Cache_Core::$_directivesList as $directive) {
$directives[$directive] = $this->_options[$directive];
}
$this->_backend->setDirectives($directives);
if (in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_backend))) {
$this->_extendedBackend = true;
$this->_backendCapabilities = $this->_backend->getCapabilities();
}
}
/**
* Returns the backend
*
* @return Zend_Cache_Backend backend object
*/
public function getBackend()
{
return $this->_backend;
}
/**
* Public frontend to set an option
*
* There is an additional validation (relatively to the protected _setOption method)
*
* @param string $name Name of the option
* @param mixed $value Value of the option
* @throws Zend_Cache_Exception
* @return void
*/
public function setOption($name, $value)
{
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name!");
}
$name = strtolower($name);
if (array_key_exists($name, $this->_options)) {
// This is a Core option
$this->_setOption($name, $value);
return;
}
if (array_key_exists($name, $this->_specificOptions)) {
// This a specic option of this frontend
$this->_specificOptions[$name] = $value;
return;
}
}
/**
* Public frontend to get an option value
*
* @param string $name Name of the option
* @throws Zend_Cache_Exception
* @return mixed option value
*/
public function getOption($name)
{
$name = strtolower($name);
if (array_key_exists($name, $this->_options)) {
// This is a Core option
return $this->_options[$name];
}
if (array_key_exists($name, $this->_specificOptions)) {
// This a specic option of this frontend
return $this->_specificOptions[$name];
}
Zend_Cache::throwException("Incorrect option name : $name");
}
/**
* Set an option
*
* @param string $name Name of the option
* @param mixed $value Value of the option
* @throws Zend_Cache_Exception
* @return void
*/
private function _setOption($name, $value)
{
if (!is_string($name) || !array_key_exists($name, $this->_options)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
if ($name == 'lifetime' && empty($value)) {
$value = null;
}
$this->_options[$name] = $value;
}
/**
* Force a new lifetime
*
* The new value is set for the core/frontend but for the backend too (directive)
*
* @param int $newLifetime New lifetime (in seconds)
* @return void
*/
public function setLifetime($newLifetime)
{
$this->_options['lifetime'] = $newLifetime;
$this->_backend->setDirectives(array(
'lifetime' => $newLifetime
));
}
/**
* Test if a cache is available for the given id and (if yes) return it (false else)
*
* @param string $id Cache id
* @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
* @param boolean $doNotUnserialize Do not serialize (even if automatic_serialization is true) => for internal use
* @return mixed|false Cached datas
*/
public function load($id, $doNotTestCacheValidity = false, $doNotUnserialize = false)
{
if (!$this->_options['caching']) {
return false;
}
$id = $this->_id($id); // cache id may need prefix
$this->_lastId = $id;
self::_validateIdOrTag($id);
$this->_log("Zend_Cache_Core: load item '{$id}'", 7);
$data = $this->_backend->load($id, $doNotTestCacheValidity);
if ($data===false) {
// no cache available
return false;
}
if ((!$doNotUnserialize) && $this->_options['automatic_serialization']) {
// we need to unserialize before sending the result
return unserialize($data);
}
return $data;
}
/**
* Test if a cache is available for the given id
*
* @param string $id Cache id
* @return int|false Last modified time of cache entry if it is available, false otherwise
*/
public function test($id)
{
if (!$this->_options['caching']) {
return false;
}
$id = $this->_id($id); // cache id may need prefix
self::_validateIdOrTag($id);
$this->_lastId = $id;
$this->_log("Zend_Cache_Core: test item '{$id}'", 7);
return $this->_backend->test($id);
}
/**
* Save some data in a cache
*
* @param mixed $data Data to put in cache (can be another type than string if automatic_serialization is on)
* @param string $id Cache id (if not set, the last cache id will be used)
* @param array $tags Cache tags
* @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
* @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
* @throws Zend_Cache_Exception
* @return boolean True if no problem
*/
public function save($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 8)
{
if (!$this->_options['caching']) {
return true;
}
if ($id === null) {
$id = $this->_lastId;
} else {
$id = $this->_id($id);
}
self::_validateIdOrTag($id);
self::_validateTagsArray($tags);
if ($this->_options['automatic_serialization']) {
// we need to serialize datas before storing them
$data = serialize($data);
} else {
if (!is_string($data)) {
Zend_Cache::throwException("Datas must be string or set automatic_serialization = true");
}
}
// automatic cleaning
if ($this->_options['automatic_cleaning_factor'] > 0) {
$rand = rand(1, $this->_options['automatic_cleaning_factor']);
if ($rand==1) {
// new way || deprecated way
if ($this->_extendedBackend || method_exists($this->_backend, 'isAutomaticCleaningAvailable')) {
$this->_log("Zend_Cache_Core::save(): automatic cleaning running", 7);
$this->clean(Zend_Cache::CLEANING_MODE_OLD);
} else {
$this->_log("Zend_Cache_Core::save(): automatic cleaning is not available/necessary with current backend", 4);
}
}
}
$this->_log("Zend_Cache_Core: save item '{$id}'", 7);
if ($this->_options['ignore_user_abort']) {
$abort = ignore_user_abort(true);
}
if (($this->_extendedBackend) && ($this->_backendCapabilities['priority'])) {
$result = $this->_backend->save($data, $id, $tags, $specificLifetime, $priority);
} else {
$result = $this->_backend->save($data, $id, $tags, $specificLifetime);
}
if ($this->_options['ignore_user_abort']) {
ignore_user_abort($abort);
}
if (!$result) {
// maybe the cache is corrupted, so we remove it !
$this->_log("Zend_Cache_Core::save(): failed to save item '{$id}' -> removing it", 4);
$this->_backend->remove($id);
return false;
}
if ($this->_options['write_control']) {
$data2 = $this->_backend->load($id, true);
if ($data!=$data2) {
$this->_log("Zend_Cache_Core::save(): write control of item '{$id}' failed -> removing it", 4);
$this->_backend->remove($id);
return false;
}
}
return true;
}
/**
* Remove a cache
*
* @param string $id Cache id to remove
* @return boolean True if ok
*/
public function remove($id)
{
if (!$this->_options['caching']) {
return true;
}
$id = $this->_id($id); // cache id may need prefix
self::_validateIdOrTag($id);
$this->_log("Zend_Cache_Core: remove item '{$id}'", 7);
return $this->_backend->remove($id);
}
/**
* Clean cache entries
*
* Available modes are :
* 'all' (default) => remove all cache entries ($tags is not used)
* 'old' => remove too old cache entries ($tags is not used)
* 'matchingTag' => remove cache entries matching all given tags
* ($tags can be an array of strings or a single string)
* 'notMatchingTag' => remove cache entries not matching one of the given tags
* ($tags can be an array of strings or a single string)
* 'matchingAnyTag' => remove cache entries matching any given tags
* ($tags can be an array of strings or a single string)
*
* @param string $mode
* @param array|string $tags
* @throws Zend_Cache_Exception
* @return boolean True if ok
*/
public function clean($mode = 'all', $tags = array())
{
if (!$this->_options['caching']) {
return true;
}
if (!in_array($mode, array(Zend_Cache::CLEANING_MODE_ALL,
Zend_Cache::CLEANING_MODE_OLD,
Zend_Cache::CLEANING_MODE_MATCHING_TAG,
Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG,
Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG))) {
Zend_Cache::throwException('Invalid cleaning mode');
}
self::_validateTagsArray($tags);
return $this->_backend->clean($mode, $tags);
}
/**
* Return an array of stored cache ids which match given tags
*
* In case of multiple tags, a logical AND is made between tags
*
* @param array $tags array of tags
* @return array array of matching cache ids (string)
*/
public function getIdsMatchingTags($tags = array())
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
if (!($this->_backendCapabilities['tags'])) {
Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
}
$ids = $this->_backend->getIdsMatchingTags($tags);
// we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
$prefix = & $this->_options['cache_id_prefix'];
$prefixLen = strlen($prefix);
foreach ($ids as &$id) {
if (strpos($id, $prefix) === 0) {
$id = substr($id, $prefixLen);
}
}
}
return $ids;
}
/**
* Return an array of stored cache ids which don't match given tags
*
* In case of multiple tags, a logical OR is made between tags
*
* @param array $tags array of tags
* @return array array of not matching cache ids (string)
*/
public function getIdsNotMatchingTags($tags = array())
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
if (!($this->_backendCapabilities['tags'])) {
Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
}
$ids = $this->_backend->getIdsNotMatchingTags($tags);
// we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
$prefix = & $this->_options['cache_id_prefix'];
$prefixLen = strlen($prefix);
foreach ($ids as &$id) {
if (strpos($id, $prefix) === 0) {
$id = substr($id, $prefixLen);
}
}
}
return $ids;
}
/**
* Return an array of stored cache ids which match any given tags
*
* In case of multiple tags, a logical OR is made between tags
*
* @param array $tags array of tags
* @return array array of matching any cache ids (string)
*/
public function getIdsMatchingAnyTags($tags = array())
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
if (!($this->_backendCapabilities['tags'])) {
Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
}
$ids = $this->_backend->getIdsMatchingAnyTags($tags);
// we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
$prefix = & $this->_options['cache_id_prefix'];
$prefixLen = strlen($prefix);
foreach ($ids as &$id) {
if (strpos($id, $prefix) === 0) {
$id = substr($id, $prefixLen);
}
}
}
return $ids;
}
/**
* Return an array of stored cache ids
*
* @return array array of stored cache ids (string)
*/
public function getIds()
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
$ids = $this->_backend->getIds();
// we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
$prefix = & $this->_options['cache_id_prefix'];
$prefixLen = strlen($prefix);
foreach ($ids as &$id) {
if (strpos($id, $prefix) === 0) {
$id = substr($id, $prefixLen);
}
}
}
return $ids;
}
/**
* Return an array of stored tags
*
* @return array array of stored tags (string)
*/
public function getTags()
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
if (!($this->_backendCapabilities['tags'])) {
Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
}
return $this->_backend->getTags();
}
/**
* Return the filling percentage of the backend storage
*
* @return int integer between 0 and 100
*/
public function getFillingPercentage()
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
return $this->_backend->getFillingPercentage();
}
/**
* Return an array of metadatas for the given cache id
*
* The array will include these keys :
* - expire : the expire timestamp
* - tags : a string array of tags
* - mtime : timestamp of last modification time
*
* @param string $id cache id
* @return array array of metadatas (false if the cache id is not found)
*/
public function getMetadatas($id)
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
$id = $this->_id($id); // cache id may need prefix
return $this->_backend->getMetadatas($id);
}
/**
* Give (if possible) an extra lifetime to the given cache id
*
* @param string $id cache id
* @param int $extraLifetime
* @return boolean true if ok
*/
public function touch($id, $extraLifetime)
{
if (!$this->_extendedBackend) {
Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
}
$id = $this->_id($id); // cache id may need prefix
$this->_log("Zend_Cache_Core: touch item '{$id}'", 7);
return $this->_backend->touch($id, $extraLifetime);
}
/**
* Validate a cache id or a tag (security, reliable filenames, reserved prefixes...)
*
* Throw an exception if a problem is found
*
* @param string $string Cache id or tag
* @throws Zend_Cache_Exception
* @return void
*/
protected static function _validateIdOrTag($string)
{
if (!is_string($string)) {
Zend_Cache::throwException('Invalid id or tag : must be a string');
}
if (substr($string, 0, 9) == 'internal-') {
Zend_Cache::throwException('"internal-*" ids or tags are reserved');
}
if (!preg_match('~^[a-zA-Z0-9_]+$~D', $string)) {
Zend_Cache::throwException("Invalid id or tag '$string' : must use only [a-zA-Z0-9_]");
}
}
/**
* Validate a tags array (security, reliable filenames, reserved prefixes...)
*
* Throw an exception if a problem is found
*
* @param array $tags Array of tags
* @throws Zend_Cache_Exception
* @return void
*/
protected static function _validateTagsArray($tags)
{
if (!is_array($tags)) {
Zend_Cache::throwException('Invalid tags array : must be an array');
}
foreach($tags as $tag) {
self::_validateIdOrTag($tag);
}
reset($tags);
}
/**
* Make sure if we enable logging that the Zend_Log class
* is available.
* Create a default log object if none is set.
*
* @throws Zend_Cache_Exception
* @return void
*/
protected function _loggerSanity()
{
if (!isset($this->_options['logging']) || !$this->_options['logging']) {
return;
}
if (isset($this->_options['logger']) && $this->_options['logger'] instanceof Zend_Log) {
return;
}
// Create a default logger to the standard output stream
require_once 'Zend/Log.php';
require_once 'Zend/Log/Writer/Stream.php';
require_once 'Zend/Log/Filter/Priority.php';
$logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output'));
$logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<='));
$this->_options['logger'] = $logger;
}
/**
* Log a message at the WARN (4) priority.
*
* @param string $message
* @throws Zend_Cache_Exception
* @return void
*/
protected function _log($message, $priority = 4)
{
if (!$this->_options['logging']) {
return;
}
if (!(isset($this->_options['logger']) || $this->_options['logger'] instanceof Zend_Log)) {
Zend_Cache::throwException('Logging is enabled but logger is not set');
}
$logger = $this->_options['logger'];
$logger->log($message, $priority);
}
/**
* Make and return a cache id
*
* Checks 'cache_id_prefix' and returns new id with prefix or simply the id if null
*
* @param string $id Cache id
* @return string Cache id (with or without prefix)
*/
protected function _id($id)
{
if (($id !== null) && isset($this->_options['cache_id_prefix'])) {
return $this->_options['cache_id_prefix'] . $id; // return with prefix
}
return $id; // no prefix, just return the $id passed
}
}

View File

@ -1,32 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Cache
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
*/
/**
* @see Zend_Exception
*/
require_once 'Zend/Exception.php';
/**
* @package Zend_Cache
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Cache_Exception extends Zend_Exception {}

View File

@ -1,96 +0,0 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 24593 2012-01-05 20:35:02Z matthew $
*/
/**
* @category Zend
* @package Zend
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Exception extends Exception
{
/**
* @var null|Exception
*/
private $_previous = null;
/**
* Construct the exception
*
* @param string $msg
* @param int $code
* @param Exception $previous
* @return void
*/
public function __construct($msg = '', $code = 0, Exception $previous = null)
{
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
parent::__construct($msg, (int) $code);
$this->_previous = $previous;
} else {
parent::__construct($msg, (int) $code, $previous);
}
}
/**
* Overloading
*
* For PHP < 5.3.0, provides access to the getPrevious() method.
*
* @param string $method
* @param array $args
* @return mixed
*/
public function __call($method, array $args)
{
if ('getprevious' == strtolower($method)) {
return $this->_getPrevious();
}
return null;
}
/**
* String representation of the exception
*
* @return string
*/
public function __toString()
{
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
if (null !== ($e = $this->getPrevious())) {
return $e->__toString()
. "\n\nNext "
. parent::__toString();
}
}
return parent::__toString();
}
/**
* Returns previous Exception
*
* @return Exception|null
*/
protected function _getPrevious()
{
return $this->_previous;
}
}

View File

@ -1,728 +0,0 @@
<?php
/**
* Content Extractor
*
* Uses patterns specified in site config files and auto detection (hNews/PHP Readability)
* to extract content from HTML files.
*
* @version 1.0
* @date 2013-02-05
* @author Keyvan Minoukadeh
* @copyright 2013 Keyvan Minoukadeh
* @license http://www.gnu.org/licenses/agpl-3.0.html AGPL v3
*/
class ContentExtractor
{
protected static $tidy_config = array(
'clean' => true,
'output-xhtml' => true,
'logical-emphasis' => true,
'show-body-only' => false,
'new-blocklevel-tags' => 'article, aside, footer, header, hgroup, menu, nav, section, details, datagrid',
'new-inline-tags' => 'mark, time, meter, progress, data',
'wrap' => 0,
'drop-empty-paras' => true,
'drop-proprietary-attributes' => false,
'enclose-text' => true,
'enclose-block-text' => true,
'merge-divs' => true,
'merge-spans' => true,
'char-encoding' => 'utf8',
'hide-comments' => true
);
protected $html;
protected $config;
protected $title;
protected $author = array();
protected $language;
protected $date;
protected $body;
protected $success = false;
protected $nextPageUrl;
public $allowedParsers = array('libxml', 'html5lib');
public $fingerprints = array();
public $readability;
public $debug = false;
public $debugVerbose = false;
function __construct($path, $fallback=null) {
SiteConfig::set_config_path($path, $fallback);
}
protected function debug($msg) {
if ($this->debug) {
$mem = round(memory_get_usage()/1024, 2);
$memPeak = round(memory_get_peak_usage()/1024, 2);
echo '* ',$msg;
if ($this->debugVerbose) echo ' - mem used: ',$mem," (peak: $memPeak)";
echo "\n";
ob_flush();
flush();
}
}
public function reset() {
$this->html = null;
$this->readability = null;
$this->config = null;
$this->title = null;
$this->body = null;
$this->author = array();
$this->language = null;
$this->date = null;
$this->nextPageUrl = null;
$this->success = false;
}
public function findHostUsingFingerprints($html) {
$this->debug('Checking fingerprints...');
$head = substr($html, 0, 8000);
foreach ($this->fingerprints as $_fp => $_fphost) {
$lookin = 'html';
if (is_array($_fphost)) {
if (isset($_fphost['head']) && $_fphost['head']) {
$lookin = 'head';
}
$_fphost = $_fphost['hostname'];
}
if (strpos($$lookin, $_fp) !== false) {
$this->debug("Found match: $_fphost");
return $_fphost;
}
}
$this->debug('No fingerprint matches');
return false;
}
// returns SiteConfig instance (joined in order: exact match, wildcard, fingerprint, global, default)
public function buildSiteConfig($url, $html='', $add_to_cache=true) {
// extract host name
$host = @parse_url($url, PHP_URL_HOST);
$host = strtolower($host);
if (substr($host, 0, 4) == 'www.') $host = substr($host, 4);
// is merged version already cached?
if (SiteConfig::is_cached("$host.merged")) {
$this->debug("Returning cached and merged site config for $host");
return SiteConfig::build("$host.merged");
}
// let's build from site_config/custom/ and standard/
$config = SiteConfig::build($host);
if ($add_to_cache && $config && !SiteConfig::is_cached("$host")) {
SiteConfig::add_to_cache($host, $config);
}
// if no match, use defaults
if (!$config) $config = new SiteConfig();
// load fingerprint config?
if ($config->autodetect_on_failure()) {
// check HTML for fingerprints
if (!empty($this->fingerprints) && ($_fphost = $this->findHostUsingFingerprints($html))) {
if ($config_fingerprint = SiteConfig::build($_fphost)) {
$this->debug("Appending site config settings from $_fphost (fingerprint match)");
$config->append($config_fingerprint);
if ($add_to_cache && !SiteConfig::is_cached($_fphost)) {
//$config_fingerprint->cache_in_apc = true;
SiteConfig::add_to_cache($_fphost, $config_fingerprint);
}
}
}
}
// load global config?
if ($config->autodetect_on_failure()) {
if ($config_global = SiteConfig::build('global', true)) {
$this->debug('Appending site config settings from global.txt');
$config->append($config_global);
if ($add_to_cache && !SiteConfig::is_cached('global')) {
//$config_global->cache_in_apc = true;
SiteConfig::add_to_cache('global', $config_global);
}
}
}
// store copy of merged config
if ($add_to_cache) {
// do not store in APC if wildcard match
$use_apc = ($host == $config->cache_key);
$config->cache_key = null;
SiteConfig::add_to_cache("$host.merged", $config, $use_apc);
}
return $config;
}
// returns true on success, false on failure
// $smart_tidy indicates that if tidy is used and no results are produced, we will
// try again without it. Tidy helps us deal with PHP's patchy HTML parsing most of the time
// but it has problems of its own which we try to avoid with this option.
public function process($html, $url, $smart_tidy=true) {
$this->reset();
$this->config = $this->buildSiteConfig($url, $html);
// do string replacements
if (!empty($this->config->find_string)) {
if (count($this->config->find_string) == count($this->config->replace_string)) {
$html = str_replace($this->config->find_string, $this->config->replace_string, $html, $_count);
$this->debug("Strings replaced: $_count (find_string and/or replace_string)");
} else {
$this->debug('Skipped string replacement - incorrect number of find-replace strings in site config');
}
unset($_count);
}
// use tidy (if it exists)?
// This fixes problems with some sites which would otherwise
// trouble DOMDocument's HTML parsing. (Although sometimes it
// makes matters worse, which is why you can override it in site config files.)
$tidied = false;
if ($this->config->tidy() && function_exists('tidy_parse_string') && $smart_tidy) {
$this->debug('Using Tidy');
$tidy = tidy_parse_string($html, self::$tidy_config, 'UTF8');
if (tidy_clean_repair($tidy)) {
$original_html = $html;
$tidied = true;
$html = $tidy->value;
}
unset($tidy);
}
// load and parse html
$_parser = $this->config->parser();
if (!in_array($_parser, $this->allowedParsers)) {
$this->debug("HTML parser $_parser not listed, using libxml instead");
$_parser = 'libxml';
}
$this->debug("Attempting to parse HTML with $_parser");
$this->readability = new Readability($html, $url, $_parser);
// we use xpath to find elements in the given HTML document
// see http://en.wikipedia.org/wiki/XPath_1.0
$xpath = new DOMXPath($this->readability->dom);
// try to get next page link
foreach ($this->config->next_page_link as $pattern) {
$elems = @$xpath->evaluate($pattern, $this->readability->dom);
if (is_string($elems)) {
$this->nextPageUrl = trim($elems);
break;
} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {
foreach ($elems as $item) {
if ($item instanceof DOMElement && $item->hasAttribute('href')) {
$this->nextPageUrl = $item->getAttribute('href');
break 2;
} elseif ($item instanceof DOMAttr && $item->value) {
$this->nextPageUrl = $item->value;
break 2;
}
}
}
}
// try to get title
foreach ($this->config->title as $pattern) {
// $this->debug("Trying $pattern");
$elems = @$xpath->evaluate($pattern, $this->readability->dom);
if (is_string($elems)) {
$this->title = trim($elems);
$this->debug('Title expression evaluated as string: '.$this->title);
$this->debug("...XPath match: $pattern");
break;
} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {
$this->title = $elems->item(0)->textContent;
$this->debug('Title matched: '.$this->title);
$this->debug("...XPath match: $pattern");
// remove title from document
try {
$elems->item(0)->parentNode->removeChild($elems->item(0));
} catch (DOMException $e) {
// do nothing
}
break;
}
}
// try to get author (if it hasn't already been set)
if (empty($this->author)) {
foreach ($this->config->author as $pattern) {
$elems = @$xpath->evaluate($pattern, $this->readability->dom);
if (is_string($elems)) {
if (trim($elems) != '') {
$this->author[] = trim($elems);
$this->debug('Author expression evaluated as string: '.trim($elems));
$this->debug("...XPath match: $pattern");
break;
}
} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {
foreach ($elems as $elem) {
if (!isset($elem->parentNode)) continue;
$this->author[] = trim($elem->textContent);
$this->debug('Author matched: '.trim($elem->textContent));
}
if (!empty($this->author)) {
$this->debug("...XPath match: $pattern");
break;
}
}
}
}
// try to get language
$_lang_xpath = array('//html[@lang]/@lang', '//meta[@name="DC.language"]/@content');
foreach ($_lang_xpath as $pattern) {
$elems = @$xpath->evaluate($pattern, $this->readability->dom);
if (is_string($elems)) {
if (trim($elems) != '') {
$this->language = trim($elems);
$this->debug('Language matched: '.$this->language);
break;
}
} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {
foreach ($elems as $elem) {
if (!isset($elem->parentNode)) continue;
$this->language = trim($elem->textContent);
$this->debug('Language matched: '.$this->language);
}
if ($this->language) break;
}
}
// try to get date
foreach ($this->config->date as $pattern) {
$elems = @$xpath->evaluate($pattern, $this->readability->dom);
if (is_string($elems)) {
$this->date = strtotime(trim($elems, "; \t\n\r\0\x0B"));
} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {
$this->date = $elems->item(0)->textContent;
$this->date = strtotime(trim($this->date, "; \t\n\r\0\x0B"));
// remove date from document
// $elems->item(0)->parentNode->removeChild($elems->item(0));
}
if (!$this->date) {
$this->date = null;
} else {
$this->debug('Date matched: '.date('Y-m-d H:i:s', $this->date));
$this->debug("...XPath match: $pattern");
break;
}
}
// strip elements (using xpath expressions)
foreach ($this->config->strip as $pattern) {
$elems = @$xpath->query($pattern, $this->readability->dom);
// check for matches
if ($elems && $elems->length > 0) {
$this->debug('Stripping '.$elems->length.' elements (strip)');
for ($i=$elems->length-1; $i >= 0; $i--) {
$elems->item($i)->parentNode->removeChild($elems->item($i));
}
}
}
// strip elements (using id and class attribute values)
foreach ($this->config->strip_id_or_class as $string) {
$string = strtr($string, array("'"=>'', '"'=>''));
$elems = @$xpath->query("//*[contains(@class, '$string') or contains(@id, '$string')]", $this->readability->dom);
// check for matches
if ($elems && $elems->length > 0) {
$this->debug('Stripping '.$elems->length.' elements (strip_id_or_class)');
for ($i=$elems->length-1; $i >= 0; $i--) {
$elems->item($i)->parentNode->removeChild($elems->item($i));
}
}
}
// strip images (using src attribute values)
foreach ($this->config->strip_image_src as $string) {
$string = strtr($string, array("'"=>'', '"'=>''));
$elems = @$xpath->query("//img[contains(@src, '$string')]", $this->readability->dom);
// check for matches
if ($elems && $elems->length > 0) {
$this->debug('Stripping '.$elems->length.' image elements');
for ($i=$elems->length-1; $i >= 0; $i--) {
$elems->item($i)->parentNode->removeChild($elems->item($i));
}
}
}
// strip elements using Readability.com and Instapaper.com ignore class names
// .entry-unrelated and .instapaper_ignore
// See https://www.readability.com/publishers/guidelines/#view-plainGuidelines
// and http://blog.instapaper.com/post/730281947
$elems = @$xpath->query("//*[contains(concat(' ',normalize-space(@class),' '),' entry-unrelated ') or contains(concat(' ',normalize-space(@class),' '),' instapaper_ignore ')]", $this->readability->dom);
// check for matches
if ($elems && $elems->length > 0) {
$this->debug('Stripping '.$elems->length.' .entry-unrelated,.instapaper_ignore elements');
for ($i=$elems->length-1; $i >= 0; $i--) {
$elems->item($i)->parentNode->removeChild($elems->item($i));
}
}
// strip elements that contain style="display: none;"
$elems = @$xpath->query("//*[contains(@style,'display:none')]", $this->readability->dom);
// check for matches
if ($elems && $elems->length > 0) {
$this->debug('Stripping '.$elems->length.' elements with inline display:none style');
for ($i=$elems->length-1; $i >= 0; $i--) {
$elems->item($i)->parentNode->removeChild($elems->item($i));
}
}
// try to get body
foreach ($this->config->body as $pattern) {
$elems = @$xpath->query($pattern, $this->readability->dom);
// check for matches
if ($elems && $elems->length > 0) {
$this->debug('Body matched');
$this->debug("...XPath match: $pattern");
if ($elems->length == 1) {
$this->body = $elems->item(0);
// prune (clean up elements that may not be content)
if ($this->config->prune()) {
$this->debug('...pruning content');
$this->readability->prepArticle($this->body);
}
break;
} else {
$this->body = $this->readability->dom->createElement('div');
$this->debug($elems->length.' body elems found');
foreach ($elems as $elem) {
if (!isset($elem->parentNode)) continue;
$isDescendant = false;
foreach ($this->body->childNodes as $parent) {
if ($this->isDescendant($parent, $elem)) {
$isDescendant = true;
break;
}
}
if ($isDescendant) {
$this->debug('...element is child of another body element, skipping.');
} else {
// prune (clean up elements that may not be content)
if ($this->config->prune()) {
$this->debug('Pruning content');
$this->readability->prepArticle($elem);
}
$this->debug('...element added to body');
$this->body->appendChild($elem);
}
}
if ($this->body->hasChildNodes()) break;
}
}
}
// auto detect?
$detect_title = $detect_body = $detect_author = $detect_date = false;
// detect title?
if (!isset($this->title)) {
if (empty($this->config->title) || $this->config->autodetect_on_failure()) {
$detect_title = true;
}
}
// detect body?
if (!isset($this->body)) {
if (empty($this->config->body) || $this->config->autodetect_on_failure()) {
$detect_body = true;
}
}
// detect author?
if (empty($this->author)) {
if (empty($this->config->author) || $this->config->autodetect_on_failure()) {
$detect_author = true;
}
}
// detect date?
if (!isset($this->date)) {
if (empty($this->config->date) || $this->config->autodetect_on_failure()) {
$detect_date = true;
}
}
// check for hNews
if ($detect_title || $detect_body) {
// check for hentry
$elems = @$xpath->query("//*[contains(concat(' ',normalize-space(@class),' '),' hentry ')]", $this->readability->dom);
if ($elems && $elems->length > 0) {
$this->debug('hNews: found hentry');
$hentry = $elems->item(0);
if ($detect_title) {
// check for entry-title
$elems = @$xpath->query(".//*[contains(concat(' ',normalize-space(@class),' '),' entry-title ')]", $hentry);
if ($elems && $elems->length > 0) {
$this->title = $elems->item(0)->textContent;
$this->debug('hNews: found entry-title: '.$this->title);
// remove title from document
$elems->item(0)->parentNode->removeChild($elems->item(0));
$detect_title = false;
}
}
if ($detect_date) {
// check for time element with pubdate attribute
$elems = @$xpath->query(".//time[@pubdate] | .//abbr[contains(concat(' ',normalize-space(@class),' '),' published ')]", $hentry);
if ($elems && $elems->length > 0) {
$this->date = strtotime(trim($elems->item(0)->textContent));
// remove date from document
//$elems->item(0)->parentNode->removeChild($elems->item(0));
if ($this->date) {
$this->debug('hNews: found publication date: '.date('Y-m-d H:i:s', $this->date));
$detect_date = false;
} else {
$this->date = null;
}
}
}
if ($detect_author) {
// check for time element with pubdate attribute
$elems = @$xpath->query(".//*[contains(concat(' ',normalize-space(@class),' '),' vcard ') and (contains(concat(' ',normalize-space(@class),' '),' author ') or contains(concat(' ',normalize-space(@class),' '),' byline '))]", $hentry);
if ($elems && $elems->length > 0) {
$author = $elems->item(0);
$fn = @$xpath->query(".//*[contains(concat(' ',normalize-space(@class),' '),' fn ')]", $author);
if ($fn && $fn->length > 0) {
foreach ($fn as $_fn) {
if (trim($_fn->textContent) != '') {
$this->author[] = trim($_fn->textContent);
$this->debug('hNews: found author: '.trim($_fn->textContent));
}
}
} else {
if (trim($author->textContent) != '') {
$this->author[] = trim($author->textContent);
$this->debug('hNews: found author: '.trim($author->textContent));
}
}
$detect_author = empty($this->author);
}
}
// check for entry-content.
// according to hAtom spec, if there are multiple elements marked entry-content,
// we include all of these in the order they appear - see http://microformats.org/wiki/hatom#Entry_Content
if ($detect_body) {
$elems = @$xpath->query(".//*[contains(concat(' ',normalize-space(@class),' '),' entry-content ')]", $hentry);
if ($elems && $elems->length > 0) {
$this->debug('hNews: found entry-content');
if ($elems->length == 1) {
// what if it's empty? (some sites misuse hNews - place their content outside an empty entry-content element)
$e = $elems->item(0);
if (($e->tagName == 'img') || (trim($e->textContent) != '')) {
$this->body = $elems->item(0);
// prune (clean up elements that may not be content)
if ($this->config->prune()) {
$this->debug('Pruning content');
$this->readability->prepArticle($this->body);
}
$detect_body = false;
} else {
$this->debug('hNews: skipping entry-content - appears not to contain content');
}
unset($e);
} else {
$this->body = $this->readability->dom->createElement('div');
$this->debug($elems->length.' entry-content elems found');
foreach ($elems as $elem) {
if (!isset($elem->parentNode)) continue;
$isDescendant = false;
foreach ($this->body->childNodes as $parent) {
if ($this->isDescendant($parent, $elem)) {
$isDescendant = true;
break;
}
}
if ($isDescendant) {
$this->debug('Element is child of another body element, skipping.');
} else {
// prune (clean up elements that may not be content)
if ($this->config->prune()) {
$this->debug('Pruning content');
$this->readability->prepArticle($elem);
}
$this->debug('Element added to body');
$this->body->appendChild($elem);
}
}
$detect_body = false;
}
}
}
}
}
// check for elements marked with instapaper_title
if ($detect_title) {
// check for instapaper_title
$elems = @$xpath->query("//*[contains(concat(' ',normalize-space(@class),' '),' instapaper_title ')]", $this->readability->dom);
if ($elems && $elems->length > 0) {
$this->title = $elems->item(0)->textContent;
$this->debug('Title found (.instapaper_title): '.$this->title);
// remove title from document
$elems->item(0)->parentNode->removeChild($elems->item(0));
$detect_title = false;
}
}
// check for elements marked with instapaper_body
if ($detect_body) {
$elems = @$xpath->query("//*[contains(concat(' ',normalize-space(@class),' '),' instapaper_body ')]", $this->readability->dom);
if ($elems && $elems->length > 0) {
$this->debug('body found (.instapaper_body)');
$this->body = $elems->item(0);
// prune (clean up elements that may not be content)
if ($this->config->prune()) {
$this->debug('Pruning content');
$this->readability->prepArticle($this->body);
}
$detect_body = false;
}
}
// Find author in rel="author" marked element
// We only use this if there's exactly one.
// If there's more than one, it could indicate more than
// one author, but it could also indicate that we're processing
// a page listing different articles with different authors.
if ($detect_author) {
$elems = @$xpath->query("//a[contains(concat(' ',normalize-space(@rel),' '),' author ')]", $this->readability->dom);
if ($elems && $elems->length == 1) {
$author = trim($elems->item(0)->textContent);
if ($author != '') {
$this->debug("Author found (rel=\"author\"): $author");
$this->author[] = $author;
$detect_author = false;
}
}
}
// Find date in pubdate marked time element
// For the same reason given above, we only use this
// if there's exactly one element.
if ($detect_date) {
$elems = @$xpath->query("//time[@pubdate]", $this->readability->dom);
if ($elems && $elems->length == 1) {
$this->date = strtotime(trim($elems->item(0)->textContent));
// remove date from document
//$elems->item(0)->parentNode->removeChild($elems->item(0));
if ($this->date) {
$this->debug('Date found (pubdate marked time element): '.date('Y-m-d H:i:s', $this->date));
$detect_date = false;
} else {
$this->date = null;
}
}
}
// still missing title or body, so we detect using Readability
if ($detect_title || $detect_body) {
$this->debug('Using Readability');
// clone body if we're only using Readability for title (otherwise it may interfere with body element)
if (isset($this->body)) $this->body = $this->body->cloneNode(true);
$success = $this->readability->init();
}
if ($detect_title) {
$this->debug('Detecting title');
$this->title = $this->readability->getTitle()->textContent;
}
if ($detect_body && $success) {
$this->debug('Detecting body');
$this->body = $this->readability->getContent();
if ($this->body->childNodes->length == 1 && $this->body->firstChild->nodeType === XML_ELEMENT_NODE) {
$this->body = $this->body->firstChild;
}
// prune (clean up elements that may not be content)
if ($this->config->prune()) {
$this->debug('Pruning content');
$this->readability->prepArticle($this->body);
}
}
if (isset($this->body)) {
// remove scripts
$this->readability->removeScripts($this->body);
// remove any h1-h6 elements that appear as first thing in the body
// and which match our title
if (isset($this->title) && ($this->title != '')) {
$firstChild = $this->body->firstChild;
while ($firstChild->nodeType && ($firstChild->nodeType !== XML_ELEMENT_NODE)) {
$firstChild = $firstChild->nextSibling;
}
if (($firstChild->nodeType === XML_ELEMENT_NODE)
&& in_array(strtolower($firstChild->tagName), array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))
&& (strtolower(trim($firstChild->textContent)) == strtolower(trim($this->title)))) {
$this->body->removeChild($firstChild);
}
}
// prevent self-closing iframes
$elems = $this->body->getElementsByTagName('iframe');
for ($i = $elems->length-1; $i >= 0; $i--) {
$e = $elems->item($i);
if (!$e->hasChildNodes()) {
$e->appendChild($this->body->ownerDocument->createTextNode('[embedded content]'));
}
}
// remove image lazy loading - WordPress plugin http://wordpress.org/extend/plugins/lazy-load/
// the plugin replaces the src attribute to point to a 1x1 gif and puts the original src
// inside the data-lazy-src attribute. It also places the original image inside a noscript element
// next to the amended one.
$elems = @$xpath->query("//img[@data-lazy-src]", $this->body);
for ($i = $elems->length-1; $i >= 0; $i--) {
$e = $elems->item($i);
// let's see if we can grab image from noscript
if ($e->nextSibling !== null && $e->nextSibling->nodeName === 'noscript') {
$_new_elem = $e->ownerDocument->createDocumentFragment();
@$_new_elem->appendXML($e->nextSibling->innerHTML);
$e->nextSibling->parentNode->replaceChild($_new_elem, $e->nextSibling);
$e->parentNode->removeChild($e);
} else {
// Use data-lazy-src as src value
$e->setAttribute('src', $e->getAttribute('data-lazy-src'));
$e->removeAttribute('data-lazy-src');
}
}
$this->success = true;
}
// if we've had no success and we've used tidy, there's a chance
// that tidy has messed up. So let's try again without tidy...
if (!$this->success && $tidied && $smart_tidy) {
$this->debug('Trying again without tidy');
$this->process($original_html, $url, false);
}
return $this->success;
}
private function isDescendant(DOMElement $parent, DOMElement $child) {
$node = $child->parentNode;
while ($node != null) {
if ($node->isSameNode($parent)) return true;
$node = $node->parentNode;
}
return false;
}
public function getContent() {
return $this->body;
}
public function getTitle() {
return $this->title;
}
public function getAuthors() {
return $this->author;
}
public function getLanguage() {
return $this->language;
}
public function getDate() {
return $this->date;
}
public function getSiteConfig() {
return $this->config;
}
public function getNextPageUrl() {
return $this->nextPageUrl;
}
}
?>

View File

@ -1,338 +0,0 @@
<?php
/**
* Site Config
*
* Each instance of this class should hold extraction patterns and other directives
* for a website. See ContentExtractor class to see how it's used.
*
* @version 0.7
* @date 2012-08-27
* @author Keyvan Minoukadeh
* @copyright 2012 Keyvan Minoukadeh
* @license http://www.gnu.org/licenses/agpl-3.0.html AGPL v3
*/
class SiteConfig
{
// Use first matching element as title (0 or more xpath expressions)
public $title = array();
// Use first matching element as body (0 or more xpath expressions)
public $body = array();
// Use first matching element as author (0 or more xpath expressions)
public $author = array();
// Use first matching element as date (0 or more xpath expressions)
public $date = array();
// Strip elements matching these xpath expressions (0 or more)
public $strip = array();
// Strip elements which contain these strings (0 or more) in the id or class attribute
public $strip_id_or_class = array();
// Strip images which contain these strings (0 or more) in the src attribute
public $strip_image_src = array();
// Additional HTTP headers to send
// NOT YET USED
public $http_header = array();
// Process HTML with tidy before creating DOM (bool or null if undeclared)
public $tidy = null;
protected $default_tidy = true; // used if undeclared
// Autodetect title/body if xpath expressions fail to produce results.
// Note that this applies to title and body separately, ie.
// * if we get a body match but no title match, this option will determine whether we autodetect title
// * if neither match, this determines whether we autodetect title and body.
// Also note that this only applies when there is at least one xpath expression in title or body, ie.
// * if title and body are both empty (no xpath expressions), this option has no effect (both title and body will be auto-detected)
// * if there's an xpath expression for title and none for body, body will be auto-detected and this option will determine whether we auto-detect title if the xpath expression for it fails to produce results.
// Usage scenario: you want to extract something specific from a set of URLs, e.g. a table, and if the table is not found, you want to ignore the entry completely. Auto-detection is unlikely to succeed here, so you construct your patterns and set this option to false. Another scenario may be a site where auto-detection has proven to fail (or worse, picked up the wrong content).
// bool or null if undeclared
public $autodetect_on_failure = null;
protected $default_autodetect_on_failure = true; // used if undeclared
// Clean up content block - attempt to remove elements that appear to be superfluous
// bool or null if undeclared
public $prune = null;
protected $default_prune = true; // used if undeclared
// Test URL - if present, can be used to test the config above
public $test_url = array();
// Single-page link - should identify a link element or URL pointing to the page holding the entire article
// This is useful for sites which split their articles across multiple pages. Links to such pages tend to
// display the first page with links to the other pages at the bottom. Often there is also a link to a page
// which displays the entire article on one page (e.g. 'print view').
// This should be an XPath expression identifying the link to that page. If present and we find a match,
// we will retrieve that page and the rest of the options in this config will be applied to the new page.
public $single_page_link = array();
public $next_page_link = array();
// Single-page link in feed? - same as above, but patterns applied to item description HTML taken from feed
public $single_page_link_in_feed = array();
// Which parser to use for turning raw HTML into a DOMDocument (either 'libxml' or 'html5lib')
// string or null if undeclared
public $parser = null;
protected $default_parser = 'libxml'; // used if undeclared
// Strings to search for in HTML before processing begins (used with $replace_string)
public $find_string = array();
// Strings to replace those found in $find_string before HTML processing begins
public $replace_string = array();
// the options below cannot be set in the config files which this class represents
//public $cache_in_apc = false; // used to decide if we should cache in apc or not
public $cache_key = null;
public static $debug = false;
protected static $apc = false;
protected static $config_path;
protected static $config_path_fallback;
protected static $config_cache = array();
const HOSTNAME_REGEX = '/^(([a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9-]*[A-Za-z0-9])$/';
protected static function debug($msg) {
if (self::$debug) {
//$mem = round(memory_get_usage()/1024, 2);
//$memPeak = round(memory_get_peak_usage()/1024, 2);
echo '* ',$msg;
//echo ' - mem used: ',$mem," (peak: $memPeak)\n";
echo "\n";
ob_flush();
flush();
}
}
// enable APC caching of certain site config files?
// If enabled the following site config files will be
// cached in APC cache (when requested for first time):
// * anything in site_config/custom/ and its corresponding file in site_config/standard/
// * the site config files associated with HTML fingerprints
// * the global site config file
// returns true if enabled, false otherwise
public static function use_apc($apc=true) {
if (!function_exists('apc_add')) {
if ($apc) self::debug('APC will not be used (function apc_add does not exist)');
return false;
}
self::$apc = $apc;
return $apc;
}
// return bool or null
public function tidy($use_default=true) {
if ($use_default) return (isset($this->tidy)) ? $this->tidy : $this->default_tidy;
return $this->tidy;
}
// return bool or null
public function prune($use_default=true) {
if ($use_default) return (isset($this->prune)) ? $this->prune : $this->default_prune;
return $this->prune;
}
// return string or null
public function parser($use_default=true) {
if ($use_default) return (isset($this->parser)) ? $this->parser : $this->default_parser;
return $this->parser;
}
// return bool or null
public function autodetect_on_failure($use_default=true) {
if ($use_default) return (isset($this->autodetect_on_failure)) ? $this->autodetect_on_failure : $this->default_autodetect_on_failure;
return $this->autodetect_on_failure;
}
public static function set_config_path($path, $fallback=null) {
self::$config_path = $path;
self::$config_path_fallback = $fallback;
}
public static function add_to_cache($key, SiteConfig $config, $use_apc=true) {
$key = strtolower($key);
if (substr($key, 0, 4) == 'www.') $key = substr($key, 4);
if ($config->cache_key) $key = $config->cache_key;
self::$config_cache[$key] = $config;
if (self::$apc && $use_apc) {
self::debug("Adding site config to APC cache with key sc.$key");
apc_add("sc.$key", $config);
}
self::debug("Cached site config with key $key");
}
public static function is_cached($key) {
$key = strtolower($key);
if (substr($key, 0, 4) == 'www.') $key = substr($key, 4);
if (array_key_exists($key, self::$config_cache)) {
return true;
} elseif (self::$apc && (bool)apc_fetch("sc.$key")) {
return true;
}
return false;
}
public function append(SiteConfig $newconfig) {
// check for commands where we accept multiple statements (no test_url)
foreach (array('title', 'body', 'author', 'date', 'strip', 'strip_id_or_class', 'strip_image_src', 'single_page_link', 'single_page_link_in_feed', 'next_page_link', 'http_header', 'find_string', 'replace_string') as $var) {
// append array elements for this config variable from $newconfig to this config
//$this->$var = $this->$var + $newconfig->$var;
$this->$var = array_unique(array_merge($this->$var, $newconfig->$var));
}
// check for single statement commands
// we do not overwrite existing non null values
foreach (array('tidy', 'prune', 'parser', 'autodetect_on_failure') as $var) {
if ($this->$var === null) $this->$var = $newconfig->$var;
}
}
// returns SiteConfig instance if an appropriate one is found, false otherwise
// if $exact_host_match is true, we will not look for wildcard config matches
// by default if host is 'test.example.org' we will look for and load '.example.org.txt' if it exists
public static function build($host, $exact_host_match=false) {
$host = strtolower($host);
if (substr($host, 0, 4) == 'www.') $host = substr($host, 4);
if (!$host || (strlen($host) > 200) || !preg_match(self::HOSTNAME_REGEX, ltrim($host, '.'))) return false;
// check for site configuration
$try = array($host);
// should we look for wildcard matches
if (!$exact_host_match) {
$split = explode('.', $host);
if (count($split) > 1) {
array_shift($split);
$try[] = '.'.implode('.', $split);
}
}
// look for site config file in primary folder
self::debug(". looking for site config for $host in primary folder");
foreach ($try as $h) {
if (array_key_exists($h, self::$config_cache)) {
self::debug("... site config for $h already loaded in this request");
return self::$config_cache[$h];
} elseif (self::$apc && ($sconfig = apc_fetch("sc.$h"))) {
self::debug("... site config for $h in APC cache");
return $sconfig;
} elseif (file_exists(self::$config_path."/$h.txt")) {
self::debug("... found site config ($h.txt)");
$file_primary = self::$config_path."/$h.txt";
$matched_name = $h;
break;
}
}
// if we found site config, process it
if (isset($file_primary)) {
$config_lines = file($file_primary, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if (!$config_lines || !is_array($config_lines)) return false;
$config = self::build_from_array($config_lines);
// if APC caching is available and enabled, mark this for cache
//$config->cache_in_apc = true;
$config->cache_key = $matched_name;
// if autodetec on failure is off (on by default) we do not need to look
// in secondary folder
if (!$config->autodetect_on_failure()) {
self::debug('... autodetect on failure is disabled (no other site config files will be loaded)');
return $config;
}
}
// look for site config file in secondary folder
if (isset(self::$config_path_fallback)) {
self::debug(". looking for site config for $host in secondary folder");
foreach ($try as $h) {
if (file_exists(self::$config_path_fallback."/$h.txt")) {
self::debug("... found site config in secondary folder ($h.txt)");
$file_secondary = self::$config_path_fallback."/$h.txt";
$matched_name = $h;
break;
}
}
if (!isset($file_secondary)) {
self::debug("... no site config match in secondary folder");
}
}
// return false if no config file found
if (!isset($file_primary) && !isset($file_secondary)) {
self::debug("... no site config match for $host");
return false;
}
// return primary config if secondary not found
if (!isset($file_secondary) && isset($config)) {
return $config;
}
// process secondary config file
$config_lines = file($file_secondary, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if (!$config_lines || !is_array($config_lines)) {
// failed to process secondary
if (isset($config)) {
// return primary config
return $config;
} else {
return false;
}
}
// merge with primary and return
if (isset($config)) {
self::debug('. merging config files');
$config->append(self::build_from_array($config_lines));
return $config;
} else {
// return just secondary
$config = self::build_from_array($config_lines);
// if APC caching is available and enabled, mark this for cache
//$config->cache_in_apc = true;
$config->cache_key = $matched_name;
return $config;
}
}
public static function build_from_array(array $lines) {
$config = new SiteConfig();
foreach ($lines as $line) {
$line = trim($line);
// skip comments, empty lines
if ($line == '' || $line[0] == '#') continue;
// get command
$command = explode(':', $line, 2);
// if there's no colon ':', skip this line
if (count($command) != 2) continue;
$val = trim($command[1]);
$command = trim($command[0]);
if ($command == '' || $val == '') continue;
// check for commands where we accept multiple statements
if (in_array($command, array('title', 'body', 'author', 'date', 'strip', 'strip_id_or_class', 'strip_image_src', 'single_page_link', 'single_page_link_in_feed', 'next_page_link', 'http_header', 'test_url', 'find_string', 'replace_string'))) {
array_push($config->$command, $val);
// check for single statement commands that evaluate to true or false
} elseif (in_array($command, array('tidy', 'prune', 'autodetect_on_failure'))) {
$config->$command = ($val == 'yes');
// check for single statement commands stored as strings
} elseif (in_array($command, array('parser'))) {
$config->$command = $val;
// check for replace_string(find): replace
} elseif ((substr($command, -1) == ')') && preg_match('!^([a-z0-9_]+)\((.*?)\)$!i', $command, $match)) {
if (in_array($match[1], array('replace_string'))) {
$command = $match[1];
array_push($config->find_string, $match[2]);
array_push($config->$command, $val);
}
}
}
return $config;
}
}
?>

View File

@ -1,185 +0,0 @@
<?php
/**
* Univarsel Feed Writer
*
* FeedItem class - Used as feed element in FeedWriter class
*
* @package UnivarselFeedWriter
* @author Anis uddin Ahmad <anisniit@gmail.com>
* @link http://www.ajaxray.com/projects/rss
*/
class FeedItem
{
private $elements = array(); //Collection of feed elements
private $version;
/**
* Constructor
*
* @param contant (RSS1/RSS2/ATOM) RSS2 is default.
*/
function __construct($version = RSS2)
{
$this->version = $version;
}
/**
* Set element (overwrites existing elements with $elementName)
*
* @access public
* @param srting The tag name of an element
* @param srting The content of tag
* @param array Attributes(if any) in 'attrName' => 'attrValue' format
* @return void
*/
public function setElement($elementName, $content, $attributes = null)
{
if (isset($this->elements[$elementName])) {
unset($this->elements[$elementName]);
}
$this->addElement($elementName, $content, $attributes);
}
/**
* Add an element to elements array
*
* @access public
* @param srting The tag name of an element
* @param srting The content of tag
* @param array Attributes(if any) in 'attrName' => 'attrValue' format
* @return void
*/
public function addElement($elementName, $content, $attributes = null)
{
$i = 0;
if (isset($this->elements[$elementName])) {
$i = count($this->elements[$elementName]);
} else {
$this->elements[$elementName] = array();
}
$this->elements[$elementName][$i]['name'] = $elementName;
$this->elements[$elementName][$i]['content'] = $content;
$this->elements[$elementName][$i]['attributes'] = $attributes;
}
/**
* Set multiple feed elements from an array.
* Elements which have attributes cannot be added by this method
*
* @access public
* @param array array of elements in 'tagName' => 'tagContent' format.
* @return void
*/
public function addElementArray($elementArray)
{
if(! is_array($elementArray)) return;
foreach ($elementArray as $elementName => $content)
{
$this->addElement($elementName, $content);
}
}
/**
* Return the collection of elements in this feed item
*
* @access public
* @return array
*/
public function getElements()
{
return $this->elements;
}
// Wrapper functions ------------------------------------------------------
/**
* Set the 'dscription' element of feed item
*
* @access public
* @param string The content of 'description' element
* @return void
*/
public function setDescription($description)
{
$tag = 'description';
$this->setElement($tag, $description);
}
/**
* @desc Set the 'title' element of feed item
* @access public
* @param string The content of 'title' element
* @return void
*/
public function setTitle($title)
{
$this->setElement('title', $title);
}
/**
* Set the 'date' element of feed item
*
* @access public
* @param string The content of 'date' element
* @return void
*/
public function setDate($date)
{
if(! is_numeric($date))
{
$date = strtotime($date);
}
if($this->version == RSS2)
{
$tag = 'pubDate';
$value = date(DATE_RSS, $date);
}
else
{
$tag = 'dc:date';
$value = date("Y-m-d", $date);
}
$this->setElement($tag, $value);
}
/**
* Set the 'link' element of feed item
*
* @access public
* @param string The content of 'link' element
* @return void
*/
public function setLink($link)
{
if($this->version == RSS2 || $this->version == RSS1)
{
$this->setElement('link', $link);
}
else
{
$this->setElement('link','',array('href'=>$link));
$this->setElement('id', FeedWriter::uuid($link,'urn:uuid:'));
}
}
/**
* Set the 'encloser' element of feed item
* For RSS 2.0 only
*
* @access public
* @param string The url attribute of encloser tag
* @param string The length attribute of encloser tag
* @param string The type attribute of encloser tag
* @return void
*/
public function setEncloser($url, $length, $type)
{
$attributes = array('url'=>$url, 'length'=>$length, 'type'=>$type);
$this->setElement('enclosure','',$attributes);
}
} // end of class FeedItem
?>

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