Skip to content

Commit

Permalink
1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ephenyxshop committed May 26, 2023
1 parent f9ea0a0 commit 449fdc7
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 2,102 deletions.
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phenyxdigitale/coredev",
"description": "Ephenyx Digital Core Developpement",
"description": "Deploy Ephenyx Digital Core",
"homepage": "https://github.com/phenyxdigitale/coredev",
"type": "library",
"license": "MIT",
Expand All @@ -20,6 +20,9 @@
},
"autoload": {
"classmap": {"digitalCore": "src/"},
"files": ["digitalcore.composer.php"]
"files": ["digitalcore.composer.php"],
"psr-4": {
"phenyxDigitale\\digitalCore\\": "digitalCore"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

use Ephenyxdigital\Core\DependencyInjection\ServiceLocator;
use Ephenyxdigital\Core\Error\ErrorHandler;
use Ephenyxdigital\Core\Error\ErrorUtils;
namespace PhenyxDigital\digitalCore;

/**
* Class ControllerCore
* Class PhenyxController
*
* @since 1.6.6.3
*/
Expand Down Expand Up @@ -119,8 +117,7 @@ public function __construct() {

public static function getController($className, $auth = false, $ssl = false) {

Tools::displayAsDeprecated();
return ServiceLocator::getInstance()->getController($className);
return new $className($auth, $ssl);
}

public static function myErrorHandler($errno, $errstr, $errfile, $errline) {
Expand Down Expand Up @@ -1489,28 +1486,6 @@ public function displayProfiling() {
return $this->content_ajax;

}

protected static function getErrorHandler(): ErrorHandler {

return ServiceLocator::getInstance()->getErrorHandler();
}

/**
* Returns error messages collected by ErrorHandler
* @return array
*/
protected static function getErrorMessages() {

if (_EPH_MODE_DEV_) {
if (_EPH_DISPLAY_COMPATIBILITY_WARNING_) {
$mask = E_ALL;
} else {
$mask = E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED);
}
return static::getErrorHandler()->getErrorMessages(false, $mask);
}
return [];
}


}
20 changes: 14 additions & 6 deletions src/Adapter/Adapter_ServiceLocator.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?php

use Ephenyxdigital\Core\DependencyInjection\ServiceLocator;

/**
* Class Adapter_ServiceLocator
*/
// @codingStandardsIgnoreStart
class Adapter_ServiceLocator {


// @codingStandardsIgnoreEnd

/**
* Set a service container Instance
* @var Core_Foundation_IoC_Container
*/
protected static $serviceContainer;

/**
* @param Core_Foundation_IoC_Container $container
*/
public static function setServiceContainerInstance(Core_Foundation_IoC_Container $container) {

Tools::displayAsDeprecated();
ServiceLocator::initialize($container);
self::$serviceContainer = $container;
}

/**
Expand All @@ -31,7 +35,11 @@ public static function setServiceContainerInstance(Core_Foundation_IoC_Container
*/
public static function get($serviceName) {

return ServiceLocator::getInstance()->getByServiceName($serviceName);
if (empty(self::$serviceContainer) || is_null(self::$serviceContainer)) {
throw new Adapter_Exception('Service container is not set.');
}

return self::$serviceContainer->make($serviceName);
}

}
20 changes: 0 additions & 20 deletions src/Controller/InitializationCallback.php

This file was deleted.

205 changes: 0 additions & 205 deletions src/Controller/ServiceLocator.php

This file was deleted.

Loading

0 comments on commit 449fdc7

Please sign in to comment.