www.webdeveloper.com
Results 1 to 5 of 5

Thread: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTIO

Threaded View

  1. #1
    Join Date
    Apr 2013
    Posts
    3

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTIO

    Hello

    When I run this command-bash-3.2 $ php magmi.cli.php-mode = update-profile = default SSH to import a csv file Magento products in my shop I get this message:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/17/10622317/html/magmi/inc/magmi_loggers.php on line 4
    PHP Code:
    <?php 
    class FileLogger
    {
    protected 
    $_fname;

    public function 
    __construct($fname=null)
    {
    if(
    $fname==null)
    {
    $fname=Magmi_StateManager::getProgressFile(true);
    }
    $this->_fname=$fname;
    $f=fopen($this->_fname,"w");
    if(
    $f==false)
    {
    throw new 
    Exception("CANNOT WRITE PROGRESS FILE ");
    }
    fclose($f);
    }

    public function 
    log($data,$type)
    {

    $f=fopen($this->_fname,"a");
    if(
    $f==false)
    {
    throw new 
    Exception("CANNOT WRITE PROGRESS FILE ");
    }
    $data=preg_replace ("/(\r|\n|\r\n)/""<br>"$data);
    fwrite($f,"$type:$data\n");
    fclose($f);
    }

    }

    class 
    EchoLogger
    {
    public function 
    log($data,$type)
    {
    $info=explode(";",$type);
    $type=$info[0];
    echo(
    '<p class="logentry log_'.$type.'">'.$data."</p>");
    }

    }
    class 
    CLILogger
    {
    public function 
    log($data,$type)
    {
    echo(
    "$type:$data\n");
    }
    }
    ?>
    Last edited by NogDog; 04-18-2013 at 04:28 PM. Reason: added [php] tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles