Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove FOSRest

  • Loading branch information...
commit 0ad0e76b1ae57f52c62938b7c5d3c0a334571457 1 parent d94cd61
@mbontemps mbontemps authored
View
1  app/AppKernel.php
@@ -23,7 +23,6 @@ public function registerBundles()
new Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
- // new FOS\RestBundle\FOSRestBundle(),
new FOS\UserBundle\FOSUserBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Knp\IpsumBundle\KnpIpsumBundle(),
View
5 app/config/config.yml
@@ -91,11 +91,6 @@ stof_doctrine_extensions:
default:
timestampable: true
-# fos_rest:
-# handlers:
-# - knp_ipsum.normalizer.datetime
-# - fos_rest.get_set_method_normalizer
-
fos_user:
db_driver: orm
firewall_name: fos_user
View
4 deps
@@ -112,10 +112,6 @@
git=http://github.com/FriendsOfSymfony/FOSUserBundle.git
target=/bundles/FOS/UserBundle
-[FOSRestBundle]
- git=http://github.com/FriendsOfSymfony/FOSRestBundle.git
- target=/bundles/FOS/RestBundle
-
[pagerfanta]
git=http://github.com/whiteoctober/Pagerfanta.git
View
1  deps.lock
@@ -27,7 +27,6 @@ KnpMenuBundle ad44889edc68fce494a84f74156e9a8ba2fedf7c
gedmo-doctrine-extensions 26299d6dd0a56199cb0271a8ea914675e98e12cc
DoctrineExtensionsBundle ef47aa2d130d912acc6f3ec4afa34b733f2a9583
FOSUserBundle 6cdd9c292afa219ef799893061eaae1fc400ae33
-FOSRestBundle 98b7f1888df36ff964a34633d7045a5f35e8cbb0
pagerfanta 62bc2c0a90480c8b4f0eb4d634e6fce0338282aa
WhiteOctoberPagerfantaBundle cad15aec34031e5e7c118c2974106dad5f7b2d68
behat 11fe7dbf454d5d0bc714951aa8a1c429447a31c1
View
22 src/Knp/IpsumBundle/Controller/FOSRestController.php
@@ -1,22 +0,0 @@
-<?php
-
-namespace Knp\IpsumBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-
-class FOSRestController extends Controller
-{
- public function indexAction()
- {
- $view = $this->get('fos_rest.view');
- /* @var $view \FOS\RestBundle\View\View */
-
- $em = $this->get('doctrine')->getEntityManager();
- $things = $em->getRepository('KnpIpsumBundle:TimedThing')->findAll();
-
- $view->setTemplate('KnpIpsumBundle:FOSRest:index.html.twig');
- $view->setParameters(array('things' => $things));
-
- return $view->handle();
- }
-}
View
31 src/Knp/IpsumBundle/Features/FOSRest.feature
@@ -1,31 +0,0 @@
-Feature: FOS Rest
- In order to support different outpus with single view
- As a Symfony2 developer
- I need to be able to use FOSRestBundle
-
- Background:
- Given there are 3 timed things in database
-
- Scenario: There is a "FOSRestBundle" link on home page
- Given I am on "/"
- Then I should see "FOSRestBundle"
-
- Scenario: User clicks "FOSRestBundle" link on home page
- Given I am on "/"
- When I follow "FOSRestBundle"
- Then I should see "Simple page using FOSRestBundle"
-
- Scenario: User sees 3 things in html format
- Given I am on "/"
- When I follow "FOSRestBundle"
- Then I should see "Lorem #0"
- And should see "Lorem #1"
- And should see "Lorem #2"
-
- Scenario: User sees 3 things in json format
- Given I am on "/"
- When I follow "FOSRestBundle"
- And follow "JSON"
- Then the response should contain "\"name\":\"Lorem #0\""
- And the response should contain "\"name\":\"Lorem #1\""
- And the response should contain "\"name\":\"Lorem #2\""
View
3  src/Knp/IpsumBundle/Resources/config/routing.yml
@@ -40,9 +40,6 @@ knp_ipsum_swiftmailer:
knp_ipsum_gedmo_extensions:
resource: "@KnpIpsumBundle/Resources/config/routing/gedmo_extensions.yml"
-knp_ipsum_fos_rest:
- resource: "@KnpIpsumBundle/Resources/config/routing/fos_rest.yml"
-
knp_ipsum_fos_user:
resource: "@KnpIpsumBundle/Resources/config/routing/fos_user.yml"
View
4 src/Knp/IpsumBundle/Resources/config/routing/fos_rest.yml
@@ -1,4 +0,0 @@
-knp_ipsum_fos_rest:
- pattern: /fos-rest.{_format}
- defaults: { _controller: KnpIpsumBundle:FOSRest:index, _format: html }
- requirements: { _format: html|json }
View
25 src/Knp/IpsumBundle/Resources/views/FOSRest/index.html.twig
@@ -1,25 +0,0 @@
-{% extends "KnpIpsumBundle::layout.html.twig" %}
-
-{% block title "FOSRestBundle Tutorial" %}
-
-{% block content %}
- <h1>Simple page using FOSRestBundle</h1>
-
- <p>
- FOSRestBundle allows to support easily different out put formats
- by keeping the controller format-agnostic. The same controller
- is used to output the list of things in
- <a href="{{ path('knp_ipsum_fos_rest', {'_format':'json'}) }}">JSON</a>.
- </p>
- {% if things %}
- <ul>
- {% for thing in things %}
- <li>* {{ thing.name }}</li>
- {% endfor %}
- </ul>
- {% else %}
- <p>− There are no things yet!</p>
- {% endif %}
-{% endblock %}
-
-{% set code = code(_self) %}
View
1  src/Knp/IpsumBundle/Resources/views/Summary/index.html.twig
@@ -13,7 +13,6 @@
<li><a href="{{ url('knp_ipsum_pagerfanta') }}">Pagerfanta</a> &rarr; How to use Pagerfanta to paginate your results</a></li>
<li><a href="{{ url('knp_ipsum_secured') }}">Security</a> &rarr; How to secure an action and create a login page</li>
<li><a href="{{ url('knp_ipsum_avalanche_imagine') }}">AvalancheImagineBundle</a> &rarr; How to apply effects like thumbnails to your images</li>
- <li><a href="{{ url('knp_ipsum_fos_rest') }}">FOSRestBundle</a> &rarr; How to support different output format easily</a></li>
<li><a href="{{ url('knp_ipsum_assetic') }}">AsseticBundle</a> &rarr; How to easily apply filters to your CSS and images</a></li>
<li><a href="{{ url('knp_ipsum_swiftmailer') }}">SwiftmailerBundle</a> &rarr; How to send emails</a></li>
<li><a href="{{ url('knp_ipsum_doctrine_odm') }}">Doctrine ODM [MongoDB]<sup>New!</sup></a> &rarr; How to work with Doctrine ODM</a></li>
View
54 src/Knp/IpsumBundle/Serializer/Normalizer/DateTimeNormalizer.php
@@ -1,54 +0,0 @@
-<?php
-
-/*
- * This file is part of the FOSRestBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Knp\IpsumBundle\Serializer\Normalizer;
-
-use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer;
-
-/**
- * This Normalizer turns the DateTime classes into strings
- *
- * @author John Wards <johnwards@gmail.com>
- */
-class DateTimeNormalizer extends SerializerAwareNormalizer
-{
- /**
- * {@inheritdoc}
- */
- public function normalize($object, $format = null)
- {
- return array('timestamp' => $object->format('U'));
- }
-
- /**
- * {@inheritdoc}
- */
- public function denormalize($data, $class, $format = null)
- {
- throw new \BadMethodCallException('Not supported');
- }
-
- /**
- * {@inheritdoc}
- */
- public function supportsNormalization($data, $format = null)
- {
- return $data instanceof \DateTime;
- }
-
- /**
- * {@inheritdoc}
- */
- public function supportsDenormalization($data, $type, $format = null)
- {
- return false;
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.