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
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# framework (Stub Framework)
Core code of the SimpleStub framework (lite version of SimpleRest Framework)

(RU) Проект находится в стадии разработки, смотрите за обновлениями, скоро заработает. Я очень постараюсь.
(EN) The project is under development, watch for updates, it will work soon. I will try very hard.
(RU) Проект находится в стадии разработки, следите за обновлениями,
На текущий момент фреймворк содержит минимальный набор работоспособных методов
и успешно применяется на (пока простых) заглушка. Работоспособная версия 0.1.2 и выше.

(EN) The project is under development, stay tuned,
At the moment, the framework contains a minimal set of workable methods
and is successfully applied on a (so far simple) stub. Workable version 0.1.2 and higher.
2 changes: 0 additions & 2 deletions src/Contracts/Main/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@ public function terminate();
* @param $default
* @return mixed
*/
public function get(string $key, $default = null);

}
30 changes: 3 additions & 27 deletions src/Main/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ class Application implements BaseApplicationContract
*
* @var string
*/
const VERSION = '0.1.1';

/**
* Массив конфигурационных параметров заглушки
* @var array $params [mixed]
*/
private $params;
const VERSION = '0.1.2';

/**
* The base path for the SimpleStub installation.
Expand All @@ -47,21 +41,15 @@ public function __construct($basePath)
if ($basePath) {
$this->basePath = rtrim($basePath, '\/');
}
$this->params = include_once($this->basePath . '\config\config.php');
}

/**
* Возвращает форматированную строку версии приложения / фреймворка
* Возвращает строку версии фреймворка
* @return string
*/
public function version(): string
{
$formattedVersionString = "";
if (defined('STUB_APP_VERSION')) {
$formattedVersionString = STUB_APP_VERSION;
}
$formattedVersionString .= "/" . static::VERSION;
return $formattedVersionString;
return self::VERSION;
}

/**
Expand Down Expand Up @@ -90,16 +78,4 @@ public function getNamespace(): string
{
return __NAMESPACE__;
}

/**
* Gets the value of the configuration parameter.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function get(string $key, $default = null)
{
return $this->params[$key] ?: $default;
}
}
1 change: 0 additions & 1 deletion src/Main/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Stub\Framework\Main\Console;

use DateTime;
use Stub\Framework\Console\Base\Command;
use Stub\Framework\Console\Base\Input;
use Stub\Framework\Console\Base\Output;
use Stub\Framework\Contracts\Console\Commands;
Expand Down
2 changes: 2 additions & 0 deletions src/Main/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public function sayHello(): string
}

/**
* Возвращает в виде строки готовый код заглушки
* @param BaseDefaultStubResource $r набор строковых параметров для заглушки (модифицированный)
* @return string
*/
public function getCurrentStub(BaseDefaultStubResource $r): string
Expand Down