Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    226
    Thanks
    68
    Thanked 2 Times in 2 Posts

    php.net Phar::decompress - is this an error?

    PHP: Phar::decompress - Manual

    This is the code from the Example #1:

    Code:
    <?php
    $p = new Phar('/path/to/my.phar', 0, 'my.phar.gz');
    $p['myfile.txt'] = 'hi';
    $p['myfile2.txt'] = 'hi';
    $p3 = $p2->decompress(); // creates /path/to/my.phar
    ?>
    I am not understanding the $p2 part. It was not set before and it is used there for the first time? I am not sure what would be in it and where would be coming from.

    Thanks.

  2. #2
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    5,395
    Thanks
    22
    Thanked 551 Times in 545 Posts
    That's clearly a typo.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  3. #3
    Regular Coder
    Join Date
    Jul 2011
    Posts
    226
    Thanks
    68
    Thanked 2 Times in 2 Posts
    Ok, so basically something like:

    Code:
    $p2 = $p->decompress();
    would / could be a correct version of that?

  4. #4
    Master Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    5,395
    Thanks
    22
    Thanked 551 Times in 545 Posts
    does it work that way?
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  5. #5
    Regular Coder
    Join Date
    Jul 2011
    Posts
    226
    Thanks
    68
    Thanked 2 Times in 2 Posts
    I am not sure. I was not getting into this. I am not sure if I need to install Phar or something like that. I don't need Phar, I am just going over the whole php.net, learning and I came across that.


 

Tags for this Thread

Posting Permissions

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