SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru quenting's Avatar
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    735
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    file_get_contents timeout

    Is there anyway I can set up my own timeout parameter when calling the file_get_contents method ?
    The largest message boards on the web !
    unblog.fr, hosting 700000 french blogs

  2. #2
    SitePoint Zealot shenkong's Avatar
    Join Date
    Sep 2004
    Location
    China
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    function abc($filename$time 3600) {
        
    set_time_limit($time);
        return 
    file_get_contents($filename);
    }
    abc("a.txt"); 

  3. #3
    SitePoint Guru quenting's Avatar
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    735
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mmmm, i thought set_time_limit was to define the script execution time.
    Can you use it to set a function execution time ? Also, I use set_time_limit to define how long my overall script can run, doesn't using it in a function overwrite the value i set for my script ?

    more or less my question is whether set_time_limit affects a value with a scope of the script or with the scope of the block it runs in.
    Thanks anyway for your input.
    The largest message boards on the web !
    unblog.fr, hosting 700000 french blogs


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •