Difference between revisions of "Php"

From neil.tappsville.com
Jump to navigationJump to search
m
m
Line 25: Line 25:
 
Wierd quirk on the dashboard where links in the Availability Map or World Map do not go to devices.
 
Wierd quirk on the dashboard where links in the Availability Map or World Map do not go to devices.
 
Instead of <code>https://librenms/device/device=2/</code>  the url is <code>https://librenms/@deviceUrl($device)</code>  
 
Instead of <code>https://librenms/device/device=2/</code>  the url is <code>https://librenms/@deviceUrl($device)</code>  
Turns out that librenms uses a php module called Laravel which essentially caches/stashes values in a a hidden form, sometimes the cache needs to be cleared (n.b a restart of httpd nor a reboot of the host fixed this) - magical fix is <code>php artisan view:clear</code>
+
 
 +
Librenms uses a php module called Laravel which essentially caches/stashes values in a a hidden form, sometimes the cache needs to be cleared (n.b a restart of httpd nor a reboot of the host fixed this) - magical fix is <code>php artisan view:clear</code>
  
 
Found: https://codeburst.io/just-in-case-laravel-create-custom-blade-directive-b60a7160949d
 
Found: https://codeburst.io/just-in-case-laravel-create-custom-blade-directive-b60a7160949d

Revision as of 22:55, 9 February 2020

PHP Scripts

Proxy an image from a local system that requires authorisation, such as a internal Security DVR, no proxy required. Save this image.php and wa-la

<?php
$temp = file''get''contents('http://user:password@host.com/cgi-bin/guest/Video.cgi?media=JPEG');
header("content-type: image/jpeg");
echo ($temp);
?>

BBClone

As the developers say 'A PHP based Web Counter on Steroids', this is what I used to use to count unique vistors on the main site Unfortunately it fell out of favour - its must easier to get google to do this for you.

To upgrade to a newer version.

  • Copy all files except /var
  • Then reconfigure conf/config.php

Librenms

Wierd quirk on the dashboard where links in the Availability Map or World Map do not go to devices. Instead of https://librenms/device/device=2/ the url is https://librenms/@deviceUrl($device)

Librenms uses a php module called Laravel which essentially caches/stashes values in a a hidden form, sometimes the cache needs to be cleared (n.b a restart of httpd nor a reboot of the host fixed this) - magical fix is php artisan view:clear

Found: https://codeburst.io/just-in-case-laravel-create-custom-blade-directive-b60a7160949d