PHP Class ElggRewriteTester, Elgg

Test if URL rewriting is working.
ファイルを表示 Open project: elgg/elgg Class Usage Examples

Protected Properties

Property Type Description
$htaccessIssue
$rewriteTestPassed
$serverSupportsRemoteRead
$webserver

Public Methods

Method Description
__construct ( ) Set the webserver as unknown.
createHtaccess ( string $url ) : boolean Create Elgg's .htaccess file or confirm that it exists
guessSubdirectory ( string $url ) : string | boolean Guess if url contains subdirectory or not.
guessWebServer ( ) : string Guess the web server from $_SERVER['SERVER_SOFTWARE']
run ( string $url, string $path ) : array Run the rewrite test and return a status array
runLocalhostAccessTest ( ) : boolean Check whether the site homepage can be fetched via curl
runRewriteTest ( string $url ) : boolean Hit the rewrite test URL to determine if the rewrite rules are working

Protected Methods

Method Description
returnStatus ( string $url ) : array Create the status array required by the ElggInstaller

Private Methods

Method Description
fetchUrl ( string $url ) : string Fetch a URL

Method Details

__construct() public method

Set the webserver as unknown.
public __construct ( )

createHtaccess() public method

Create Elgg's .htaccess file or confirm that it exists
public createHtaccess ( string $url ) : boolean
$url string URL of rewrite test
return boolean

guessSubdirectory() public method

Guess if url contains subdirectory or not.
public guessSubdirectory ( string $url ) : string | boolean
$url string Rewrite test URL
return string | boolean Subdirectory string with beginning and trailing slash or false if were unable to determine subdirectory or pointing at root of domain already

guessWebServer() public static method

Guess the web server from $_SERVER['SERVER_SOFTWARE']
public static guessWebServer ( ) : string
return string

returnStatus() protected method

Create the status array required by the ElggInstaller
protected returnStatus ( string $url ) : array
$url string Rewrite test URL
return array

run() public method

Run the rewrite test and return a status array
public run ( string $url, string $path ) : array
$url string URL of rewrite test
$path string Root directory of Elgg with trailing slash
return array

runLocalhostAccessTest() public method

Check whether the site homepage can be fetched via curl
public runLocalhostAccessTest ( ) : boolean
return boolean

runRewriteTest() public method

Hit the rewrite test URL to determine if the rewrite rules are working
public runRewriteTest ( string $url ) : boolean
$url string Rewrite test URL
return boolean

Property Details

$htaccessIssue protected_oe property

protected $htaccessIssue

$rewriteTestPassed protected_oe property

protected $rewriteTestPassed

$serverSupportsRemoteRead protected_oe property

protected $serverSupportsRemoteRead

$webserver protected_oe property

protected $webserver