Skip to content

Commit

Permalink
Released 8.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zntr committed Aug 8, 2023
1 parent 992434a commit edd6fd7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
26 changes: 23 additions & 3 deletions Internal/package-console/Async.php
Expand Up @@ -9,6 +9,7 @@
* @author Ozan UYKUN [ozan@znframework.com]
*/

use Throwable;
use ZN\Config;
use ZN\Protection\Json;

Expand Down Expand Up @@ -100,16 +101,35 @@ public static function run(string $command, array $data = []) : string
/**
* Command process
*
* @param string $procId
* @param string $procId
* @param callback $callable
* @param bool $report = false
*/
public static function process(string $procId, callable $callable) : void
public static function process(string $procId, callable $callable, bool $report = false) : void
{
self::$procId = $procId;

$data = self::getData($procId);

$callable($data, $procId);
try
{
$callable($data, $procId);
}
catch( Throwable $e )
{
if( $report )
{
$error =
[
'message' => $e->getMessage(),
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => $e->getTrace()
];

self::report($error);
}
}

self::remove($procId);
}
Expand Down
3 changes: 0 additions & 3 deletions Internal/package-zerocore/In.php
Expand Up @@ -42,9 +42,6 @@ class In
*/
public static function projectMode()
{
# It keeps the selected project mode.
define('PROJECT_MODE', strtolower(PROJECT_CONFIG['mode'] ?? 'development'));

# Controls project mode.
switch( strtolower(PROJECT_MODE) )
{
Expand Down
3 changes: 0 additions & 3 deletions Internal/package-zerocore/Kernel.php
Expand Up @@ -29,9 +29,6 @@ public static function start()
{
# The system starts the load time.
define('START_BENCHMARK', microtime(true));

# It keeps the selected project configuration.
define('PROJECT_CONFIG', Config::get('Project'));

# Enables the ob_gzhandler method if it is turned on.
define('HTACCESS_CONFIG', Config::get('Htaccess'));
Expand Down
9 changes: 8 additions & 1 deletion Internal/package-zerocore/ZN.php
Expand Up @@ -9,6 +9,7 @@
* @author Ozan UYKUN [ozan@znframework.com]
*/

use Throwable;
use ZN\Filesystem;
use ZN\Services\Restful;
use ZN\Protection\Separator;
Expand Down Expand Up @@ -145,10 +146,16 @@ public static function run(string $type = NULL, string $version = NULL, string $
return false;
}

# It keeps the selected project configuration.
define('PROJECT_CONFIG', Config::get('Project'));

# It keeps the selected project mode.
define('PROJECT_MODE', strtolower(PROJECT_CONFIG['mode'] ?? 'development'));

# Run Kernel
try
{
Kernel::run();
Kernel::run();
}
catch( Throwable $e )
{
Expand Down
2 changes: 1 addition & 1 deletion zeroneed.php
Expand Up @@ -30,4 +30,4 @@
|
*/

ZN\ZN::run('FE', '8.4.1', 'Mustafa Kemal Atatürk');
ZN\ZN::run('FE', '8.5.0', 'Mustafa Kemal Atatürk');

0 comments on commit edd6fd7

Please sign in to comment.