The online racing simulator
Parse error
Hi!
I tried to run PRISM on my VPS by hand. I downloaded it and then executed php PHPInSimMod.php. I get:
Quote :php PHPInSimMod.php

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /root/prism/Dygear-PRISM-12942d8/modules/prism_packets.php on line 271

Any help?
In test version (branch current) line is 273.
Quote from misiek08 :Hi!
I tried to run PRISM on my VPS by hand. I downloaded it and then executed php PHPInSimMod.php. I get:Any help?
In test version (branch current) line is 273.

That's odd, because there is no double colon on that line. Post that line here.
There is. I don't have source on my computer but it's line inside foreach(....plugins as $plugin) .....console($plugin::NAME, $plugin::VERSION). Something like that. It's near the 273 line. Maybe 271.
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /modules/prism_packets.php on line 271

Your reporting this error, so it's in prism_packets, I've not touched that file in ... months. But you seem to be reporting a problem within the PHPInSimMod.php, but that makes no sense because that's no where the error is coming from. So please, execute the file like so from the command line:

php PHPInSimMod.php > dev.log

Take what ever output you get to the console, and copy it to a file called con.log. Upload both the dev.log file, and the con.log file here. You can copy the console output quickly by right clicking in the console and then selecting select all from the list, then press enter. From there Open a new file in notepad and press Ctrl+V to past the contents of your clipboard there. Save the file as con.log and upload with the dev.log file here.
I know how to export errors from script. Here you have the dev.log contents:
Quote :Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /root/prism/Dygear-PRISM-12942d8/PHPInSimMod.php on line 271

I'm running it on Debian Lenny.
#6 - filur
Quote from misiek08 :I tried to run PRISM

I believe PRISM is written for PHP >= 5.3.0.

Quote from http://www.php.net/manual/en/language.oop5.constants.php :As of PHP 5.3.0, it's possible to reference the class using a variable.

Quote from PHPInSimMod.php:271 :[...] $plugin::NAME, $plugin::VERSION, [...]

So the question is, are you using PHP >= 5.3.0 ?
Epic fail. 5.2.6 now. I'll try to run on 5.3.0
Big, epic fail. I upgraded PHP by dotdeb entries in sources.list and..... PRISM is working. Damn. Thanks filur.
Quote from filur :I believe PRISM is written for PHP >= 5.3.0.

That's correct! Clearly stated in the README file. Thanks for the help filur!
I have next problem.
I have singleton class for DB:

<?php 

php

require_once('settings.class.php');

class 
DB extends PDO {

    private static 
$instance NULL;
    private 
$prefix;

    static public function 
gi() {
        if (
self::$instance == NULL) {
            try {
                
$settings Settings::getInstance();
                
$settings->import('ltwt.ini');
                
$settings $settings->settings;
                
self::$instance = new DB($settings['host'], $settings['user'], $settings['pass'], $settings['name'], $settings['prefix']);
                
self::$instance->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_WARNING);
            } catch (
PDOException $e) {
                die(
'Error while connecting to DB: ' $e->getMessage());
            }
        }
        return 
self::$instance;
    }

    public function 
__construct($host$user$pass$name$prefix '') {
        
$this->prefix $prefix;
        
parent::__construct('mysql:dbname=' $name ';host=' $host$user$pass);
    }

    public function 
exec($query$file false$line false) {
        
$query str_replace('{{table}}'$this->prefix$query);
        return 
parent::exec($query);
    }

    public function 
query($query) {
        
$query str_replace('{{table}}'$this->prefix$query);

        return 
parent::query($query);
    }

    public function 
prepare($query) {
        
$query str_replace('{{table}}'$this->prefix$query);
        return 
parent:[:p]repare($query);
    }

}
?>

It's showing me unexcepted T_SL error. Why? PHP version 5.3.3. OS: Windows.
On linux it's working ok.
I checked through the list of tokens the PHP parser uses, and T_SL is <<, but as I did not see one in your file, I think you might be having a sync problem between these two locations. What I would do is make sure that the files are the same by copying the linux version (the working version) into your windows version and see if that fixes the error.
I copied from Windows to Linux and it's working. So the file on Windows it's good. Phucking Windows.

FGED GREDG RDFGDR GSFDG