-
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
1 parent
c5993c8
commit 035b4f6
Showing
4 changed files
with
32 additions
and
0 deletions.
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,2 @@ | ||
RewriteEngine On | ||
RewriteRule (.*) app.php?_=$1 [QSA,L] |
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,3 @@ | ||
# Sitemap | ||
|
||
Example usage of the XML sitemap component. |
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 | ||
use Coast\App, | ||
Coast\App\Request, | ||
Coast\App\Response, | ||
Coast\Sitemap; | ||
|
||
chdir(__DIR__); | ||
require 'vendor/autoload.php'; | ||
|
||
$app = new App(); | ||
$app->add(function(Request $req, Response $res) { | ||
$sitemap = new Sitemap(); | ||
$sitemap->add( | ||
new \Coast\Url('http://coastphp.com/'), | ||
new \DateTime(), | ||
Sitemap::CHANGES_WEEKLY, | ||
1 | ||
); | ||
return $res->xml($sitemap->xml()); | ||
}); | ||
|
||
$app->execute((new Request())->import())->export(); |
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,5 @@ | ||
<?php | ||
// Placeholder autoloader, allows the examples to work from the main library | ||
require '../../lib/Coast.php'; | ||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../lib'); | ||
spl_autoload_register(); |