Skip to content
Permalink
Browse files

[license] add mit license and reformat source code and add comments

  • Loading branch information...
David EPELY
David EPELY committed Jul 3, 2012
1 parent 8c25905 commit 51c2e52c450018042ecf6cc5d2c5fd9fbbdd3387
@@ -1,15 +1,26 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
* Provides action to render sitemap files
*
* @author David Epely <depely@prestaconcept.net>
*/
class SitemapController extends Controller
{
/**
* list sitemaps
*
@@ -21,19 +32,18 @@ class SitemapController extends Controller
*/
public function indexAction()
{
$sitemapindex = $this->get('presta_sitemap.generator')->fetch('root');
if(!$sitemapindex) {
$sitemapindex = $this->get('presta_sitemap.generator')->fetch('root');
if (!$sitemapindex) {
throw $this->createNotFoundException();
}
$response = Response::create($sitemapindex->toXml());
$response = Response::create($sitemapindex->toXml());
//TODO: set http cache
return $response;
}
/**
* list urls of a section
*
@@ -42,15 +52,15 @@ public function indexAction()
*/
public function sectionAction($name)
{
$section = $this->get('presta_sitemap.generator')->fetch($name);
if(!$section) {
$section = $this->get('presta_sitemap.generator')->fetch($name);
if (!$section) {
throw $this->createNotFoundException();
}
$response = Response::create($section->toXml());
$response = Response::create($section->toXml());
//TODO: set http cache
return $response;
}
}
@@ -1,5 +1,13 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
@@ -12,6 +20,7 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
@@ -1,5 +1,13 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -14,6 +22,7 @@
*/
class PrestaSitemapExtension extends Extension
{
/**
* {@inheritDoc}
*/
@@ -22,7 +31,7 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');
}
}
@@ -1,26 +1,39 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\Event;
use Symfony\Component\EventDispatcher\Event;
use Presta\SitemapBundle\Service\Generator;
/**
* Manage populate event
*
* @author depely
*/
class SitemapPopulateEvent extends Event
{
const onSitemapPopulate = 'presta_sitemap.populate';
protected $generator;
public function __construct(Generator $generator)
{
$this->generator = $generator;
}
protected $generator;
public function __construct(Generator $generator)
{
$this->generator = $generator;
}
/**
* @return Generator
*/
public function getGenerator()
{
return $this->generator;
}
public function getGenerator()
{
return $this->generator;
}
}
@@ -1,5 +1,15 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\Exception;
/**
* Base Exception for Sitemap
*
@@ -1,5 +1,13 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\Exception;
/**
@@ -1,5 +1,13 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\Exception;
/**
@@ -1,5 +1,13 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle\Exception;
/**
19 LICENSE
@@ -0,0 +1,19 @@
Copyright (c) 2012, Prestaconcept

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.
@@ -1,9 +1,25 @@
<?php
/*
* This file is part of the prestaSitemapPlugin package.
* (c) David Epely <depely@prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Presta\SitemapBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Bundle that provides tools to render application sitemap according to
* sitemap protocol. @see http://www.sitemaps.org/
* @see README.md for basic usage
*
* @author depely
*/
class PrestaSitemapBundle extends Bundle
{
}

0 comments on commit 51c2e52

Please sign in to comment.
You can’t perform that action at this time.