Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6193503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:07:54+00:00 2026-05-24T03:07:54+00:00

I been testing is_mobile(): if (Agent::is_mobile()) { $content = View::factory(‘mobile\viewname’); } else { $content

  • 0

I been testing is_mobile():

if (Agent::is_mobile())
{
    $content = View::factory('mobile\viewname');
}
else
{
    $content = View::factory('standard\viewname');
}

PHP profiler reports it taking up 2.25MB (after subtracting not using is_mobile() function in app) to return a true or false.

my browscap.cache file size is 433KB , is there plans to make this function take up less memory to do its checks? right now, I had to remove this function as it was just adding too much memory to my app.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:07:55+00:00Added an answer on May 24, 2026 at 3:07 am

    The best solution is to configure PHP to use the browscap file, through php.ini (http://www.php.net/manual/en/misc.configuration.php#ini.browscap), which would allow the Agent class to use get_browser().

    If that’s not possible, the Agent class allows you to simulate this function, and fetch the browscap file itself. As Jelmer said, you can replace this file by the light version by changing the configured URL.

    However, by default this file is only fetched once a week. After fetching it’s parsed, optimized, and cached locally. To be able to do a lookup, this cache file needs to be loaded, which can account for the memory usage you see. It’s not kept in memory, so you should only see the memory usage if you check memory_get_peak_usage().

    The result of a lookup is cached as well, so the next time the same browser comes along, the information is retrieved from cache, and the browscap cache is not loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been testing out the performance and memory profiler AQTime to see if it's
I've just been testing some PHP files with simpletest and found out thatit won't
I have been testing out some code and I need to load day view
I've been testing a PHP script that I'm posting values to every few seconds
I been testing Telerik Sitefinity CMS. I noticed drag and drop content blocks on
I've been testing an application using my machine as a server, and everything's going
As I have been testing sites, I have found reCAPTCHA s getting more and
I've been using WatiN as a testing tool for my current project. Besides the
I've been trying to implement unit testing and currently have some code that does
I have been using CPPUnit as a unit testing framework and am now trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.