완료

PHP Class to mirror a single page of a website

I need a php class that will mirror a url that is provided to it and save it on the local server. For example:

$mirror = new MirrorUrl();

$mirror->setUrl("[url removed, login to view]");

$mirror->setSavePath("/home/cricava/public_html/pages/curl");

$mirror->download();

This class will

a) download the file ([url removed, login to view]) and save it to the local directory specified.

b) will then crawl through the file and download any links that are required, such as css files, javascript files and images. It should then save these images in the same folder structure and if nescessary, rewrite the html page ([url removed, login to view]) so that it links to these files saved to the server.

## Deliverables

I need a php class that will mirror a url that is provided to it and save it on the local server. For example:

$mirror = new MirrorUrl();

$mirror->setUrl("[url removed, login to view]");

$mirror->setSavePath("/home/cricava/public_html/pages/curl");

$mirror->download();

This class will

a) download the file ([url removed, login to view]) and save it to the local directory specified.

b) will then crawl through the file and download any links that are required, such as css files, javascript files and images. It should then save these images, css and js files in the same folder structure and if nescessary, rewrite the html page ([url removed, login to view]) so that it links to these files saved to the server for js, css and images. Any links to other pages should be re-written so that they are fully qualified with a host (so that if you click it you will be taken back to the actual website).

The class should use libcurl in PHP to get the contents of the webpage.

Requirements

a. If a URL has some 'GET' parameters then the class should rename the resulting file so that it works fine on the server. For example if the URL is "[url removed, login to view]" then the class should save the file as "[url removed, login to view]"

b. The class should check if files exist before writing them to the local server. If they exist the class should rename them with a random name and update the html file to point to this.

c. The class needs the following public functions

i. setUrl - set the url to be downloaded

ii. setSavePath - set the local path to save the page too

iii. getSavedFileName - return the filename of the page (for example in (b) above the file name would be [url removed, login to view]

iv. exec - download the files from the remote server to the local and return true or false

v. getError - return a text message with the error encountered. (if any)

d. The class should chmod the file so that it is editable by other PHP functions

e. Any links to other HTML pages within the downloaded HTML pages should be rewritten to include the fully qualified path. That is: if a page has a menu link of "[url removed, login to view]", and the URL of the page is [url removed, login to view], then the link should be rewritten as [url removed, login to view] and be saved in the download html page ([url removed, login to view])

f. If a webpage has iframes or frames, the contents of the iframes/frames **should** be saved to the local server automatically and the same set of rules should be applied (as above). However, if the page is just linking to other pages on the website, such as in the menu, these pages should **not** be saved locally and simply linked as in (e).

**Non-functional requirements

**

a. The code must be readable and follow readability standards

b. All function, variable names should be labelled clearly, with a name that describes their purpose

c. Code should be fully commented for future modifications

d. The code should be a class that uses cURL and an XML parser (if required) that is freely avaliable and supported by shared hosts. (cUrl is already installed on my server)

기술: 공학, MySQL, PHP, 프로젝트 관리, 소프트웨어 아키텍처, 소프트웨어 테스팅, 웹 호스팅, 웹사이트 관리, 웹사이트 테스팅, XML

확대 보기: writing function rules, writing frames, writing a javascript class, writing a check example, url rewrite software, shared variable, rentacoder com name, remote html css, mirror writing, local 44.org, home page for any website, download css from a website, contents of writing, contents of a will, www programs download com, xml parser, website url rewrite, shared folder, path to, mirror

고용주 소개:
( 3건의 리뷰 ) Melbourne, Australia

프로젝트 ID: #3769869

수상자:

redphx

See private message.

$51 USD (30일 이내)
(42건의 리뷰)
4.4

이 프로젝트의 입찰 현황은 다음과 같습니다. 입찰자: 6명, 평균 입찰가: $65

byteworx

See private message.

$77.35 USD (30일 이내)
(26 리뷰)
5.9
danielribeiro

See private message.

$42.5 USD (30일 이내)
(113 리뷰)
5.6
swisscheesevw

See private message.

$85 USD (30일 이내)
(4 리뷰)
3.3
DmitriyN

See private message.

$85 USD (30일 이내)
(10 리뷰)
2.6
sgeorgievvw

See private message.

$46.75 USD (30일 이내)
(0 리뷰)
0.0