-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
igor
committed
Feb 20, 2016
1 parent
e2c83bb
commit 3f9f9f2
Showing
6 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2016, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\SitemapBundle\Exception; | ||
|
||
/** | ||
* Base exception | ||
*/ | ||
class DarvinSitemapException extends \Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2016, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\SitemapBundle\Generator; | ||
|
||
use Darvin\SitemapBundle\Exception\DarvinSitemapException; | ||
|
||
/** | ||
* Sitemap generator exception | ||
*/ | ||
class GeneratorException extends DarvinSitemapException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2016, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\SitemapBundle\Generator; | ||
|
||
use Darvin\SitemapBundle\Url\SitemapUrlProviderInterface; | ||
|
||
/** | ||
* Sitemap generator | ||
*/ | ||
class SitemapGenerator implements SitemapGeneratorInterface | ||
{ | ||
/** | ||
* @var \Darvin\SitemapBundle\Url\SitemapUrlProviderInterface[] | ||
*/ | ||
private $urlProviders; | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->urlProviders = array(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function addUrlProvider(SitemapUrlProviderInterface $urlProvider) | ||
{ | ||
$class = get_class($urlProvider); | ||
|
||
if (isset($this->urlProviders[$class])) { | ||
throw new GeneratorException(sprintf('Sitemap URL provider "%s" already added to sitemap generator.', $class)); | ||
} | ||
|
||
$this->urlProviders[$class] = $urlProvider; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function generateSitemap() | ||
{ | ||
// TODO: Implement generateSitemap() method. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2016, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\SitemapBundle\Generator; | ||
|
||
use Darvin\SitemapBundle\Url\SitemapUrlProviderInterface; | ||
|
||
/** | ||
* Sitemap generator | ||
*/ | ||
interface SitemapGeneratorInterface | ||
{ | ||
/** | ||
* @param \Darvin\SitemapBundle\Url\SitemapUrlProviderInterface $urlProvider Sitemap URL provider | ||
*/ | ||
public function addUrlProvider(SitemapUrlProviderInterface $urlProvider); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function generateSitemap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2016, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\SitemapBundle\Url; | ||
|
||
/** | ||
* Sitemap URL provider | ||
*/ | ||
interface SitemapUrlProviderInterface | ||
{ | ||
/** | ||
* @return \Darvin\SitemapBundle\Url\SitemapUrl[] | ||
*/ | ||
public function getSitemapUrls(); | ||
} |