Skip to content

Commit

Permalink
v7.0
Browse files Browse the repository at this point in the history
— Большой рефакторинг
— Теперь все ошибки от амо выкидываются исключениями с понятным описанием
— Все возможные значения enum теперь в виде констант
— Класс Info переехал в AmoCRM
— Правка многих багов
— Обновление не совместимо с версиями ~6
  • Loading branch information
drillcoder committed Jan 6, 2019
1 parent ab9a5eb commit 8817428
Show file tree
Hide file tree
Showing 17 changed files with 2,555 additions and 1,889 deletions.
163 changes: 72 additions & 91 deletions README.md

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,28 @@
* @param string $class
*/
function ($class) {
$ns = 'DrillCoder\AmoCRM_Wrap';
$prefixes = array(
"{$ns}\\" => array(
'DrillCoder\AmoCRM_Wrap\\' => array(
__DIR__ . '/src',
__DIR__ . '/tests',
),
);
foreach ($prefixes as $prefix => $dirs) {
$prefix_len = strlen($prefix);
if (substr($class, 0, $prefix_len) !== $prefix) {
$prefix_len = mb_strlen($prefix);
if (mb_strpos($class, $prefix) !== 0) {
continue;
}
$class = substr($class, $prefix_len);
$class = mb_substr($class, $prefix_len);
$part = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
foreach ($dirs as $dir) {
$dir = str_replace('/', DIRECTORY_SEPARATOR, $dir);
$file = $dir . DIRECTORY_SEPARATOR . $part;
if (is_readable($file)) {
require $file;

return;
}
}
}
});


}
);
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "drillcoder/amocrm_wrap",
"description": "Обёртка для простого взаимодействия с Api AmoCRM",
"version": "6.0.9.3",
"version": "7.0",
"keywords": [
"drillcoder",
"amo",
Expand All @@ -18,8 +18,8 @@
],
"license": "MIT",
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
"php": ">=5.3",
"ext-curl": ">=7.34",
"ext-json": "*",
"ext-mbstring": "*"
},
Expand Down
Loading

0 comments on commit 8817428

Please sign in to comment.