aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/AppKernel.php1
-rw-r--r--composer.json3
-rw-r--r--composer.lock777
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php8
-rw-r--r--src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php82
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml14
6 files changed, 855 insertions, 30 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php
index 2475fe16..1eacb348 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -29,6 +29,7 @@ class AppKernel extends Kernel
29 new FOS\OAuthServerBundle\FOSOAuthServerBundle(), 29 new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
30 new Wallabag\UserBundle\WallabagUserBundle(), 30 new Wallabag\UserBundle\WallabagUserBundle(),
31 new Scheb\TwoFactorBundle\SchebTwoFactorBundle(), 31 new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
32 new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
32 ); 33 );
33 34
34 if (in_array($this->getEnvironment(), array('dev', 'test'))) { 35 if (in_array($this->getEnvironment(), array('dev', 'test'))) {
diff --git a/composer.json b/composer.json
index b6a9c854..ceefab02 100644
--- a/composer.json
+++ b/composer.json
@@ -57,7 +57,8 @@
57 "friendsofsymfony/oauth-server-bundle": "^1.4@dev", 57 "friendsofsymfony/oauth-server-bundle": "^1.4@dev",
58 "scheb/two-factor-bundle": "~1.4", 58 "scheb/two-factor-bundle": "~1.4",
59 "grandt/phpepub": "~4.0", 59 "grandt/phpepub": "~4.0",
60 "wallabag/php-mobi": "~1.0.0" 60 "wallabag/php-mobi": "~1.0.0",
61 "kphoen/rulerz-bundle": "dev-master"
61 }, 62 },
62 "require-dev": { 63 "require-dev": {
63 "doctrine/doctrine-fixtures-bundle": "~2.2.0", 64 "doctrine/doctrine-fixtures-bundle": "~2.2.0",
diff --git a/composer.lock b/composer.lock
index b7b5d142..b29ac98a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,8 @@
4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 "This file is @generated automatically" 5 "This file is @generated automatically"
6 ], 6 ],
7 "hash": "a9ec461e17166dcda1563dd55f6ff861", 7 "hash": "657caf7a678eb246a7055756dfa47d5d",
8 "content-hash": "95a1be6941e76e6a72622f183f4c0425",
8 "packages": [ 9 "packages": [
9 { 10 {
10 "name": "doctrine/annotations", 11 "name": "doctrine/annotations",
@@ -1485,6 +1486,610 @@
1485 "time": "2014-10-12 19:18:40" 1486 "time": "2014-10-12 19:18:40"
1486 }, 1487 },
1487 { 1488 {
1489 "name": "hoa/compiler",
1490 "version": "2.15.10.29",
1491 "source": {
1492 "type": "git",
1493 "url": "https://github.com/hoaproject/Compiler.git",
1494 "reference": "ec0849fd3c1472fbcd86c3c961981f0cfe1f8d39"
1495 },
1496 "dist": {
1497 "type": "zip",
1498 "url": "https://api.github.com/repos/hoaproject/Compiler/zipball/ec0849fd3c1472fbcd86c3c961981f0cfe1f8d39",
1499 "reference": "ec0849fd3c1472fbcd86c3c961981f0cfe1f8d39",
1500 "shasum": ""
1501 },
1502 "require": {
1503 "hoa/core": "~2.0",
1504 "hoa/file": "~0.0",
1505 "hoa/iterator": "~1.0",
1506 "hoa/math": "~0.0",
1507 "hoa/regex": "~0.0",
1508 "hoa/visitor": "~1.0"
1509 },
1510 "require-dev": {
1511 "hoa/json": "~1.0",
1512 "hoa/test": "~1.0"
1513 },
1514 "type": "library",
1515 "extra": {
1516 "branch-alias": {
1517 "dev-master": "2.x-dev"
1518 }
1519 },
1520 "autoload": {
1521 "psr-4": {
1522 "Hoa\\Compiler\\": "."
1523 }
1524 },
1525 "notification-url": "https://packagist.org/downloads/",
1526 "license": [
1527 "BSD-3-Clause"
1528 ],
1529 "authors": [
1530 {
1531 "name": "Ivan Enderlin",
1532 "email": "ivan.enderlin@hoa-project.net"
1533 },
1534 {
1535 "name": "Hoa community",
1536 "homepage": "http://hoa-project.net/"
1537 }
1538 ],
1539 "description": "The Hoa\\Compiler library.",
1540 "homepage": "http://hoa-project.net/",
1541 "keywords": [
1542 "algebraic",
1543 "ast",
1544 "compiler",
1545 "context-free",
1546 "coverage",
1547 "exhaustive",
1548 "grammar",
1549 "isotropic",
1550 "language",
1551 "lexer",
1552 "library",
1553 "ll1",
1554 "llk",
1555 "parser",
1556 "pp",
1557 "random",
1558 "regular",
1559 "rule",
1560 "sampler",
1561 "syntax",
1562 "token",
1563 "trace",
1564 "uniform"
1565 ],
1566 "time": "2015-10-29 21:35:12"
1567 },
1568 {
1569 "name": "hoa/core",
1570 "version": "2.15.11.09",
1571 "source": {
1572 "type": "git",
1573 "url": "https://github.com/hoaproject/Core.git",
1574 "reference": "5538b1e90e2c66c90df5cc45e03fb85d047be900"
1575 },
1576 "dist": {
1577 "type": "zip",
1578 "url": "https://api.github.com/repos/hoaproject/Core/zipball/5538b1e90e2c66c90df5cc45e03fb85d047be900",
1579 "reference": "5538b1e90e2c66c90df5cc45e03fb85d047be900",
1580 "shasum": ""
1581 },
1582 "require": {
1583 "ext-spl": "*",
1584 "php": ">=5.4.0"
1585 },
1586 "require-dev": {
1587 "hoa/test": "~1.0"
1588 },
1589 "suggest": {
1590 "ext-mbstring": "ext/mbstring must be present (or a third implementation).",
1591 "hoa/cli": "To use the `hoa` script."
1592 },
1593 "type": "library",
1594 "extra": {
1595 "branch-alias": {
1596 "dev-master": "2.x-dev"
1597 }
1598 },
1599 "autoload": {
1600 "psr-4": {
1601 "Hoa\\Core\\": "."
1602 },
1603 "files": [
1604 "Core.php"
1605 ]
1606 },
1607 "notification-url": "https://packagist.org/downloads/",
1608 "license": [
1609 "BSD-3-Clause"
1610 ],
1611 "authors": [
1612 {
1613 "name": "Ivan Enderlin",
1614 "email": "ivan.enderlin@hoa-project.net"
1615 },
1616 {
1617 "name": "Hoa community",
1618 "homepage": "http://hoa-project.net/"
1619 }
1620 ],
1621 "description": "The Hoa\\Core library.",
1622 "homepage": "http://hoa-project.net/",
1623 "keywords": [
1624 "consistency",
1625 "core",
1626 "data",
1627 "event",
1628 "library",
1629 "listener",
1630 "parameter",
1631 "protocol"
1632 ],
1633 "time": "2015-11-09 06:51:06"
1634 },
1635 {
1636 "name": "hoa/file",
1637 "version": "0.15.11.09",
1638 "source": {
1639 "type": "git",
1640 "url": "https://github.com/hoaproject/File.git",
1641 "reference": "f46fe552ff79cb6c93a2ff9c25cfbc134fbd57ee"
1642 },
1643 "dist": {
1644 "type": "zip",
1645 "url": "https://api.github.com/repos/hoaproject/File/zipball/f46fe552ff79cb6c93a2ff9c25cfbc134fbd57ee",
1646 "reference": "f46fe552ff79cb6c93a2ff9c25cfbc134fbd57ee",
1647 "shasum": ""
1648 },
1649 "require": {
1650 "hoa/core": "~2.0",
1651 "hoa/iterator": "~1.0",
1652 "hoa/stream": "~0.0"
1653 },
1654 "require-dev": {
1655 "hoa/test": "~1.0"
1656 },
1657 "type": "library",
1658 "extra": {
1659 "branch-alias": {
1660 "dev-master": "0.x-dev"
1661 }
1662 },
1663 "autoload": {
1664 "psr-4": {
1665 "Hoa\\File\\": "."
1666 }
1667 },
1668 "notification-url": "https://packagist.org/downloads/",
1669 "license": [
1670 "BSD-3-Clause"
1671 ],
1672 "authors": [
1673 {
1674 "name": "Ivan Enderlin",
1675 "email": "ivan.enderlin@hoa-project.net"
1676 },
1677 {
1678 "name": "Hoa community",
1679 "homepage": "http://hoa-project.net/"
1680 }
1681 ],
1682 "description": "The Hoa\\File library.",
1683 "homepage": "http://hoa-project.net/",
1684 "keywords": [
1685 "Socket",
1686 "directory",
1687 "file",
1688 "finder",
1689 "library",
1690 "link",
1691 "temporary"
1692 ],
1693 "time": "2015-11-09 06:55:20"
1694 },
1695 {
1696 "name": "hoa/iterator",
1697 "version": "1.15.10.29",
1698 "source": {
1699 "type": "git",
1700 "url": "https://github.com/hoaproject/Iterator.git",
1701 "reference": "a64ed9fd62579a34e4450134d6d1abdf77d54435"
1702 },
1703 "dist": {
1704 "type": "zip",
1705 "url": "https://api.github.com/repos/hoaproject/Iterator/zipball/a64ed9fd62579a34e4450134d6d1abdf77d54435",
1706 "reference": "a64ed9fd62579a34e4450134d6d1abdf77d54435",
1707 "shasum": ""
1708 },
1709 "require": {
1710 "hoa/core": "~2.0"
1711 },
1712 "require-dev": {
1713 "hoa/test": "~1.0"
1714 },
1715 "type": "library",
1716 "extra": {
1717 "branch-alias": {
1718 "dev-master": "1.x-dev"
1719 }
1720 },
1721 "autoload": {
1722 "psr-4": {
1723 "Hoa\\Iterator\\": "."
1724 }
1725 },
1726 "notification-url": "https://packagist.org/downloads/",
1727 "license": [
1728 "BSD-3-Clause"
1729 ],
1730 "authors": [
1731 {
1732 "name": "Ivan Enderlin",
1733 "email": "ivan.enderlin@hoa-project.net"
1734 },
1735 {
1736 "name": "Hoa community",
1737 "homepage": "http://hoa-project.net/"
1738 }
1739 ],
1740 "description": "The Hoa\\Iterator library.",
1741 "homepage": "http://hoa-project.net/",
1742 "keywords": [
1743 "iterator",
1744 "library"
1745 ],
1746 "time": "2015-10-29 21:37:16"
1747 },
1748 {
1749 "name": "hoa/math",
1750 "version": "0.15.10.26",
1751 "source": {
1752 "type": "git",
1753 "url": "https://github.com/hoaproject/Math.git",
1754 "reference": "62631c65d9a4f1b8bb4c4a3d6cdff0e8971d684e"
1755 },
1756 "dist": {
1757 "type": "zip",
1758 "url": "https://api.github.com/repos/hoaproject/Math/zipball/62631c65d9a4f1b8bb4c4a3d6cdff0e8971d684e",
1759 "reference": "62631c65d9a4f1b8bb4c4a3d6cdff0e8971d684e",
1760 "shasum": ""
1761 },
1762 "require": {
1763 "hoa/compiler": "~2.0",
1764 "hoa/core": "~2.0",
1765 "hoa/iterator": "~1.0"
1766 },
1767 "require-dev": {
1768 "hoa/test": "~1.0"
1769 },
1770 "type": "library",
1771 "extra": {
1772 "branch-alias": {
1773 "dev-master": "0.x-dev"
1774 }
1775 },
1776 "autoload": {
1777 "psr-4": {
1778 "Hoa\\Math\\": "."
1779 }
1780 },
1781 "notification-url": "https://packagist.org/downloads/",
1782 "license": [
1783 "BSD-3-Clause"
1784 ],
1785 "authors": [
1786 {
1787 "name": "Ivan Enderlin",
1788 "email": "ivan.enderlin@hoa-project.net"
1789 },
1790 {
1791 "name": "Hoa community",
1792 "homepage": "http://hoa-project.net/"
1793 }
1794 ],
1795 "description": "The Hoa\\Math library.",
1796 "homepage": "http://hoa-project.net/",
1797 "keywords": [
1798 "arrangement",
1799 "combination",
1800 "combinatorics",
1801 "counting",
1802 "library",
1803 "math",
1804 "permutation",
1805 "sampler",
1806 "set"
1807 ],
1808 "time": "2015-10-26 15:22:52"
1809 },
1810 {
1811 "name": "hoa/regex",
1812 "version": "0.15.08.13",
1813 "source": {
1814 "type": "git",
1815 "url": "https://github.com/hoaproject/Regex.git",
1816 "reference": "2ef8a77ef3885ca202fcd9c31a8e54c44cd04232"
1817 },
1818 "dist": {
1819 "type": "zip",
1820 "url": "https://api.github.com/repos/hoaproject/Regex/zipball/2ef8a77ef3885ca202fcd9c31a8e54c44cd04232",
1821 "reference": "2ef8a77ef3885ca202fcd9c31a8e54c44cd04232",
1822 "shasum": ""
1823 },
1824 "require": {
1825 "hoa/core": "~2.0",
1826 "hoa/math": "~0.0",
1827 "hoa/ustring": "~3.0",
1828 "hoa/visitor": "~1.0"
1829 },
1830 "type": "library",
1831 "extra": {
1832 "branch-alias": {
1833 "dev-master": "0.x-dev"
1834 }
1835 },
1836 "autoload": {
1837 "psr-4": {
1838 "Hoa\\Regex\\": "."
1839 }
1840 },
1841 "notification-url": "https://packagist.org/downloads/",
1842 "license": [
1843 "BSD-3-Clause"
1844 ],
1845 "authors": [
1846 {
1847 "name": "Ivan Enderlin",
1848 "email": "ivan.enderlin@hoa-project.net"
1849 },
1850 {
1851 "name": "Hoa community",
1852 "homepage": "http://hoa-project.net/"
1853 }
1854 ],
1855 "description": "The Hoa\\Regex library.",
1856 "homepage": "http://hoa-project.net/",
1857 "keywords": [
1858 "compiler",
1859 "library",
1860 "regex"
1861 ],
1862 "time": "2015-08-13 06:48:47"
1863 },
1864 {
1865 "name": "hoa/ruler",
1866 "version": "1.15.11.09",
1867 "source": {
1868 "type": "git",
1869 "url": "https://github.com/hoaproject/Ruler.git",
1870 "reference": "9afc9ae032d40b6dc10bff85c9126cf516953925"
1871 },
1872 "dist": {
1873 "type": "zip",
1874 "url": "https://api.github.com/repos/hoaproject/Ruler/zipball/9afc9ae032d40b6dc10bff85c9126cf516953925",
1875 "reference": "9afc9ae032d40b6dc10bff85c9126cf516953925",
1876 "shasum": ""
1877 },
1878 "require": {
1879 "hoa/compiler": "~2.0",
1880 "hoa/core": "~2.0",
1881 "hoa/file": "~0.0",
1882 "hoa/visitor": "~1.0"
1883 },
1884 "require-dev": {
1885 "hoa/test": "~1.0"
1886 },
1887 "type": "library",
1888 "extra": {
1889 "branch-alias": {
1890 "dev-master": "1.x-dev"
1891 }
1892 },
1893 "autoload": {
1894 "psr-4": {
1895 "Hoa\\Ruler\\": "."
1896 }
1897 },
1898 "notification-url": "https://packagist.org/downloads/",
1899 "license": [
1900 "BSD-3-Clause"
1901 ],
1902 "authors": [
1903 {
1904 "name": "Ivan Enderlin",
1905 "email": "ivan.enderlin@hoa-project.net"
1906 },
1907 {
1908 "name": "Hoa community",
1909 "homepage": "http://hoa-project.net/"
1910 }
1911 ],
1912 "description": "The Hoa\\Ruler library.",
1913 "homepage": "http://hoa-project.net/",
1914 "keywords": [
1915 "library",
1916 "ruler"
1917 ],
1918 "time": "2015-11-09 06:58:52"
1919 },
1920 {
1921 "name": "hoa/stream",
1922 "version": "0.15.10.26",
1923 "source": {
1924 "type": "git",
1925 "url": "https://github.com/hoaproject/Stream.git",
1926 "reference": "011ab91d942f1d7096deade4c8a10fe57d51c5b3"
1927 },
1928 "dist": {
1929 "type": "zip",
1930 "url": "https://api.github.com/repos/hoaproject/Stream/zipball/011ab91d942f1d7096deade4c8a10fe57d51c5b3",
1931 "reference": "011ab91d942f1d7096deade4c8a10fe57d51c5b3",
1932 "shasum": ""
1933 },
1934 "require": {
1935 "hoa/core": "~2.0"
1936 },
1937 "type": "library",
1938 "extra": {
1939 "branch-alias": {
1940 "dev-master": "0.x-dev"
1941 }
1942 },
1943 "autoload": {
1944 "psr-4": {
1945 "Hoa\\Stream\\": "."
1946 }
1947 },
1948 "notification-url": "https://packagist.org/downloads/",
1949 "license": [
1950 "BSD-3-Clause"
1951 ],
1952 "authors": [
1953 {
1954 "name": "Ivan Enderlin",
1955 "email": "ivan.enderlin@hoa-project.net"
1956 },
1957 {
1958 "name": "Hoa community",
1959 "homepage": "http://hoa-project.net/"
1960 }
1961 ],
1962 "description": "The Hoa\\Stream library.",
1963 "homepage": "http://hoa-project.net/",
1964 "keywords": [
1965 "Context",
1966 "bucket",
1967 "composite",
1968 "filter",
1969 "in",
1970 "library",
1971 "out",
1972 "protocol",
1973 "stream",
1974 "wrapper"
1975 ],
1976 "time": "2015-10-22 06:30:43"
1977 },
1978 {
1979 "name": "hoa/ustring",
1980 "version": "3.15.11.09",
1981 "source": {
1982 "type": "git",
1983 "url": "https://github.com/hoaproject/Ustring.git",
1984 "reference": "8506be4910212b1a2beb9014763a8a4fbd871001"
1985 },
1986 "dist": {
1987 "type": "zip",
1988 "url": "https://api.github.com/repos/hoaproject/Ustring/zipball/8506be4910212b1a2beb9014763a8a4fbd871001",
1989 "reference": "8506be4910212b1a2beb9014763a8a4fbd871001",
1990 "shasum": ""
1991 },
1992 "require": {
1993 "hoa/core": "~2.0"
1994 },
1995 "require-dev": {
1996 "hoa/test": "~1.0"
1997 },
1998 "suggest": {
1999 "ext-iconv": "ext/iconv must be present (or a third implementation) to use Hoa\\Ustring::transcode().",
2000 "ext-intl": "To get a better Hoa\\Ustring::toAscii() and Hoa\\Ustring::compareTo()."
2001 },
2002 "type": "library",
2003 "extra": {
2004 "branch-alias": {
2005 "dev-master": "3.x-dev"
2006 }
2007 },
2008 "autoload": {
2009 "psr-4": {
2010 "Hoa\\Ustring\\": "."
2011 }
2012 },
2013 "notification-url": "https://packagist.org/downloads/",
2014 "license": [
2015 "BSD-3-Clause"
2016 ],
2017 "authors": [
2018 {
2019 "name": "Ivan Enderlin",
2020 "email": "ivan.enderlin@hoa-project.net"
2021 },
2022 {
2023 "name": "Hoa community",
2024 "homepage": "http://hoa-project.net/"
2025 }
2026 ],
2027 "description": "The Hoa\\Ustring library.",
2028 "homepage": "http://hoa-project.net/",
2029 "keywords": [
2030 "library",
2031 "search",
2032 "string",
2033 "unicode"
2034 ],
2035 "time": "2015-11-09 06:44:33"
2036 },
2037 {
2038 "name": "hoa/visitor",
2039 "version": "1.15.08.17",
2040 "source": {
2041 "type": "git",
2042 "url": "https://github.com/hoaproject/Visitor.git",
2043 "reference": "e30bfff741f71979f6476a41548e34afe8053c67"
2044 },
2045 "dist": {
2046 "type": "zip",
2047 "url": "https://api.github.com/repos/hoaproject/Visitor/zipball/e30bfff741f71979f6476a41548e34afe8053c67",
2048 "reference": "e30bfff741f71979f6476a41548e34afe8053c67",
2049 "shasum": ""
2050 },
2051 "require": {
2052 "hoa/core": "~2.0"
2053 },
2054 "require-dev": {
2055 "hoa/test": "~1.0"
2056 },
2057 "type": "library",
2058 "extra": {
2059 "branch-alias": {
2060 "dev-master": "1.x-dev"
2061 }
2062 },
2063 "autoload": {
2064 "psr-4": {
2065 "Hoa\\Visitor\\": "."
2066 }
2067 },
2068 "notification-url": "https://packagist.org/downloads/",
2069 "license": [
2070 "BSD-3-Clause"
2071 ],
2072 "authors": [
2073 {
2074 "name": "Ivan Enderlin",
2075 "email": "ivan.enderlin@hoa-project.net"
2076 },
2077 {
2078 "name": "Hoa community",
2079 "homepage": "http://hoa-project.net/"
2080 }
2081 ],
2082 "description": "The Hoa\\Visitor library.",
2083 "homepage": "http://hoa-project.net/",
2084 "keywords": [
2085 "library",
2086 "structure",
2087 "visit",
2088 "visitor"
2089 ],
2090 "time": "2015-08-17 06:30:58"
2091 },
2092 {
1488 "name": "htmlawed/htmlawed", 2093 "name": "htmlawed/htmlawed",
1489 "version": "1.1.19", 2094 "version": "1.1.19",
1490 "source": { 2095 "source": {
@@ -1532,21 +2137,21 @@
1532 }, 2137 },
1533 { 2138 {
1534 "name": "incenteev/composer-parameter-handler", 2139 "name": "incenteev/composer-parameter-handler",
1535 "version": "v2.1.1", 2140 "version": "v2.1.2",
1536 "source": { 2141 "source": {
1537 "type": "git", 2142 "type": "git",
1538 "url": "https://github.com/Incenteev/ParameterHandler.git", 2143 "url": "https://github.com/Incenteev/ParameterHandler.git",
1539 "reference": "84a205fe80a46101607bafbc423019527893ddd0" 2144 "reference": "d7ce7f06136109e81d1cb9d57066c4d4a99cf1cc"
1540 }, 2145 },
1541 "dist": { 2146 "dist": {
1542 "type": "zip", 2147 "type": "zip",
1543 "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/84a205fe80a46101607bafbc423019527893ddd0", 2148 "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/d7ce7f06136109e81d1cb9d57066c4d4a99cf1cc",
1544 "reference": "84a205fe80a46101607bafbc423019527893ddd0", 2149 "reference": "d7ce7f06136109e81d1cb9d57066c4d4a99cf1cc",
1545 "shasum": "" 2150 "shasum": ""
1546 }, 2151 },
1547 "require": { 2152 "require": {
1548 "php": ">=5.3.3", 2153 "php": ">=5.3.3",
1549 "symfony/yaml": "~2.0" 2154 "symfony/yaml": "~2.3|~3.0"
1550 }, 2155 },
1551 "require-dev": { 2156 "require-dev": {
1552 "composer/composer": "1.0.*@dev", 2157 "composer/composer": "1.0.*@dev",
@@ -1579,7 +2184,7 @@
1579 "keywords": [ 2184 "keywords": [
1580 "parameters management" 2185 "parameters management"
1581 ], 2186 ],
1582 "time": "2015-06-03 08:27:03" 2187 "time": "2015-11-10 17:04:01"
1583 }, 2188 },
1584 { 2189 {
1585 "name": "j0k3r/graby", 2190 "name": "j0k3r/graby",
@@ -1671,20 +2276,19 @@
1671 }, 2276 },
1672 { 2277 {
1673 "name": "j0k3r/php-readability", 2278 "name": "j0k3r/php-readability",
1674 "version": "v1.0.8", 2279 "version": "v1.0.9",
1675 "source": { 2280 "source": {
1676 "type": "git", 2281 "type": "git",
1677 "url": "https://github.com/j0k3r/php-readability.git", 2282 "url": "https://github.com/j0k3r/php-readability.git",
1678 "reference": "f71c3a419623f821c245e0a003edfbf2c67f278e" 2283 "reference": "41d7440c6e6130bacd50808342fe566e28f536fb"
1679 }, 2284 },
1680 "dist": { 2285 "dist": {
1681 "type": "zip", 2286 "type": "zip",
1682 "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/f71c3a419623f821c245e0a003edfbf2c67f278e", 2287 "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/41d7440c6e6130bacd50808342fe566e28f536fb",
1683 "reference": "f71c3a419623f821c245e0a003edfbf2c67f278e", 2288 "reference": "41d7440c6e6130bacd50808342fe566e28f536fb",
1684 "shasum": "" 2289 "shasum": ""
1685 }, 2290 },
1686 "require": { 2291 "require": {
1687 "ext-tidy": ">=1.2",
1688 "php": ">=5.3.3" 2292 "php": ">=5.3.3"
1689 }, 2293 },
1690 "type": "library", 2294 "type": "library",
@@ -1730,7 +2334,7 @@
1730 "extraction", 2334 "extraction",
1731 "html" 2335 "html"
1732 ], 2336 ],
1733 "time": "2015-09-23 19:09:38" 2337 "time": "2015-11-10 08:55:29"
1734 }, 2338 },
1735 { 2339 {
1736 "name": "j0k3r/safecurl", 2340 "name": "j0k3r/safecurl",
@@ -2058,6 +2662,124 @@
2058 "time": "2013-12-05 14:36:11" 2662 "time": "2013-12-05 14:36:11"
2059 }, 2663 },
2060 { 2664 {
2665 "name": "kphoen/rulerz",
2666 "version": "0.14.0",
2667 "source": {
2668 "type": "git",
2669 "url": "https://github.com/K-Phoen/rulerz.git",
2670 "reference": "608649b148ffdf3437600cc0f450d59b0579148d"
2671 },
2672 "dist": {
2673 "type": "zip",
2674 "url": "https://api.github.com/repos/K-Phoen/rulerz/zipball/608649b148ffdf3437600cc0f450d59b0579148d",
2675 "reference": "608649b148ffdf3437600cc0f450d59b0579148d",
2676 "shasum": ""
2677 },
2678 "require": {
2679 "hoa/ruler": "~1.0",
2680 "php": ">=5.4",
2681 "symfony/property-access": "~2.3"
2682 },
2683 "require-dev": {
2684 "behat/behat": "~3.0",
2685 "coduo/phpspec-data-provider-extension": "~1.0,!=1.0.2",
2686 "doctrine/orm": "~2.4",
2687 "elasticsearch/elasticsearch": "~1.0",
2688 "illuminate/database": "~5.0",
2689 "mikey179/vfsstream": "~1.4",
2690 "phpspec/phpspec": "~2.0",
2691 "pomm-project/cli": "~2.0@dev",
2692 "pomm-project/foundation": "~2.0@dev",
2693 "pomm-project/model-manager": "~2.0.@dev",
2694 "ruflin/elastica": "~1.0",
2695 "vlucas/phpdotenv": "~2.1"
2696 },
2697 "suggest": {
2698 "doctrine/orm": "To execute rules as Doctrine queries",
2699 "elasticsearch/elasticsearch": "To execute rules as Elasticsearch queries",
2700 "kphoen/rulerz-spec-builder": "If you want a specification builder",
2701 "pomm-project/model-manager": "To execute rules as Pomm queries"
2702 },
2703 "type": "library",
2704 "extra": {
2705 "branch-alias": {
2706 "dev-master": "1.0.x-dev"
2707 }
2708 },
2709 "autoload": {
2710 "psr-4": {
2711 "RulerZ\\": "src/"
2712 }
2713 },
2714 "notification-url": "https://packagist.org/downloads/",
2715 "license": [
2716 "MIT"
2717 ],
2718 "authors": [
2719 {
2720 "name": "Kévin Gomez",
2721 "email": "contact@kevingomez.fr"
2722 }
2723 ],
2724 "description": "Powerful implementation of the Specification pattern",
2725 "homepage": "https://github.com/K-Phoen/RulerZ",
2726 "keywords": [
2727 "doctrine",
2728 "specification"
2729 ],
2730 "time": "2015-10-31 20:54:37"
2731 },
2732 {
2733 "name": "kphoen/rulerz-bundle",
2734 "version": "dev-master",
2735 "source": {
2736 "type": "git",
2737 "url": "https://github.com/K-Phoen/RulerZBundle.git",
2738 "reference": "86148898a052e349f880537c20d8102f617ebc17"
2739 },
2740 "dist": {
2741 "type": "zip",
2742 "url": "https://api.github.com/repos/K-Phoen/RulerZBundle/zipball/86148898a052e349f880537c20d8102f617ebc17",
2743 "reference": "86148898a052e349f880537c20d8102f617ebc17",
2744 "shasum": ""
2745 },
2746 "require": {
2747 "kphoen/rulerz": "~0.1, >=0.13.0",
2748 "symfony/framework-bundle": "~2.3",
2749 "symfony/validator": "~2.3"
2750 },
2751 "require-dev": {
2752 "matthiasnoback/symfony-dependency-injection-test": "~0.7",
2753 "mikey179/vfsstream": "~1.0",
2754 "phpunit/phpunit": "~4.8"
2755 },
2756 "type": "symfony-bundle",
2757 "autoload": {
2758 "psr-4": {
2759 "KPhoen\\RulerZBundle\\": ""
2760 }
2761 },
2762 "notification-url": "https://packagist.org/downloads/",
2763 "license": [
2764 "MIT"
2765 ],
2766 "authors": [
2767 {
2768 "name": "Kévin Gomez",
2769 "email": "contact@kevingomez.fr"
2770 }
2771 ],
2772 "description": "Symfony2 Bundle for RulerZ",
2773 "homepage": "https://github.com/K-Phoen/RulerZBundle",
2774 "keywords": [
2775 "doctrine",
2776 "ruler",
2777 "rulerz",
2778 "specification"
2779 ],
2780 "time": "2015-11-01 11:57:49"
2781 },
2782 {
2061 "name": "kriswallsmith/assetic", 2783 "name": "kriswallsmith/assetic",
2062 "version": "v1.3.1", 2784 "version": "v1.3.1",
2063 "source": { 2785 "source": {
@@ -3014,25 +3736,25 @@
3014 }, 3736 },
3015 { 3737 {
3016 "name": "sensio/framework-extra-bundle", 3738 "name": "sensio/framework-extra-bundle",
3017 "version": "v3.0.10", 3739 "version": "v3.0.11",
3018 "source": { 3740 "source": {
3019 "type": "git", 3741 "type": "git",
3020 "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", 3742 "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git",
3021 "reference": "18fc2063c4d6569cdca47a39fbac32342eb65f3c" 3743 "reference": "a79e205737b58d557c05caef6dfa8f94d8084bca"
3022 }, 3744 },
3023 "dist": { 3745 "dist": {
3024 "type": "zip", 3746 "type": "zip",
3025 "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/18fc2063c4d6569cdca47a39fbac32342eb65f3c", 3747 "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/a79e205737b58d557c05caef6dfa8f94d8084bca",
3026 "reference": "18fc2063c4d6569cdca47a39fbac32342eb65f3c", 3748 "reference": "a79e205737b58d557c05caef6dfa8f94d8084bca",
3027 "shasum": "" 3749 "shasum": ""
3028 }, 3750 },
3029 "require": { 3751 "require": {
3030 "doctrine/common": "~2.2", 3752 "doctrine/common": "~2.2",
3031 "symfony/framework-bundle": "~2.3" 3753 "symfony/framework-bundle": "~2.3|~3.0"
3032 }, 3754 },
3033 "require-dev": { 3755 "require-dev": {
3034 "symfony/expression-language": "~2.4", 3756 "symfony/expression-language": "~2.4|~3.0",
3035 "symfony/security-bundle": "~2.4" 3757 "symfony/security-bundle": "~2.4|~3.0"
3036 }, 3758 },
3037 "suggest": { 3759 "suggest": {
3038 "symfony/expression-language": "", 3760 "symfony/expression-language": "",
@@ -3065,7 +3787,7 @@
3065 "annotations", 3787 "annotations",
3066 "controllers" 3788 "controllers"
3067 ], 3789 ],
3068 "time": "2015-08-03 11:59:27" 3790 "time": "2015-10-28 15:47:04"
3069 }, 3791 },
3070 { 3792 {
3071 "name": "sensiolabs/security-checker", 3793 "name": "sensiolabs/security-checker",
@@ -4516,16 +5238,16 @@
4516 }, 5238 },
4517 { 5239 {
4518 "name": "phpunit/phpunit", 5240 "name": "phpunit/phpunit",
4519 "version": "4.8.16", 5241 "version": "4.8.18",
4520 "source": { 5242 "source": {
4521 "type": "git", 5243 "type": "git",
4522 "url": "https://github.com/sebastianbergmann/phpunit.git", 5244 "url": "https://github.com/sebastianbergmann/phpunit.git",
4523 "reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e" 5245 "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3"
4524 }, 5246 },
4525 "dist": { 5247 "dist": {
4526 "type": "zip", 5248 "type": "zip",
4527 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/625f8c345606ed0f3a141dfb88f4116f0e22978e", 5249 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa33d4ad96481b91df343d83e8c8aabed6b1dfd3",
4528 "reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e", 5250 "reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3",
4529 "shasum": "" 5251 "shasum": ""
4530 }, 5252 },
4531 "require": { 5253 "require": {
@@ -4584,7 +5306,7 @@
4584 "testing", 5306 "testing",
4585 "xunit" 5307 "xunit"
4586 ], 5308 ],
4587 "time": "2015-10-23 06:48:33" 5309 "time": "2015-11-11 11:32:49"
4588 }, 5310 },
4589 { 5311 {
4590 "name": "phpunit/phpunit-mock-objects", 5312 "name": "phpunit/phpunit-mock-objects",
@@ -5118,7 +5840,8 @@
5118 "minimum-stability": "dev", 5840 "minimum-stability": "dev",
5119 "stability-flags": { 5841 "stability-flags": {
5120 "friendsofsymfony/user-bundle": 20, 5842 "friendsofsymfony/user-bundle": 20,
5121 "friendsofsymfony/oauth-server-bundle": 20 5843 "friendsofsymfony/oauth-server-bundle": 20,
5844 "kphoen/rulerz-bundle": 20
5122 }, 5845 },
5123 "prefer-stable": true, 5846 "prefer-stable": true,
5124 "prefer-lowest": false, 5847 "prefer-lowest": false,
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 7fb41393..dc6e1184 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -13,10 +13,12 @@ use Wallabag\CoreBundle\Tools\Utils;
13class ContentProxy 13class ContentProxy
14{ 14{
15 protected $graby; 15 protected $graby;
16 protected $tagger;
16 17
17 public function __construct(Graby $graby) 18 public function __construct(Graby $graby, RuleBasedTagger $tagger)
18 { 19 {
19 $this->graby = $graby; 20 $this->graby = $graby;
21 $this->tagger = $tagger;
20 } 22 }
21 23
22 /** 24 /**
@@ -59,6 +61,8 @@ class ContentProxy
59 $entry->setPreviewPicture($content['open_graph']['og_image']); 61 $entry->setPreviewPicture($content['open_graph']['og_image']);
60 } 62 }
61 63
64 $this->tagger->tag($entry);
65
62 return $entry; 66 return $entry;
63 } 67 }
64} 68}
diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
new file mode 100644
index 00000000..012450b6
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
@@ -0,0 +1,82 @@
1<?php
2
3namespace Wallabag\CoreBundle\Helper;
4
5use RulerZ\RulerZ;
6
7use Wallabag\CoreBundle\Entity\Entry;
8use Wallabag\CoreBundle\Entity\Tag;
9use Wallabag\CoreBundle\Repository\TagRepository;
10use Wallabag\UserBundle\Entity\User;
11
12class RuleBasedTagger
13{
14 private $rulerz;
15 private $tagRepository;
16
17 public function __construct(RulerZ $rulerz, TagRepository $tagRepository)
18 {
19 $this->rulerz = $rulerz;
20 $this->tagRepository = $tagRepository;
21 }
22
23 /**
24 * Add tags from rules defined by the user.
25 *
26 * @param Entry $entry Entry to tag.
27 */
28 public function tag(Entry $entry)
29 {
30 $rules = $this->getRulesForUser($entry->getUser());
31
32 foreach ($rules as $rule) {
33 if (!$this->rulerz->satisfies($entry, $rule['rule'])) {
34 continue;
35 }
36
37 foreach ($rule['tags'] as $label) {
38 $tag = $this->getTag($entry->getUser(), $label);
39
40 $entry->addTag($tag);
41 }
42 }
43 }
44
45 /**
46 * Fetch a tag for a user.
47 *
48 * @param User $user
49 * @param string $label The tag's label.
50 *
51 * @return Tag
52 */
53 private function getTag(User $user, $label)
54 {
55 $tag = $this->tagRepository->findOneByLabelAndUserId($label, $user->getId());
56
57 if (!$tag) {
58 $tag = new Tag($user);
59 $tag->setLabel($label);
60 }
61
62 return $tag;
63 }
64
65 private function getRulesForUser(User $user)
66 {
67 return [
68 [
69 'rule' => 'domainName = "github.com"',
70 'tags' => ['github'],
71 ],
72 [
73 'rule' => 'readingTime >= 15',
74 'tags' => ['long reading'],
75 ],
76 [
77 'rule' => 'readingTime <= 3 ',
78 'tags' => ['short reading'],
79 ],
80 ];
81 }
82}
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 8e21b052..4cf46b33 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -53,6 +53,20 @@ services:
53 class: Wallabag\CoreBundle\Helper\ContentProxy 53 class: Wallabag\CoreBundle\Helper\ContentProxy
54 arguments: 54 arguments:
55 - @wallabag_core.graby 55 - @wallabag_core.graby
56 - @wallabag_core.rule_based_tagger
57
58 wallabag_core.rule_based_tagger:
59 class: Wallabag\CoreBundle\Helper\RuleBasedTagger
60 arguments:
61 - @rulerz
62 - @wallabag_core.tag_repository
63
64 wallabag_core.tag_repository:
65 class: Wallabag\CoreBundle\Repository\TagRepository
66 factory_service: doctrine.orm.default_entity_manager
67 factory_method: getRepository
68 arguments:
69 - WallabagCoreBundle:Tag
56 70
57 wallabag_core.registration_confirmed: 71 wallabag_core.registration_confirmed:
58 class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener 72 class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener