No such file or directory in Session.php on line 132

Please report bugs here!

Moderator: Thorsten

Post Reply
bruno36
Posts: 5
Joined: Sat Aug 15, 2009 8:47 am
Location: france
Contact:

No such file or directory in Session.php on line 132

Post by bruno36 »

Bonjour!
Since the update to 2.0.9 phpMyFAQ phpMyFAQ 2.5.1 I had an error message when I look at an article
http://www.scooter-chinois-4t.com/Doc/i ... artlang=fr

phpMyFAQ warning [2]: file_put_contents(./data/tracking15082009) [function.file-put-contents]: failed to open stream: No such file or directory in Session.php on line 132

Code: Select all

    /**
     * Tracks the user and log what he did
     * 
     * @param   string
     * @param   integer
     * @return  void
     * @since   2001-02-18
     * @since   Bastian Poettner <bastian@poettner.net>
     * @author  Thorsten Rinne <thorsten@phpmyfaq.de>
     * @author  Matteo Scaramuccia <matteo@phpmyfaq.de>
     * @author  Marco Fester <webmaster@marcof.de>
     */
    public function userTracking($action, $id = 0)
    {
        global $sid, $user, $botBlacklist;

        $faqconfig = PMF_Configuration::getInstance();
        
        if ($faqconfig->get('main.enableUserTracking')) {

            $bots  = 0;
            $agent = $_SERVER['HTTP_USER_AGENT'];
            $sid   = PMF_Filter::filterInput(INPUT_GET, PMF_GET_KEY_NAME_SESSIONID, FILTER_VALIDATE_INT);
            $sidc  = PMF_Filter::filterInput(INPUT_COOKIE, PMF_COOKIE_NAME_SESSIONID, FILTER_VALIDATE_INT);
            
            if (!is_null($sidc)) {
                $sid = $sidc;
            }
            if ($action == "old_session") {
                $sid = null;
            }

            foreach ($botBlacklist as $bot) {
                if (strpos($agent, $bot)) {
                    $bots++;
                }
            }
            if (0 == $bots) {
                if (!isset($sid)) {
                    $sid = $this->db->nextID(SQLPREFIX."faqsessions", "sid");
                    // Sanity check: force the session cookie to contains the current $sid
                    if (!is_null($sidc) && (!$sidc != $sid)) {
                        self::setCookie($sid);
                    }

                    $query = sprintf("
                        INSERT INTO 
                            %sfaqsessions
                        (sid, user_id, ip, time)
                            VALUES
                        (%d, %d, '%s', %d)",
                        SQLPREFIX,
                        $sid,
                        ($user ? $user->getUserId() : -1),
                        $_SERVER["REMOTE_ADDR"],
                        $_SERVER['REQUEST_TIME']
                    );
                    $this->db->query($query);
                }

                $data = $sid.';' . 
                        str_replace(';', ',', $action) . ';' . 
                        $id . ';' . 
                        $_SERVER['REMOTE_ADDR'] . ';' . 
                        str_replace(';', ',', $_SERVER['QUERY_STRING']) . ';' . 
                        str_replace(';', ',', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '') . ';' . 
                        str_replace(';', ',', urldecode($_SERVER['HTTP_USER_AGENT'])) . ';' . 
                        $_SERVER['REQUEST_TIME'] . ";\n";
                $file = './data/tracking'.date('dmY');
                file_put_contents($file, $data, FILE_APPEND);
            }
        }
    }

    /**
     * Returns the timestamp of a session
     *
     * @param  integer $sid Session ID
     * @return integer
     * @since  2007-03-31
     * @author Thorsten Rinne <thorsten@phpmyfaq.de>
     */
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: No such file or directory in Session.php on line 132

Post by Thorsten »

Hi,

did you delete the data/ folder?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply