<?php
namespace Atarashii\APIBundle\Controller;

use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Controller\Annotations as Rest;
use Atarashii\APIBundle\Parser\AnimeParser;

class AnimeController extends FOSRestController
{
    /**
     * Anime get action
     * @var integer $id Id of the anime
     * @return array
     *
     * @Rest\View()
     */
	public function getAction($id)
	{
		#http://myanimelist.net/anime/#{id}

		$downloader = $this->get('atarashii_api.communicator');
		$animedetails = $downloader->fetch('/anime/' . $id);

 		$anime = AnimeParser::parse($animedetails);

 		return $anime;
	}
}
<?php
namespace Atarashii\APIBundle\Controller;

use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Controller\Annotations as Rest;
use Symfony\Component\HttpFoundation\Request;
use Atarashii\APIBundle\Parser\AnimeParser;

class AnimeController extends FOSRestController
{
    /**
     * Anime get action
     * @var integer $id Id of the anime
     * @return array
     *
     * @Rest\View()
     */
	public function getAction($id, Request $request)
	{
		#http://myanimelist.net/anime/#{id}

		$usepersonal = (int) $request->query->get('mine');

		$downloader = $this->get('atarashii_api.communicator');

		if($usepersonal) {
			//get the credentials we received
			$username = $this->getRequest()->server->get('PHP_AUTH_USER');
			$password = $this->getRequest()->server->get('PHP_AUTH_PW');

			//Don't bother making a request if the user didn't send any authentication
			if($username == null) {
				$view = $this->view(Array('error' => 'unauthorized'), 401);
				$view->setHeader('WWW-Authenticate', 'Basic realm="myanimelist.net"');
				return $view;
			}

			$downloader->cookieLogin($username, $password);
		}

		$animedetails = $downloader->fetch('/anime/' . $id);

 		$anime = AnimeParser::parse($animedetails);

 		return $anime;
	}
}
Add Personal Details in Anime Details If Requested
Add Personal Details in Anime Details If Requested

Support for the mine=1 request on anime is complete. If mine=1 is added
on the API request URL, it’ll try to grab the login info and then have
the communicator do a cookie login to MAL before fetching the anime
details.
