Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Created robots foundation and component for managing how search
Browse files Browse the repository at this point in the history
engines are handled.
  • Loading branch information
michaelchisari authored and The Appleseed Project committed Oct 17, 2010
1 parent 3fc1c0d commit afb9f15
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
48 changes: 48 additions & 0 deletions components/robots/controllers/robots.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* @version $Id$
* @package Appleseed.Components
* @subpackage Robots
* @copyright Copyright (C) 2004 - 2010 Michael Chisari. All rights reserved.
* @link http://opensource.appleseedproject.org
* @license GNU General Public License version 2.0 (See LICENSE.txt)
*/

// Restrict direct access
defined( 'APPLESEED' ) or die( 'Direct Access Denied' );

/** Robots Component Controller
*
* Robots Component Controller Class
*
* @package Appleseed.Components
* @subpackage Robots
*/
class cRobotsRobotsController extends cController {

/**
* Constructor
*
* @access public
*/
public function __construct ( ) {
parent::__construct( );
}

public function Display ( $pView = null, $pData = array ( ) ) {
header('Content-Type: text/plain');

echo "
User-agent: *
# Disable crawling all user profiles.
# User will have option to opt in to searches in later versions.
Disallow: /profile/
";

// Must exist so language and debugging info doesn't get output.
exit;
}

}
2 changes: 2 additions & 0 deletions components/robots/robots.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
; Enabled by default
enabled="true"
32 changes: 32 additions & 0 deletions components/robots/robots.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* @version $Id$
* @package Appleseed.Components
* @subpackage Robots
* @copyright Copyright (C) 2004 - 2010 Michael Chisari. All rights reserved.
* @link http://opensource.appleseedproject.org
* @license GNU General Public License version 2.0 (See LICENSE.txt)
*/

// Restrict direct access
defined( 'APPLESEED' ) or die( 'Direct Access Denied' );

/** Robots Component
*
* Robots Component Entry Class
*
* @package Appleseed.Components
* @subpackage Robots
*/
class cRobots extends cComponent {

/**
* Constructor
*
* @access public
*/
public function __construct ( ) {
parent::__construct();
}

}
3 changes: 3 additions & 0 deletions foundations/default/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ routes[/admin/system/logs/]="admin/system/logs.php"
routes[/admin/system/maintenance/]="admin/system/maintenance.php"
routes[/admin/system/update/]="admin/system/update.php"

[system]
routes[robots.txt]="/system/robots.php"

; Pages route should be last, to catch anything that wasn't already caught.
;routes[(.*)]="/pages/pages.php"

1 change: 1 addition & 0 deletions foundations/default/system/robots.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php $zApp->Components->Go ( "robots" ); ?>

0 comments on commit afb9f15

Please sign in to comment.