Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload and findById options were added, test class for extracting bro…
…wser name and version and the test HTML and CSV output data was greatly improved. Modified lib/document.php * findById: Added an options hash so that parameters like the watermark and preview can be provided. * upload: Added an options hash for parameters like "download_document" and "download_pdf". Modified lib/event.php * findAll: Removed the deprecated "m=find" parameter. Added test/browser_info.php * New class that parses out the browser type from a User-Agent property. Modified test/index.html * Added options to the "upload" command for "secure", "download_pdf" and "download_document". * Added options to the "load" command for "included_pages" and the watermark label. Modified test/test.php * domain: New function that returns the domain of the service URL so that it can be applied to the Javascript class. * load_command, upload_command: Added parameter options as per the new interfaces. * event_load_csv: Improved the order of extracted data, added a short user agent and the duration value. * event_load_html: Improved the order of extracted data and added a short user agent.
- Loading branch information
Showing
5 changed files
with
121 additions
and
33 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
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,52 @@ | ||
<?php | ||
|
||
/* | ||
Loads up browser information. | ||
*/ | ||
class BrowserInfo | ||
{ | ||
private $name = null; | ||
private $agent = null; | ||
private $version = null; | ||
|
||
/* | ||
Returns the name of the browser. | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/* | ||
Returns the version of the browser. | ||
*/ | ||
public function getVersion() | ||
{ | ||
return $this->version; | ||
} | ||
|
||
/* | ||
Constructor. Loads a user agent or grabs the local version. | ||
*/ | ||
public function __construct($userAgent = null) | ||
{ | ||
$browsers = array("firefox", "msie", "opera", "chrome", "safari", | ||
"mozilla", "seamonkey", "konqueror", "netscape", | ||
"gecko", "navigator", "mosaic", "lynx", "amaya", | ||
"omniweb", "avant", "camino", "flock", "aol"); | ||
|
||
$this->agent = strtolower($userAgent); | ||
|
||
foreach($browsers as $browser) | ||
{ | ||
if (preg_match("#($browser)[/ ]?([0-9.]*)#", $this->agent, $match)) | ||
{ | ||
$this->name = $match[1]; | ||
$this->version = $match[2]; | ||
break; | ||
} | ||
} | ||
$this->AllowsHeaderRedirect = !($this->name == "msie" && $this->version < 7); | ||
} | ||
} | ||
?> |
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