gaffling / PHP-Grab-Favicon

🖼 Saves the favicon of the given URL and returns the image path.
http://suchmaschine.biz
MIT License
26 stars 6 forks source link

How to change the Save Path and Filename of the Favicons? #2

Closed raitman005 closed 1 year ago

raitman005 commented 4 years ago

Hello, What if i want to use the file location dir of the favicon instead of the domain name on saving the file, where do i change it in the file? domain/favicon href value.png

gaffling commented 4 years ago

Hello raitman005,

thanks for getting in touch. The filename is generated in line 119:

$filePath = preg_replace('#\/\/#', '/', $directory.'/'.$domain.'.png');

there you can change it in what you like, but if you will save the favicon image in a subfolder don't forget to mkdir() it before you save ;-)

Best Regards

raitman005 commented 4 years ago

Is there a reason why i receive 504 gateway timeout error whenever i tried to fetch 50 favicon icons?

LeeThompson commented 1 year ago

With #5 I'm implementing a switch to allow setting the local path (--path or -p).

LeeThompson commented 1 year ago

With the current version you can set the path on the command line with --path=PATH (Can be absolute or relative). In web-mode there isn't an easy method (yet), you'll need to edit the PHP and change the define('DEFAULT_LOCAL_PATH', "./"); to the path you want to use.

If you don't want to change it there, change: setConfiguration("files","local_path",DEFAULT_LOCAL_PATH); to setConfiguration("files","local_path","your path");

gaffling commented 1 year ago

@LeeThompson You fixed this already, so I close this