GithubHelp home page GithubHelp logo

Local use about browser-detect HOT 21 CLOSED

hisorange avatar hisorange commented on June 8, 2024
Local use

from browser-detect.

Comments (21)

rcaf avatar rcaf commented on June 8, 2024

In my local copy of my application, I get almost all data, but the data version (major, minor, patch) are always zero, for browser and os.

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

hm! i dont have ip, browser ....

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

If you use L4.* then it has to work perfectly fine, if it isn't then check your permissions maybe the cache file is not readable? or look up the log.

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

no this is with laravel 5.1

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

send in a dump please.

var_dump($SERVER, YourBrowserDetectAlias::detect());

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

what is the Server variale?

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

object(hisorange\BrowserDetect\Result)#273 (1) { ["attributes":protected]=> array(17) { ["isMobile"]=> bool(false) ["isTablet"]=> bool(false) ["isDesktop"]=> bool(true) ["isBot"]=> bool(false) ["browserFamily"]=> string(25) "HiSoRange Generic Browser" ["browserVersionMajor"]=> int(0) ["browserVersionMinor"]=> int(0) ["browserVersionPatch"]=> int(0) ["osFamily"]=> string(20) "HiSoRange Generic OS" ["osVersionMajor"]=> int(0) ["osVersionMinor"]=> int(0) ["osVersionPatch"]=> int(0) ["deviceFamily"]=> string(0) "" ["deviceModel"]=> string(0) "" ["mobileGrade"]=> string(0) "" ["cssVersion"]=> int(0) ["javaScriptSupport"]=> bool(true) } }

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

Sorry meant $_SERVER, wrote at night.

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

Btw seems like the plugin does not getting the $_SERVER['HTTP_USER_AGENT'] string so try with

var_dump(YourBrowserDetect::detect($_SERVER['HTTP_USER_AGENT']);

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024
    <div class="col-sm-6">
        <div class="panel panel-primary">
            <div class="panel-heading">
                {{trans('news.news')}}
            </div>
            <div class="panel-body">
                <div class='container-fluid'>
                    {{var_dump(BrowserDetect::detect($_SERVER['HTTP_USER_AGENT']))}}
                </div>
            </div>
        </div>
    </div>

its the same result:
object(hisorange\BrowserDetect\Result)#272 (1) { ["attributes":protected]=> array(17) { ["isMobile"]=> bool(false) ["isTablet"]=> bool(false) ["isDesktop"]=> bool(true) ["isBot"]=> bool(false) ["browserFamily"]=> string(25) "HiSoRange Generic Browser" ["browserVersionMajor"]=> int(0) ["browserVersionMinor"]=> int(0) ["browserVersionPatch"]=> int(0) ["osFamily"]=> string(20) "HiSoRange Generic OS" ["osVersionMajor"]=> int(0) ["osVersionMinor"]=> int(0) ["osVersionPatch"]=> int(0) ["deviceFamily"]=> string(0) "" ["deviceModel"]=> string(0) "" ["mobileGrade"]=> string(0) "" ["cssVersion"]=> int(0) ["javaScriptSupport"]=> bool(true) } }

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

The "Generic Browser" is a replacment string for cases when the $_SERVER['HTTP_USER_AGENT'] is missing, so from this I guess you calling this through php built in server where the field is empty, if not then look into your environment cuz thats a generic header.

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

i searched but i dont know what i have to do! can you help me?

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

Please do this dump, with this I can see if it's your server config or your app setup is wrong.

file_put_contents('dump.txt', json_encode($_SERVER, BrowserDetect::detect(), config(), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));

After you call this, attach the dump.txt in your next comment here.

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

json_encode() expects at most 3 parameters, 4 given (View: C:\Users\lango\Desktop\fifapic\fifapic\resources\views\front\index.blade.php)

i'll try to fix it but i dont know what your parameters do

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

I did it in 3 lines and 3 files
Here the files:
dump1.txt
dump2.txt
dump.txt

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

Uhm sorry I should stop writing code at 4am XD Wanted to dump all the var at once with an array

file_put_contents('dump.txt', json_encode(array($_SERVER, BrowserDetect::detect(), config()), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));

like this, but it's good as you sent it.


So, what I can see is a weird dump: you using a normal dev server not a built in and the $_SERVER contains the UA string, also you are on windows so it can't be permission problem; Which means everything should work correctly but seems like the BD not even running a single plugin.


I have just pushed a new commit to the dev-master which will check if there is any problem with your plugin configuration and will throw an InvalidPluginListException. Please pull the newest version and tell me if you getting this error or not.

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

i removed the package and did a new download (i dont know another solution for force an update)
here the dump.txt but it seems to be the same.
dump.txt

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

To update to the current dev-master change your composer.json to

{
    "require": {
        "// other packages... this is just an example"
        "hisoranger/browser-detect": "dev-master"
    }
}

then run this.

composer update

This will pull the current dev-master branch.

from browser-detect.

Mastok1979 avatar Mastok1979 commented on June 8, 2024

i'm an idiot! :D
i saw it now and wanted to change my post. sorry.

dump.txt

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

Hmm this is getting problematic since my last guess was that your plugin setup isn't loading but with the current dev-master that is not possible to go through without any plugin.

Is this happening when you test is with other browsers like an old IE too?
Because maybe that you didn't activated the cache update and you still using the 2 year old cache in the pack?
There is a cache/Browscap folder in the plugin empty it please.

from browser-detect.

hisorange avatar hisorange commented on June 8, 2024

#76

from browser-detect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.