diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e57be95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.onion +vendor diff --git a/onion.phar b/onion.phar index d742cec..5c9dd08 100755 Binary files a/onion.phar and b/onion.phar differ diff --git a/scripts/compile.sh b/scripts/compile.sh index 62dbfef..77083e5 100755 --- a/scripts/compile.sh +++ b/scripts/compile.sh @@ -1,3 +1,8 @@ #!/bin/bash -# ./onion.phar compile --lib src --lib ../CLIFramework/src --lib ../GetOptionKit/src --classloader --bootstrap scripts/onion.embed --executable --compress=bz2 --output onion.phar -./scripts/onion -d compile --lib src --lib ../CLIFramework/src --lib ../GetOptionKit/src --classloader --bootstrap scripts/onion.embed --executable --output onion.phar +./scripts/onion -d compile \ + --lib src \ + --lib vendor/pear \ + --classloader \ + --bootstrap scripts/onion.embed \ + --executable \ + --output onion.phar diff --git a/scripts/onion b/scripts/onion index e36411e..f058011 100755 --- a/scripts/onion +++ b/scripts/onion @@ -10,7 +10,7 @@ * */ -require '../Universal/src/Universal/ClassLoader/SplClassLoader.php'; +require __DIR__ . '/../vendor/pear/Universal/ClassLoader/SplClassLoader.php'; $classLoader = new \Universal\ClassLoader\SplClassLoader(array( 'Onion' => 'src', 'CLIFramework' => 'vendor/pear', diff --git a/src/Onion/Command/CompileCommand.php b/src/Onion/Command/CompileCommand.php index 361a5f9..9bbd96d 100644 --- a/src/Onion/Command/CompileCommand.php +++ b/src/Onion/Command/CompileCommand.php @@ -136,19 +136,7 @@ function execute($arguments) } else { $classloader_file = 'Universal/ClassLoader/SplClassLoader.php'; - $classloader_path = stream_resolve_include_path($classloader_file); - if( ! $classloader_path ) { - $classloader_path = stream_resolve_include_path( 'phar://onion.phar/' . $classloader_file); - } - - if( ! $classloader_path ) { - die($classloader_file . ' not found.'); - } - - // try to resolve in current phar executable - $content = php_strip_whitespace($classloader_path); - $phar->addFromString($classloader_file,$content); $stub .=<<<"EOT" require 'phar://$pharFile/$classloader_file'; \$classLoader = new \\Universal\\ClassLoader\\SplClassLoader; diff --git a/src/Onion/Downloader/CurlDownloader.php b/src/Onion/Downloader/CurlDownloader.php index f31d4ec..c868653 100644 --- a/src/Onion/Downloader/CurlDownloader.php +++ b/src/Onion/Downloader/CurlDownloader.php @@ -1,6 +1,8 @@ 'src', + 'CLIFramework' => 'vendor/pear', + 'GetOptionKit' => 'vendor/pear', 'TestApp' => 'tests', 'Pyrus' => '/Users/c9s/git/others/php/pyrus/Pyrus/src', ));