diff --git a/develnext-bundles/dn-sql-bundle/src/.data/img/develnext/bundle/sql/sdMemory16.png b/develnext-bundles/dn-sql-bundle/src/.data/img/develnext/bundle/sql/sdMemory16.png new file mode 100644 index 00000000..2615d959 Binary files /dev/null and b/develnext-bundles/dn-sql-bundle/src/.data/img/develnext/bundle/sql/sdMemory16.png differ diff --git a/develnext-bundles/dn-sql-bundle/src/vendor/develnext.bundle.sql.SqlBundle/bundle/sql/SqlClient.php b/develnext-bundles/dn-sql-bundle/src/vendor/develnext.bundle.sql.SqlBundle/bundle/sql/SqlClient.php index 5ca0cc9e..9085cfc9 100644 --- a/develnext-bundles/dn-sql-bundle/src/vendor/develnext.bundle.sql.SqlBundle/bundle/sql/SqlClient.php +++ b/develnext-bundles/dn-sql-bundle/src/vendor/develnext.bundle.sql.SqlBundle/bundle/sql/SqlClient.php @@ -34,6 +34,11 @@ abstract class SqlClient extends AbstractScript */ public $catchErrors = true; + /** + * @var int + */ + public $transactionIsolation = 0; + /** * @return SqlConnection */ @@ -58,6 +63,8 @@ public function open() { if (!$this->isOpened()) { $this->client = $this->buildClient(); + $this->client->transactionIsolation = $this->getTransactionIsolation(); + $this->closed = false; $this->trigger('open'); } @@ -129,6 +136,66 @@ public function rollback() $this->client->rollback(); } + /** + * @param string $name + * @return string + * + * @throws SqlException + */ + public function identifier($name) + { + return $this->client->identifier($name); + } + + /** + * See SqlConnection::TRANSACTION_* constants. + * + * @return int + */ + public function getTransactionIsolation() + { + return $this->transactionIsolation; + } + + /** + * @param int $value + */ + public function setTransactionIsolation($value) + { + $this->transactionIsolation = $value; + + if ($this->client) { + $this->client->transactionIsolation = $value; + } + } + + /** + * @non-getter + * @return array + */ + public function getCatalogs() + { + return $this->client->getCatalogs(); + } + + /** + * @non-getter + * @return array + */ + public function getMetaData() + { + return $this->client->getMetaData(); + } + + /** + * @non-getter + * @return array + */ + public function getSchemas() + { + return $this->client->getSchemas(); + } + public function __destruct() { if ($this->isOpened()) { diff --git a/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/SqliteBundle.php b/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/SqliteBundle.php index 2102b62a..dc9224a5 100644 --- a/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/SqliteBundle.php +++ b/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/SqliteBundle.php @@ -20,10 +20,9 @@ function getName() function getDescription() { - return "Пакет для работы с базой данных SQLite"; + return "Пакет для работы с базой данных SQLite 3"; } - public function isAvailable(Project $project) { return true; diff --git a/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteClientComponent.xml b/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteClientComponent.xml index d4f5d6cd..f8678835 100644 --- a/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteClientComponent.xml +++ b/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteClientComponent.xml @@ -3,6 +3,7 @@ + @@ -10,6 +11,15 @@ + + + NONE + READ_UNCOMMITTED + READ_COMMITTED + REPEATABLE_READ + SERIALIZABLE + + diff --git a/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteStorageComponent.php b/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteStorageComponent.php index dd4626ef..f30b5fa8 100644 --- a/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteStorageComponent.php +++ b/develnext-bundles/dn-sqlite-bundle/src/develnext/bundle/sql/components/SqliteStorageComponent.php @@ -22,7 +22,7 @@ public function getName() public function getIcon() { - return 'develnext/bundle/sql/storage16.png'; + return 'develnext/bundle/sql/sdMemory16.png'; } public function getIdPattern() diff --git a/develnext-bundles/dn-sqlite-bundle/src/vendor/develnext.bundle.sql.SqliteBundle/bundle/sql/SqliteClient.php b/develnext-bundles/dn-sqlite-bundle/src/vendor/develnext.bundle.sql.SqliteBundle/bundle/sql/SqliteClient.php index 51c142c0..b4c6b284 100644 --- a/develnext-bundles/dn-sqlite-bundle/src/vendor/develnext.bundle.sql.SqliteBundle/bundle/sql/SqliteClient.php +++ b/develnext-bundles/dn-sqlite-bundle/src/vendor/develnext.bundle.sql.SqliteBundle/bundle/sql/SqliteClient.php @@ -22,6 +22,11 @@ class SqliteClient extends SqlClient */ public $options = []; + function __construct() + { + $this->setTransactionIsolation(SqlConnection::TRANSACTION_SERIALIZABLE); + } + /** * @return SqlConnection */ diff --git a/develnext/misc/history.txt b/develnext/misc/history.txt index a5de95d6..1591c355 100644 --- a/develnext/misc/history.txt +++ b/develnext/misc/history.txt @@ -12,7 +12,8 @@ Patch-A - Исправлена проблема, когда css стиль проекта применялся не ко всем компонентам в редакторе форм. - Исправлен баг с неверными подсказками для класса Mouse. - Доработано автодополнение для переменных и для определения их типа. -- Исправлен баг singleton модулей, она создавались дважды в некоторых случаях. +- Исправлен баг singleton модулей, они создавались дважды в некоторых случаях. +- Добавлена возможность кешировать сцены не уничтожая их в поведении "Игровая сцена". Beta-3 ------------ diff --git a/develnext/misc/library/bundles/dn-sql-bundle/dn-sql-bundle.jar b/develnext/misc/library/bundles/dn-sql-bundle/dn-sql-bundle.jar index 464aaf59..e6d34f33 100644 Binary files a/develnext/misc/library/bundles/dn-sql-bundle/dn-sql-bundle.jar and b/develnext/misc/library/bundles/dn-sql-bundle/dn-sql-bundle.jar differ diff --git a/develnext/misc/library/bundles/dn-sql-bundle/jphp-sql-ext.jar b/develnext/misc/library/bundles/dn-sql-bundle/jphp-sql-ext.jar index 181aa9f1..184e814b 100644 Binary files a/develnext/misc/library/bundles/dn-sql-bundle/jphp-sql-ext.jar and b/develnext/misc/library/bundles/dn-sql-bundle/jphp-sql-ext.jar differ diff --git a/develnext/misc/library/bundles/dn-sqlite-bundle/dn-sqlite-bundle.jar b/develnext/misc/library/bundles/dn-sqlite-bundle/dn-sqlite-bundle.jar index eb7d3d6a..33724493 100644 Binary files a/develnext/misc/library/bundles/dn-sqlite-bundle/dn-sqlite-bundle.jar and b/develnext/misc/library/bundles/dn-sqlite-bundle/dn-sqlite-bundle.jar differ diff --git a/develnext/misc/library/projects/SQLiteDatabase.zip.resource b/develnext/misc/library/projects/SQLiteDatabase.zip.resource index 01d63772..c2814714 100644 --- a/develnext/misc/library/projects/SQLiteDatabase.zip.resource +++ b/develnext/misc/library/projects/SQLiteDatabase.zip.resource @@ -1,3 +1,3 @@ #Fri Jun 17 15:39:48 MSK 2016 name=SQLiteDatabase -description=Пример работы с базой SQLite. +description=Пример работы с базой SQLite 3. diff --git a/develnext/src/.system/application.conf b/develnext/src/.system/application.conf index adbe3163..c3479bb2 100644 --- a/develnext/src/.system/application.conf +++ b/develnext/src/.system/application.conf @@ -1,7 +1,7 @@ # MAIN CONFIGURATION app.name = DevelNext -app.version = 2016 beta-3 +app.version = 2016 beta-3 (patched-a) app.hash = 2016061312 app.uuid = app.implicitExit = 0 diff --git a/develnext/src/ide/behaviour/spec/GameSceneBehaviourSpec.xml b/develnext/src/ide/behaviour/spec/GameSceneBehaviourSpec.xml index 6f554470..5795890b 100644 --- a/develnext/src/ide/behaviour/spec/GameSceneBehaviourSpec.xml +++ b/develnext/src/ide/behaviour/spec/GameSceneBehaviourSpec.xml @@ -22,5 +22,7 @@ Влево + + \ No newline at end of file diff --git a/jphp-app-framework/src/behaviour/custom/GameSceneBehaviour.php b/jphp-app-framework/src/behaviour/custom/GameSceneBehaviour.php index 1759873b..0cd78d1e 100644 --- a/jphp-app-framework/src/behaviour/custom/GameSceneBehaviour.php +++ b/jphp-app-framework/src/behaviour/custom/GameSceneBehaviour.php @@ -38,6 +38,11 @@ class GameSceneBehaviour extends AbstractBehaviour */ public $gravityDirection = 'DOWN'; + /** + * @var bool + */ + public $cacheScenes = false; + /** * @var UXGameScene */ @@ -48,6 +53,11 @@ class GameSceneBehaviour extends AbstractBehaviour */ protected $layout; + /** + * @var AbstractForm[] + */ + protected $loadedScenes = []; + public function getSort() { @@ -98,38 +108,64 @@ public function loadScene($name) $this->scene->pause(); $this->scene->clear(); - if ($this->layout) { + if ($this->layout && !$this->cacheScenes) { $this->layout->children->clear(); } /** @var AbstractForm $previousForm */ static $previousForm = null; - if ($previousForm) { + if ($previousForm && !$this->cacheScenes) { $previousForm->free(); } - $form = $previousForm = app()->getNewForm($name, null, false, false, true); + $form = null; + $cashed = false; + + if ($this->cacheScenes) { + if ($form = $this->loadedScenes[$name]) { + $cashed = true; + } + } + + if (!$form) { + $form = app()->getNewForm($name, null, false, false, true); + } + + $previousForm = $form; $form->layout->data('--game-scene', $this); $layout = $form->layout; if ($this->_target instanceof UXWindow) { - $form->makeVirtualLayout(); + if (!$cashed) { + $form->makeVirtualLayout(); + } + $this->_target->layout = $layout; - $form->loadBindings(); - $form->loadBehaviours(); - $form->loadClones(); + + if (!$cashed) { + $form->loadBindings(); + $form->loadBehaviours(); + $form->loadClones(); + } } elseif ($this->_target instanceof UXGamePane) { $this->_target->loadArea($layout); - $form->loadBindings(); - $form->loadBehaviours(); - $form->loadClones(); + + if (!$cashed) { + $form->loadBindings(); + $form->loadBehaviours(); + $form->loadClones(); + } $layout->requestFocus(); } + if ($this->cacheScenes) { + $this->loadedScenes[$name] = $form; + } + $this->layout = $layout; if ($this->autoplay) { diff --git a/jphp-app-framework/src/php/gui/framework/Application.php b/jphp-app-framework/src/php/gui/framework/Application.php index a8c15362..c9a64eb4 100644 --- a/jphp-app-framework/src/php/gui/framework/Application.php +++ b/jphp-app-framework/src/php/gui/framework/Application.php @@ -172,6 +172,7 @@ public function getUserHome() /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function minimizeForm($name) { @@ -185,6 +186,7 @@ public function minimizeForm($name) /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function restoreForm($name) { @@ -199,6 +201,7 @@ public function restoreForm($name) * @param $name * @param UXForm $origin * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function getForm($name, UXForm $origin = null) { @@ -213,6 +216,7 @@ public function getForm($name, UXForm $origin = null) * @param $name * @param UXForm|null $origin * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function getOriginForm($name, UXForm $origin = null) { @@ -230,6 +234,7 @@ public function getOriginForm($name, UXForm $origin = null) * @param bool $loadBehaviours * @param bool $cache * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function getNewForm($name, UXForm $origin = null, $loadEvents = true, $loadBehaviours = true, $cache = true) { @@ -260,6 +265,7 @@ public function getNewForm($name, UXForm $origin = null, $loadEvents = true, $lo /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function showForm($name) { @@ -279,6 +285,7 @@ public function showForm($name) /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function showFormAndWait($name) { @@ -294,6 +301,7 @@ public function showFormAndWait($name) /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function showNewForm($name) { @@ -309,6 +317,7 @@ public function showNewForm($name) /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function showNewFormAndWait($name) { @@ -321,6 +330,7 @@ public function showNewFormAndWait($name) /** * @param $name * @return AbstractForm + * @return-dynamic app\forms\$0 */ public function hideForm($name) { diff --git a/jphp-gui-ext/src/main/resources/JPHP-INF/sdk/php/gui/UXWindow.php b/jphp-gui-ext/src/main/resources/JPHP-INF/sdk/php/gui/UXWindow.php index 265caf79..19b22e09 100644 --- a/jphp-gui-ext/src/main/resources/JPHP-INF/sdk/php/gui/UXWindow.php +++ b/jphp-gui-ext/src/main/resources/JPHP-INF/sdk/php/gui/UXWindow.php @@ -9,11 +9,6 @@ * Class UXWindow * @package php\gui * - * @property double $x - * @property double $y - * @property double $width - * @property double $height - * @property double $opacity * @property bool $focused */ abstract class UXWindow @@ -25,6 +20,31 @@ abstract class UXWindow */ public $scene; + /** + * @var double + */ + public $x; + + /** + * @var double + */ + public $y; + + /** + * @var double + */ + public $width; + + /** + * @var double + */ + public $height; + + /** + * @var double + */ + public $opacity = 1.0; + /** * --RU-- * Размеры [width, height]