From a6f683e51a31381a39217247133a5c566e9ef276 Mon Sep 17 00:00:00 2001 From: Fabien Meurillon Date: Mon, 4 Aug 2014 01:18:51 +0200 Subject: [PATCH] Doctrine ! FOS User ! --- app/AppKernel.php | 4 + app/config/config.yml | 6 + app/config/routing.yml | 33 ++ composer.json | 8 +- composer.lock | 130 +++++++- .../Controller/DefaultController.php | 19 ++ .../DependencyInjection/Configuration.php | 29 ++ .../WallabagApiExtension.php | 28 ++ .../ApiBundle/Resources/config/services.xml | 20 ++ .../Resources/views/Default/index.html.twig | 1 + .../Controller/DefaultControllerTest.php | 17 + .../Bundle/ApiBundle/WallabagApiBundle.php | 9 + .../CliBundle/Command/CreateSchemaCommand.php | 36 +++ .../Controller/DefaultController.php | 19 ++ .../DependencyInjection/Configuration.php | 29 ++ .../WallabagCliExtension.php | 28 ++ .../CliBundle/Resources/config/services.xml | 20 ++ .../Resources/views/Default/index.html.twig | 1 + .../Controller/DefaultControllerTest.php | 17 + .../Bundle/CliBundle/WallabagCliBundle.php | 9 + .../Controller/DefaultController.php | 19 ++ .../DependencyInjection/Configuration.php | 29 ++ .../WallabagCoreExtension.php | 28 ++ .../Bundle/CoreBundle/Entity/Config.php | 94 ++++++ .../Bundle/CoreBundle/Entity/Entry.php | 294 ++++++++++++++++++ .../Bundle/CoreBundle/Entity/PluginOption.php | 94 ++++++ src/Wallabag/Bundle/CoreBundle/Entity/Tag.php | 64 ++++ .../Bundle/CoreBundle/Entity/User.php | 223 +++++++++++++ .../Repository/ConfigRepository.php | 15 + .../CoreBundle/Repository/EntryRepository.php | 15 + .../Repository/PluginOptionRepository.php | 15 + .../CoreBundle/Repository/TagRepository.php | 15 + .../CoreBundle/Resources/config/services.xml | 20 ++ .../Bundle/CoreBundle/Resources/doc/index.rst | 0 .../Resources/translations/messages.fr.xlf | 11 + .../Resources/views/Default/index.html.twig | 1 + .../Controller/DefaultControllerTest.php | 17 + .../Bundle/CoreBundle/WallabagCoreBundle.php | 9 + 38 files changed, 1413 insertions(+), 13 deletions(-) create mode 100644 src/Wallabag/Bundle/ApiBundle/Controller/DefaultController.php create mode 100644 src/Wallabag/Bundle/ApiBundle/DependencyInjection/Configuration.php create mode 100644 src/Wallabag/Bundle/ApiBundle/DependencyInjection/WallabagApiExtension.php create mode 100644 src/Wallabag/Bundle/ApiBundle/Resources/config/services.xml create mode 100644 src/Wallabag/Bundle/ApiBundle/Resources/views/Default/index.html.twig create mode 100644 src/Wallabag/Bundle/ApiBundle/Tests/Controller/DefaultControllerTest.php create mode 100644 src/Wallabag/Bundle/ApiBundle/WallabagApiBundle.php create mode 100644 src/Wallabag/Bundle/CliBundle/Command/CreateSchemaCommand.php create mode 100644 src/Wallabag/Bundle/CliBundle/Controller/DefaultController.php create mode 100644 src/Wallabag/Bundle/CliBundle/DependencyInjection/Configuration.php create mode 100644 src/Wallabag/Bundle/CliBundle/DependencyInjection/WallabagCliExtension.php create mode 100644 src/Wallabag/Bundle/CliBundle/Resources/config/services.xml create mode 100644 src/Wallabag/Bundle/CliBundle/Resources/views/Default/index.html.twig create mode 100644 src/Wallabag/Bundle/CliBundle/Tests/Controller/DefaultControllerTest.php create mode 100644 src/Wallabag/Bundle/CliBundle/WallabagCliBundle.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Controller/DefaultController.php create mode 100644 src/Wallabag/Bundle/CoreBundle/DependencyInjection/Configuration.php create mode 100644 src/Wallabag/Bundle/CoreBundle/DependencyInjection/WallabagCoreExtension.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Entity/Config.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Entity/Entry.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Entity/PluginOption.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Entity/Tag.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Entity/User.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Repository/ConfigRepository.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Repository/EntryRepository.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Repository/PluginOptionRepository.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Repository/TagRepository.php create mode 100644 src/Wallabag/Bundle/CoreBundle/Resources/config/services.xml create mode 100644 src/Wallabag/Bundle/CoreBundle/Resources/doc/index.rst create mode 100644 src/Wallabag/Bundle/CoreBundle/Resources/translations/messages.fr.xlf create mode 100644 src/Wallabag/Bundle/CoreBundle/Resources/views/Default/index.html.twig create mode 100644 src/Wallabag/Bundle/CoreBundle/Tests/Controller/DefaultControllerTest.php create mode 100644 src/Wallabag/Bundle/CoreBundle/WallabagCoreBundle.php diff --git a/app/AppKernel.php b/app/AppKernel.php index c35b166..a737a7f 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -16,6 +16,10 @@ class AppKernel extends Kernel new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), + new FOS\UserBundle\FOSUserBundle(), + new Wallabag\Bundle\CoreBundle\WallabagCoreBundle(), + new Wallabag\Bundle\ApiBundle\WallabagApiBundle(), + new Wallabag\Bundle\CliBundle\WallabagCliBundle(), ); if (in_array($this->getEnvironment(), array('dev', 'test'))) { diff --git a/app/config/config.yml b/app/config/config.yml index fcfde1a..eae1728 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -67,3 +67,9 @@ swiftmailer: username: "%mailer_user%" password: "%mailer_password%" spool: { type: memory } + +# FOS User Configuration +fos_user: + db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel' + firewall_name: main + user_class: Wallabag\CoreBundle\Entity\User \ No newline at end of file diff --git a/app/config/routing.yml b/app/config/routing.yml index e69de29..c228057 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -0,0 +1,33 @@ +wallabag_cli: + resource: "@WallabagCliBundle/Controller/" + type: annotation + prefix: / + +wallabag_api: + resource: "@WallabagApiBundle/Controller/" + type: annotation + prefix: / + +wallabag_core: + resource: "@WallabagCoreBundle/Controller/" + type: annotation + prefix: / + +fos_user_security: + resource: "@FOSUserBundle/Resources/config/routing/security.xml" + +fos_user_profile: + resource: "@FOSUserBundle/Resources/config/routing/profile.xml" + prefix: /profile + +fos_user_register: + resource: "@FOSUserBundle/Resources/config/routing/registration.xml" + prefix: /register + +fos_user_resetting: + resource: "@FOSUserBundle/Resources/config/routing/resetting.xml" + prefix: /resetting + +fos_user_change_password: + resource: "@FOSUserBundle/Resources/config/routing/change_password.xml" + prefix: /profile \ No newline at end of file diff --git a/composer.json b/composer.json index a9feaba..2024992 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { - "name": "symfony/framework-standard-edition", + "name": "wallabag/wallabag-symfony", "license": "MIT", "type": "project", - "description": "The \"Symfony Standard Edition\" distribution", + "description": "Wallabag Symfony Edition", "autoload": { "psr-0": { "": "src/", "SymfonyStandard": "app/" } }, @@ -17,7 +17,9 @@ "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~3.0", "sensio/framework-extra-bundle": "~3.0", - "incenteev/composer-parameter-handler": "~2.0" + "incenteev/composer-parameter-handler": "~2.0", + "fivefilters/php-readability": "v1.0", + "friendsofsymfony/user-bundle": "2.0.x-dev" }, "require-dev": { "sensio/generator-bundle": "~2.3" diff --git a/composer.lock b/composer.lock index ef5d6bb..e1e32b3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0f5bf28fac35560dbdb2e597d32df056", + "hash": "4f4cbc95623d5596ec8cf7cb1e3e4b11", "packages": [ { "name": "doctrine/annotations", @@ -629,6 +629,120 @@ ], "time": "2014-07-11 03:05:53" }, + { + "name": "fivefilters/php-readability", + "version": "v1.0", + "source": { + "type": "git", + "url": "http://code.fivefilters.org/php-readability.git", + "reference": "4f56053bd1fd540969b6cfb7f799a31c7352faee" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "Readability": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Keyvan Minoukadeh", + "email": "keyvan@keyvan.net", + "homepage": "http://keyvan.net", + "role": "Developer (ported original JS code to PHP)" + }, + { + "name": "Arc90", + "homepage": "http://arc90.com", + "role": "Developer (original JS version)" + } + ], + "description": "Automatic article extraction from HTML", + "homepage": "http://code.fivefilters.org/php-readability/", + "keywords": [ + "article", + "article extraction", + "content", + "content extraction", + "extraction", + "html" + ], + "time": "2013-04-17 13:51:09" + }, + { + "name": "friendsofsymfony/user-bundle", + "version": "dev-master", + "target-dir": "FOS/UserBundle", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git", + "reference": "1fe261de17abde29d6d461b7a93873d48b0efce7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/1fe261de17abde29d6d461b7a93873d48b0efce7", + "reference": "1fe261de17abde29d6d461b7a93873d48b0efce7", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/form": "~2.1", + "symfony/framework-bundle": "~2.1", + "symfony/security-bundle": "~2.1" + }, + "require-dev": { + "doctrine/doctrine-bundle": "*", + "swiftmailer/swiftmailer": ">=4.3, <6.0", + "symfony/validator": "~2.1", + "symfony/yaml": "~2.1", + "twig/twig": "~1.5", + "willdurand/propel-typehintable-behavior": "dev-master" + }, + "suggest": { + "willdurand/propel-typehintable-behavior": "Needed when using the propel implementation" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "FOS\\UserBundle": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + }, + { + "name": "FriendsOfSymfony Community", + "homepage": "https://github.com/friendsofsymfony/FOSUserBundle/contributors" + }, + { + "name": "Thibault Duplessis", + "email": "thibault.duplessis@gmail.com" + } + ], + "description": "Symfony FOSUserBundle", + "homepage": "http://friendsofsymfony.github.com", + "keywords": [ + "User management" + ], + "time": "2014-08-01 02:49:19" + }, { "name": "incenteev/composer-parameter-handler", "version": "v2.1.0", @@ -1580,18 +1694,14 @@ "time": "2014-04-28 14:01:06" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": [ - - ], + "stability-flags": { + "friendsofsymfony/user-bundle": 20 + }, "prefer-stable": false, "platform": { "php": ">=5.3.3" }, - "platform-dev": [ - - ] + "platform-dev": [] } diff --git a/src/Wallabag/Bundle/ApiBundle/Controller/DefaultController.php b/src/Wallabag/Bundle/ApiBundle/Controller/DefaultController.php new file mode 100644 index 0000000..bcf4477 --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/Controller/DefaultController.php @@ -0,0 +1,19 @@ + $name); + } +} diff --git a/src/Wallabag/Bundle/ApiBundle/DependencyInjection/Configuration.php b/src/Wallabag/Bundle/ApiBundle/DependencyInjection/Configuration.php new file mode 100644 index 0000000..76bfbc2 --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('wallabag_api'); + + // Here you should define the parameters that are allowed to + // configure your bundle. See the documentation linked above for + // more information on that topic. + + return $treeBuilder; + } +} diff --git a/src/Wallabag/Bundle/ApiBundle/DependencyInjection/WallabagApiExtension.php b/src/Wallabag/Bundle/ApiBundle/DependencyInjection/WallabagApiExtension.php new file mode 100644 index 0000000..289c2bb --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/DependencyInjection/WallabagApiExtension.php @@ -0,0 +1,28 @@ +processConfiguration($configuration, $configs); + + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.xml'); + } +} diff --git a/src/Wallabag/Bundle/ApiBundle/Resources/config/services.xml b/src/Wallabag/Bundle/ApiBundle/Resources/config/services.xml new file mode 100644 index 0000000..2c29dd8 --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/Resources/config/services.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/src/Wallabag/Bundle/ApiBundle/Resources/views/Default/index.html.twig b/src/Wallabag/Bundle/ApiBundle/Resources/views/Default/index.html.twig new file mode 100644 index 0000000..4ce626e --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello {{ name }}! diff --git a/src/Wallabag/Bundle/ApiBundle/Tests/Controller/DefaultControllerTest.php b/src/Wallabag/Bundle/ApiBundle/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 0000000..3280b2f --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/hello/Fabien'); + + $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); + } +} diff --git a/src/Wallabag/Bundle/ApiBundle/WallabagApiBundle.php b/src/Wallabag/Bundle/ApiBundle/WallabagApiBundle.php new file mode 100644 index 0000000..9074e09 --- /dev/null +++ b/src/Wallabag/Bundle/ApiBundle/WallabagApiBundle.php @@ -0,0 +1,9 @@ +setName('db:create') + ->setDescription('Create default schema') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $app = $this->getSilexApplication(); + $db = $app['db']; + + Schema::createTables($db); + + $output->writeln("Schema created"); + } +} + diff --git a/src/Wallabag/Bundle/CliBundle/Controller/DefaultController.php b/src/Wallabag/Bundle/CliBundle/Controller/DefaultController.php new file mode 100644 index 0000000..4d58ab1 --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/Controller/DefaultController.php @@ -0,0 +1,19 @@ + $name); + } +} diff --git a/src/Wallabag/Bundle/CliBundle/DependencyInjection/Configuration.php b/src/Wallabag/Bundle/CliBundle/DependencyInjection/Configuration.php new file mode 100644 index 0000000..c47e166 --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('wallabag_cli'); + + // Here you should define the parameters that are allowed to + // configure your bundle. See the documentation linked above for + // more information on that topic. + + return $treeBuilder; + } +} diff --git a/src/Wallabag/Bundle/CliBundle/DependencyInjection/WallabagCliExtension.php b/src/Wallabag/Bundle/CliBundle/DependencyInjection/WallabagCliExtension.php new file mode 100644 index 0000000..6fc53c4 --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/DependencyInjection/WallabagCliExtension.php @@ -0,0 +1,28 @@ +processConfiguration($configuration, $configs); + + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.xml'); + } +} diff --git a/src/Wallabag/Bundle/CliBundle/Resources/config/services.xml b/src/Wallabag/Bundle/CliBundle/Resources/config/services.xml new file mode 100644 index 0000000..9483f20 --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/Resources/config/services.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/src/Wallabag/Bundle/CliBundle/Resources/views/Default/index.html.twig b/src/Wallabag/Bundle/CliBundle/Resources/views/Default/index.html.twig new file mode 100644 index 0000000..4ce626e --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello {{ name }}! diff --git a/src/Wallabag/Bundle/CliBundle/Tests/Controller/DefaultControllerTest.php b/src/Wallabag/Bundle/CliBundle/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 0000000..3de7850 --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/hello/Fabien'); + + $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); + } +} diff --git a/src/Wallabag/Bundle/CliBundle/WallabagCliBundle.php b/src/Wallabag/Bundle/CliBundle/WallabagCliBundle.php new file mode 100644 index 0000000..6149630 --- /dev/null +++ b/src/Wallabag/Bundle/CliBundle/WallabagCliBundle.php @@ -0,0 +1,9 @@ + $name); + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/Bundle/CoreBundle/DependencyInjection/Configuration.php new file mode 100644 index 0000000..9cd4a85 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('wallabag_core'); + + // Here you should define the parameters that are allowed to + // configure your bundle. See the documentation linked above for + // more information on that topic. + + return $treeBuilder; + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/Bundle/CoreBundle/DependencyInjection/WallabagCoreExtension.php new file mode 100644 index 0000000..d1b3283 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -0,0 +1,28 @@ +processConfiguration($configuration, $configs); + + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.xml'); + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/Entity/Config.php b/src/Wallabag/Bundle/CoreBundle/Entity/Config.php new file mode 100644 index 0000000..81cf802 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Entity/Config.php @@ -0,0 +1,94 @@ +id; + } + + /** + * Set name + * + * @param string $name + * @return Config + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set value + * + * @param string $value + * @return Config + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/Entity/Entry.php b/src/Wallabag/Bundle/CoreBundle/Entity/Entry.php new file mode 100644 index 0000000..855619b --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Entity/Entry.php @@ -0,0 +1,294 @@ +id; + } + + /** + * Set url + * + * @param string $url + * @return Entry + */ + public function setUrl($url) + { + $this->url = $url; + + return $this; + } + + /** + * Get url + * + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Set title + * + * @param string $title + * @return Entry + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * Get title + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set content + * + * @param string $content + * @return Entry + */ + public function setContent($content) + { + $this->content = $content; + + return $this; + } + + /** + * Get content + * + * @return string + */ + public function getContent() + { + return $this->content; + } + + /** + * Set updated + * + * @param boolean $updated + * @return Entry + */ + public function setUpdated($updated) + { + $this->updated = $updated; + + return $this; + } + + /** + * Get updated + * + * @return boolean + */ + public function getUpdated() + { + return $this->updated; + } + + /** + * Set status + * + * @param string $status + * @return Entry + */ + public function setStatus($status) + { + $this->status = $status; + + return $this; + } + + /** + * Get status + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + /** + * Set bookmark + * + * @param boolean $bookmark + * @return Entry + */ + public function setBookmark($bookmark) + { + $this->bookmark = $bookmark; + + return $this; + } + + /** + * Get bookmark + * + * @return boolean + */ + public function getBookmark() + { + return $this->bookmark; + } + + /** + * Set fetched + * + * @param boolean $fetched + * @return Entry + */ + public function setFetched($fetched) + { + $this->fetched = $fetched; + + return $this; + } + + /** + * Get fetched + * + * @return boolean + */ + public function getFetched() + { + return $this->fetched; + } + + /** + * @return Collection + */ + public function getTags() + { + return $this->tags; + } + + /** + * @param Collection $tags + */ + public function setTags($tags) + { + $this->tags = $tags; + } + + /** + * @return User + */ + public function getUser() + { + return $this->user; + } + + /** + * @param User $user + */ + public function setUser($user) + { + $this->user = $user; + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/Entity/PluginOption.php b/src/Wallabag/Bundle/CoreBundle/Entity/PluginOption.php new file mode 100644 index 0000000..61e88aa --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Entity/PluginOption.php @@ -0,0 +1,94 @@ +id; + } + + /** + * Set name + * + * @param string $name + * @return PluginOption + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set value + * + * @param string $value + * @return PluginOption + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/Entity/Tag.php b/src/Wallabag/Bundle/CoreBundle/Entity/Tag.php new file mode 100644 index 0000000..ce24b36 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Entity/Tag.php @@ -0,0 +1,64 @@ +id; + } + + /** + * Set value + * + * @param string $value + * @return Tag + */ + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * Get value + * + * @return string + */ + public function getValue() + { + return $this->value; + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/Entity/User.php b/src/Wallabag/Bundle/CoreBundle/Entity/User.php new file mode 100644 index 0000000..1cf8a66 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Entity/User.php @@ -0,0 +1,223 @@ +id; + } + + + /** + * @return string + */ + public function getPreferredLocale() + { + return $this->preferredLocale; + } + + /** + * @param string $preferredLocale + */ + public function setPreferredLocale($preferredLocale) + { + $this->preferredLocale = $preferredLocale; + } + + /** + * @return string + */ + public function getApiToken() + { + return $this->apiToken; + } + + /** + * @param string $apiToken + */ + public function setApiToken($apiToken) + { + $this->apiToken = $apiToken; + } + + /** + * @return string + */ + public function getAuthGoogleToken() + { + return $this->authGoogleToken; + } + + /** + * @param string $authGoogleToken + */ + public function setAuthGoogleToken($authGoogleToken) + { + $this->authGoogleToken = $authGoogleToken; + } + + /** + * @return string + */ + public function getAuthMozillaToken() + { + return $this->authMozillaToken; + } + + /** + * @param string $authMozillaToken + */ + public function setAuthMozillaToken($authMozillaToken) + { + $this->authMozillaToken = $authMozillaToken; + } + + /** + * @return string + */ + public function getFeedToken() + { + return $this->feedToken; + } + + /** + * @param string $feedToken + */ + public function setFeedToken($feedToken) + { + $this->feedToken = $feedToken; + } + + /** + * @return int + */ + public function getItemsPerPage() + { + return $this->itemsPerPage; + } + + /** + * @param int $itemsPerPage + */ + public function setItemsPerPage($itemsPerPage) + { + $this->itemsPerPage = $itemsPerPage; + } + + /** + * @return string + */ + public function getItemsSortingDirection() + { + return $this->itemsSortingDirection; + } + + /** + * @param string $itemsSortingDirection + */ + public function setItemsSortingDirection($itemsSortingDirection) + { + $this->itemsSortingDirection = $itemsSortingDirection; + } + + /** + * @return string + */ + public function getTheme() + { + return $this->theme; + } + + /** + * @param string $theme + */ + public function setTheme($theme) + { + $this->theme = $theme; + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/Repository/ConfigRepository.php b/src/Wallabag/Bundle/CoreBundle/Repository/ConfigRepository.php new file mode 100644 index 0000000..f76eda7 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Repository/ConfigRepository.php @@ -0,0 +1,15 @@ + + + + + + diff --git a/src/Wallabag/Bundle/CoreBundle/Resources/doc/index.rst b/src/Wallabag/Bundle/CoreBundle/Resources/doc/index.rst new file mode 100644 index 0000000..e69de29 diff --git a/src/Wallabag/Bundle/CoreBundle/Resources/translations/messages.fr.xlf b/src/Wallabag/Bundle/CoreBundle/Resources/translations/messages.fr.xlf new file mode 100644 index 0000000..fd59e6c --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Resources/translations/messages.fr.xlf @@ -0,0 +1,11 @@ + + + + + + Symfony2 is great + J'aime Symfony2 + + + + diff --git a/src/Wallabag/Bundle/CoreBundle/Resources/views/Default/index.html.twig b/src/Wallabag/Bundle/CoreBundle/Resources/views/Default/index.html.twig new file mode 100644 index 0000000..4ce626e --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello {{ name }}! diff --git a/src/Wallabag/Bundle/CoreBundle/Tests/Controller/DefaultControllerTest.php b/src/Wallabag/Bundle/CoreBundle/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 0000000..1ed69b2 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/hello/Fabien'); + + $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); + } +} diff --git a/src/Wallabag/Bundle/CoreBundle/WallabagCoreBundle.php b/src/Wallabag/Bundle/CoreBundle/WallabagCoreBundle.php new file mode 100644 index 0000000..6b672f4 --- /dev/null +++ b/src/Wallabag/Bundle/CoreBundle/WallabagCoreBundle.php @@ -0,0 +1,9 @@ +