Skip to content

Commit

Permalink
Merge pull request #11 from yoomoney/release/v2.0.2
Browse files Browse the repository at this point in the history
Обновлен SDK до версии 2.2.2
  • Loading branch information
SaShaSpi authored Dec 3, 2021
2 parents ebf80fe + 9de4031 commit 54aac89
Show file tree
Hide file tree
Showing 351 changed files with 23,512 additions and 2,050 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v2.0.2 от 02.12.2021
* Обновлен SDK до версии 2.2.2

### v2.0.1 от 19.08.2021
* Исправление ссылки на демо-магазин в readme

Expand Down
5 changes: 4 additions & 1 deletion src/core/components/yoomoney/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Changelog file for YooMoney component.

YooMoney 2.0.1
YooMoney 2.0.2
====================================

### v2.0.2 от 02.12.2021
* Обновлен SDK до версии 2.2.2

### v2.0.1 от 19.08.2021
* Исправление ссылки на демо-магазин в readme

Expand Down
4 changes: 2 additions & 2 deletions src/core/components/yoomoney/model/yoomoney.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author YooMoney
* @package yoomoney
* @version 2.0.1
* @version 2.0.2
*/
use YooKassa\Client;
use YooKassa\Model\ConfirmationType;
Expand All @@ -22,7 +22,7 @@

class Yoomoney
{
const MODULE_VERSION = '2.0.1';
const MODULE_VERSION = '2.0.2';

/** @var int Оплата через ЮMoney вообще не используется */
const MODE_NONE = 0;
Expand Down
44 changes: 40 additions & 4 deletions src/core/components/yoomoney/vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
*
* @author Fabien Potencier <[email protected]>
* @author Jordi Boggiano <[email protected]>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
private $vendorDir;

// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
Expand All @@ -57,10 +59,17 @@ class ClassLoader
private $missingClasses = array();
private $apcuPrefix;

private static $registeredLoaders = array();

public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}

public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}

return array();
Expand Down Expand Up @@ -300,6 +309,17 @@ public function getApcuPrefix()
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);

if (null === $this->vendorDir) {
return;
}

if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}

/**
Expand All @@ -308,13 +328,17 @@ public function register($prepend = false)
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));

if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}

/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
Expand All @@ -323,6 +347,8 @@ public function loadClass($class)

return true;
}

return null;
}

/**
Expand Down Expand Up @@ -367,6 +393,16 @@ public function findFile($class)
return $file;
}

/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}

private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
Expand Down
Loading

0 comments on commit 54aac89

Please sign in to comment.