Skip to content

Commit

Permalink
debug save directory missing /
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsbrugs committed Mar 16, 2017
1 parent 2d3800a commit eb168d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions example/test.php
Expand Up @@ -12,8 +12,9 @@
// $urls = PrerenderSpa::get_sitemap_urls(__DIR__ . '/../data/sitemap.xml');

$urls = [
'https://hugo.maugey.fr/developeur-web/HTML5',
'https://hugo.maugey.fr'
// 'https://hugo.maugey.fr/developeur-web/HTML5',
// 'https://hugo.maugey.fr',
'https://hugo.maugey.fr/contact'
];

error_log(print_r($urls, true));
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -20,7 +20,7 @@ use Hug\PrerenderSpa\PrerenderSpa as PrerenderSpa;

## Usage

### First Step : Generate Your Webpage Snapshots
### First Step : Generate Your Webpages Snapshots
```php
$prerender_url = 'http://123.123.123.123:3000/';
$prerender_auth = 'USER:PASSWORD'; // or null
Expand Down
5 changes: 2 additions & 3 deletions src/Hug/PrerenderSpa/PrerenderSpa.php
Expand Up @@ -83,7 +83,7 @@ public function prerender()
// PrerenderSpa::archive_snapshot($filename)

# Save snapshot
file_put_contents($this->output . 'snapshots' . $url_file, $html);
file_put_contents($this->output . 'snapshots' . DIRECTORY_SEPARATOR . $url_file, $html);
}

# Add execution time to report
Expand Down Expand Up @@ -112,8 +112,7 @@ private function take_snapshot($url, $key)
try
{
$ch = curl_init($url);

curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

Expand Down

0 comments on commit eb168d4

Please sign in to comment.