Last active
February 7, 2016 21:52
-
-
Save kimikimi714/cc9b503f09ecbdf0cb02 to your computer and use it in GitHub Desktop.
How to make valid phar file? (Hello.php puts in hello directory.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Hello { | |
public function sayHello() { | |
echo "hello\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$phar = new Phar('hello.phar', 0, 'hello.phar'); | |
$phar->buildFromDirectory(__DIR__ . '/hello'); | |
$phar->setDefaultStub(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
$file = (new PharFileInfo('phar://' . __DIR__ . '/hello.phar/hello/Hello.php'))->openFile(); | |
var_dump($file); | |
} catch (Exception $e) { | |
var_dump($e); | |
} |
I don't understand how to take the files from an updated plugin and make it into a .phar file on my server. Plz help
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an output when I executed open_phar.php.
_人人人人人人人人人人_
> RuntimeException <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y ̄