Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ $javaClass = new JavaClass(
| max_stack_exceeded | integer | 9999 | オペレーションを最大何回実行できるかを指定します。 | JavaClass |
| max_execution_time | integer | 30 | 最大実行時間を指定します。 | JavaClass |
| strict | boolean | true | このオプションが `true` の場合、 PHPJava はメソッド、変数などを厳格に評価し実行します。 `false` の場合は、曖昧に評価して実行します。. | Both |
| preload | boolean | false | このオプションが `true` の場合、 Jar 実行時に定義されている JavaClass を予めメモリ上にマッピング(プリロード)させることにより、処理速度が向上させます。ただし、この機能が有効である場合、 Jar が巨大であると メモリを多く消費します。また、それ以外の場合は、必要に応じてクラスを遅延ロードします。 | JavaArchive |
| validation.method.arguments_count_only | boolean | false | このオプションが `true` の場合、 クラス解決をして、メソッドを呼び出す際に、引数の数のみを比較します。 | JavaClass |
| operations.enable_trace | boolean | false | このオプションが `true` の場合、 PHPJava はオペレーションの実行ログを記録します。 | JavaClass |
| operations.temporary_code_stream | string | php://memory | 実行用のバイトコードの一時保存先を指定します。 | JavaClass |
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ $javaClass = new JavaClass(
| max_stack_exceeded | integer | 9999 | Execute more than the specified number of times be stopped the operation. | JavaClass |
| max_execution_time | integer | 30 | Maximum execution time. | JavaClass |
| strict | boolean | true | When `true`, PHPJava calls a method, variables, and so on strictly; otherwise, it calls them ambiguously. | Both |
| preload | boolean | false | When `true`, PHPJava pre-reads JavaClasses when emulating JAR. This may consume larger size of memory depending on the size of the JAR file; otherwise, JavaArchive defers loading. | JavaArchive |
| validation.method.arguments_count_only | boolean | false | When `true`, ClassResolver validates arguments by their number only. | JavaClass |
| operations.enable_trace | boolean | false | When `true`, PHPJava stores the operation history. | JavaClass |
| operations.temporary_code_stream | string | php://memory | Operation code will be output to temporary stream. Change this if your code is heavy so you'll be happy. | JavaClass |
Expand Down
1 change: 0 additions & 1 deletion src/Core/JVM/Parameters/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ final class Runtime
const MAX_STACK_EXCEEDED = 9999;
const MAX_EXECUTION_TIME = 5;
const STRICT = true;
const PRELOAD = false;
const DRY_RUN_ATTRIBUTE = false;

const OPERATIONS_ENABLE_TRACE = false;
Expand Down
18 changes: 3 additions & 15 deletions src/Core/JavaArchive.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace PHPJava\Core;

use PHPJava\Core\JVM\Parameters\GlobalOptions;
use PHPJava\Core\JVM\Parameters\Runtime;
use PHPJava\Core\Stream\Reader\InlineReader;
use PHPJava\Exceptions\UndefinedEntrypointException;
Expand Down Expand Up @@ -102,20 +101,9 @@ function ($fileName) {
continue;
}
$classPath = str_replace('/', '.', $className);
if (!($this->options['preload'] ?? GlobalOptions::get('preload') ?? Runtime::PRELOAD)) {
$this->classes[$classPath] = new JavaClassDeferredLoader(
InlineReader::class,
[$className, $code],
$this->options
);
continue;
}

$this->classes[$classPath] = new JavaClass(
new InlineReader(
$className,
$code
),
$this->classes[$classPath] = new JavaClassDeferredLoader(
InlineReader::class,
[$className, $code],
$this->options
);
}
Expand Down