| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/robots.tar |
directive.php 0000666 00000001234 15111705551 0007240 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Robots;
/**
* Class Directive
*/
class Directive {
/**
* Paths list.
*
* @var array $paths All paths affected by this directive.
*/
private $paths;
/**
* Sets up the path array
*/
public function __construct() {
$this->paths = [];
}
/**
* Adds a path to the directive path list.
*
* @param string $path A path to add in the path list.
*
* @return void
*/
public function add_path( $path ) {
if ( ! \in_array( $path, $this->paths, true ) ) {
$this->paths[] = $path;
}
}
/**
* Returns all paths.
*
* @return array
*/
public function get_paths() {
return $this->paths;
}
}
user-agent.php 0000666 00000003377 15111705551 0007346 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Robots;
/**
* Class Directive
*/
class User_Agent {
/**
* The user agent identifier.
*
* @var string $user_agent
*/
private $user_agent;
/**
* All directives that are allowed for this user agent.
*
* @var \Yoast\WP\SEO\Values\Robots\Directive $allow_directive
*/
private $allow_directive;
/**
* All directives that are disallowed for this user agent.
*
* @var \Yoast\WP\SEO\Values\Robots\Directive $disallow_directive
*/
private $disallow_directive;
/**
* Constructor of the user agent value object.
*
* @param string $user_agent The user agent identifier.
*/
public function __construct( $user_agent ) {
$this->user_agent = $user_agent;
$this->allow_directive = new Directive();
$this->disallow_directive = new Directive();
}
/**
* Gets the user agent identifier.
*
* @return string
*/
public function get_user_agent() {
return $this->user_agent;
}
/**
* Adds a path to the directive object.
*
* @param string $path The path to add to the disallow directive.
*
* @return void
*/
public function add_disallow_directive( $path ) {
$this->disallow_directive->add_path( $path );
}
/**
* Adds a path to the directive object.
*
* @param string $path The path to add to the allow directive.
*
* @return void
*/
public function add_allow_directive( $path ) {
$this->allow_directive->add_path( $path );
}
/**
* Gets all disallow paths for this user agent.
*
* @return array
*/
public function get_disallow_paths() {
return $this->disallow_directive->get_paths();
}
/**
* Gets all sallow paths for this user agent.
*
* @return array
*/
public function get_allow_paths() {
return $this->allow_directive->get_paths();
}
}
user-agent-list.php 0000666 00000003465 15111705551 0010315 0 ustar 00 <?php
namespace Yoast\WP\SEO\Values\Robots;
/**
* Class User_Agent_List
*/
class User_Agent_List {
/**
* The list of user agents.
*
* @var array $user_agent_list
*/
private $user_agent_list;
/**
* User Agent list constructor.
*/
public function __construct() {
$this->user_agent_list = [];
}
/**
* Checks if given user_agent is already registered.
*
* @param string $user_agent The user agent identifier.
*
* @return bool
*/
public function has_user_agent( $user_agent ) {
return \array_key_exists( $user_agent, $this->user_agent_list );
}
/**
* Gets the user agent object. If it is not yet registered it creates it.
*
* @param string $user_agent The user agent identifier.
*
* @return \Yoast\WP\SEO\Values\Robots\User_Agent
*/
public function get_user_agent( $user_agent ) {
if ( $this->has_user_agent( $user_agent ) ) {
return $this->user_agent_list[ $user_agent ];
}
$this->user_agent_list[ $user_agent ] = new User_Agent( $user_agent );
return $this->user_agent_list[ $user_agent ];
}
/**
* Gets the list of user agents.
*
* @return array
*/
public function get_user_agents() {
return $this->user_agent_list;
}
/**
* Gets a list of all disallow directives by user agent.
*
* @return array
*/
public function get_disallow_directives() {
$directives = [];
foreach ( $this->user_agent_list as $user_agent ) {
$directives[ $user_agent->get_user_agent() ] = $user_agent->get_disallow_paths();
}
return $directives;
}
/**
* Gets a list of all sallow directives by user agent.
*
* @return array
*/
public function get_allow_directives() {
$directives = [];
foreach ( $this->user_agent_list as $user_agent ) {
$directives[ $user_agent->get_user_agent() ] = $user_agent->get_allow_paths();
}
return $directives;
}
}
.htaccess 0000666 00000000424 15115106616 0006350 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>