Last active
August 29, 2015 14:03
-
-
Save kimikimi714/80d18f829b2377baff5a to your computer and use it in GitHub Desktop.
うまくいったpharファイル作成テスト。Hello.phpはhttps://gist.github.com/kimikimi714/cc9b503f09ecbdf0cb02 と同じで、make_phar.phpとopen_phar.phpを修正した。またスタブとしてhello直下にmain.phpをおいてる
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
#!/bin/bash | |
php -d phar.readonly=0 make_phar.php | |
php open_test.php |
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 | |
require_once __DIR__ . '/Hello.php'; |
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', FilesystemIterator::CURRENT_AS_FILEINFO, 'hello.phar'); | |
$phar->buildFromDirectory(__DIR__ . '/hello/'); | |
$phar->setStub($phar->createDefaultStub('main.php')); |
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 | |
require_once 'phar://' . __DIR__ . '/hello.phar'; | |
(new Hello())->sayHello(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment