Skip to content

Commit 8817428

Browse files
committed
v7.0
— Большой рефакторинг — Теперь все ошибки от амо выкидываются исключениями с понятным описанием — Все возможные значения enum теперь в виде констант — Класс Info переехал в AmoCRM — Правка многих багов — Обновление не совместимо с версиями ~6
1 parent ab9a5eb commit 8817428

17 files changed

+2555
-1889
lines changed

README.md

Lines changed: 72 additions & 91 deletions
Large diffs are not rendered by default.

autoload.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,28 @@
1212
* @param string $class
1313
*/
1414
function ($class) {
15-
$ns = 'DrillCoder\AmoCRM_Wrap';
1615
$prefixes = array(
17-
"{$ns}\\" => array(
16+
'DrillCoder\AmoCRM_Wrap\\' => array(
1817
__DIR__ . '/src',
1918
__DIR__ . '/tests',
2019
),
2120
);
2221
foreach ($prefixes as $prefix => $dirs) {
23-
$prefix_len = strlen($prefix);
24-
if (substr($class, 0, $prefix_len) !== $prefix) {
22+
$prefix_len = mb_strlen($prefix);
23+
if (mb_strpos($class, $prefix) !== 0) {
2524
continue;
2625
}
27-
$class = substr($class, $prefix_len);
26+
$class = mb_substr($class, $prefix_len);
2827
$part = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
2928
foreach ($dirs as $dir) {
3029
$dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);
3130
$file = $dir . DIRECTORY_SEPARATOR . $part;
3231
if (is_readable($file)) {
3332
require $file;
33+
3434
return;
3535
}
3636
}
3737
}
38-
});
39-
40-
38+
}
39+
);

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "drillcoder/amocrm_wrap",
33
"description": "Обёртка для простого взаимодействия с Api AmoCRM",
4-
"version": "6.0.9.3",
4+
"version": "7.0",
55
"keywords": [
66
"drillcoder",
77
"amo",
@@ -18,8 +18,8 @@
1818
],
1919
"license": "MIT",
2020
"require": {
21-
"php": ">=5.3.0",
22-
"ext-curl": "*",
21+
"php": ">=5.3",
22+
"ext-curl": ">=7.34",
2323
"ext-json": "*",
2424
"ext-mbstring": "*"
2525
},

0 commit comments

Comments
 (0)