Skip to content

Commit

Permalink
Patch-A
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-s committed Jun 19, 2016
1 parent 3f8b0a9 commit f9bde15
Show file tree
Hide file tree
Showing 16 changed files with 171 additions and 21 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ abstract class SqlClient extends AbstractScript
*/
public $catchErrors = true;

/**
* @var int
*/
public $transactionIsolation = 0;

/**
* @return SqlConnection
*/
Expand All @@ -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');
}
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ function getName()

function getDescription()
{
return "Пакет для работы с базой данных SQLite";
return "Пакет для работы с базой данных SQLite 3";
}


public function isAvailable(Project $project)
{
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
<property code="file" value="example.db" />
<property code="autoOpen" value="1" />
<property code="catchErrors" value="1" />
<property code="transactionIsolation" value="8" />
</init>

<properties group="general">
<property code="file" name="Файл" editor="text" tooltip="Относительный или полный путь к файлу, значение :memory: для базы в памяти." />
<property code="autoOpen" name="Авто-открытие" editor="boolean" tooltip="Автоматически открывать базу при смене источника" />
<property code="options" name="Опции" editor="text" tooltip="Список опций, каждая опция на отдельной строке, формат как name=value" />
<property code="catchErrors" name="Игнорировать ошибки" editor="boolean" tooltip="Если опция включения, компонент не будет кидать исключения Exception" />
<property code="transactionIsolation" name="Тип транзакций" editor="enum" tooltip="Тип изоляции транзакций">
<variants>
<variant value="0">NONE</variant>
<variant value="1">READ_UNCOMMITTED</variant>
<variant value="2">READ_COMMITTED</variant>
<variant value="4">REPEATABLE_READ</variant>
<variant value="8">SERIALIZABLE</variant>
</variants>
</property>
</properties>

<eventTypes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class SqliteClient extends SqlClient
*/
public $options = [];

function __construct()
{
$this->setTransactionIsolation(SqlConnection::TRANSACTION_SERIALIZABLE);
}

/**
* @return SqlConnection
*/
Expand Down
3 changes: 2 additions & 1 deletion develnext/misc/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Patch-A
- Исправлена проблема, когда css стиль проекта применялся не ко всем компонентам в редакторе форм.
- Исправлен баг с неверными подсказками для класса Mouse.
- Доработано автодополнение для переменных и для определения их типа.
- Исправлен баг singleton модулей, она создавались дважды в некоторых случаях.
- Исправлен баг singleton модулей, они создавались дважды в некоторых случаях.
- Добавлена возможность кешировать сцены не уничтожая их в поведении "Игровая сцена".

Beta-3
------------
Expand Down
Binary file modified develnext/misc/library/bundles/dn-sql-bundle/dn-sql-bundle.jar
Binary file not shown.
Binary file modified develnext/misc/library/bundles/dn-sql-bundle/jphp-sql-ext.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Fri Jun 17 15:39:48 MSK 2016
name=SQLiteDatabase
description=Пример работы с базой SQLite.
description=Пример работы с базой SQLite 3.
2 changes: 1 addition & 1 deletion develnext/src/.system/application.conf
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions develnext/src/ide/behaviour/spec/GameSceneBehaviourSpec.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
<variant value="LEFT">Влево</variant>
</variants>
</property>

<property name="Кэшировать сцены" code="cacheScenes" editor="boolean" tooltip="Сохранять состояние ранее загруженных сцен не уничтожая их" />
</properties>
</behaviour>
56 changes: 46 additions & 10 deletions jphp-app-framework/src/behaviour/custom/GameSceneBehaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class GameSceneBehaviour extends AbstractBehaviour
*/
public $gravityDirection = 'DOWN';

/**
* @var bool
*/
public $cacheScenes = false;

/**
* @var UXGameScene
*/
Expand All @@ -48,6 +53,11 @@ class GameSceneBehaviour extends AbstractBehaviour
*/
protected $layout;

/**
* @var AbstractForm[]
*/
protected $loadedScenes = [];


public function getSort()
{
Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 10 additions & 0 deletions jphp-app-framework/src/php/gui/framework/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public function getUserHome()
/**
* @param $name
* @return AbstractForm
* @return-dynamic app\forms\$0
*/
public function minimizeForm($name)
{
Expand All @@ -185,6 +186,7 @@ public function minimizeForm($name)
/**
* @param $name
* @return AbstractForm
* @return-dynamic app\forms\$0
*/
public function restoreForm($name)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -279,6 +285,7 @@ public function showForm($name)
/**
* @param $name
* @return AbstractForm
* @return-dynamic app\forms\$0
*/
public function showFormAndWait($name)
{
Expand All @@ -294,6 +301,7 @@ public function showFormAndWait($name)
/**
* @param $name
* @return AbstractForm
* @return-dynamic app\forms\$0
*/
public function showNewForm($name)
{
Expand All @@ -309,6 +317,7 @@ public function showNewForm($name)
/**
* @param $name
* @return AbstractForm
* @return-dynamic app\forms\$0
*/
public function showNewFormAndWait($name)
{
Expand All @@ -321,6 +330,7 @@ public function showNewFormAndWait($name)
/**
* @param $name
* @return AbstractForm
* @return-dynamic app\forms\$0
*/
public function hideForm($name)
{
Expand Down
Loading

0 comments on commit f9bde15

Please sign in to comment.