Написал небольшой класс для работы с API сервиса allpositions.ru.

Пример использования

Для работы необходим XMLRPC клиент с https://github.com/gggeek/phpxmlrpc (Прямая ссылка на xmlrpc.inc)

get_project($projectID);


if ($project === null) {//При ошибке любая функция возвращает null
    echo 'API error occured: ' . $api->lastError();//Возвращает последнее сообщение ошибки
} else {
    echo 'Project name: "' . $project['name'] . '"';
}

Описание функций и возвращаемых значений можно найти на странице справки API http://allpositions.ru/help/api/

Для подключения через Composer, добавьте в require:
"xf3/allpositionsru": "dev-master"

Проект на github

Скачать .zip архив

Share Button

Very common situation when you have some long-running Php script that exceeds Php’s max_execution_time directive. The easiest way to overcome this limit is to increase it’s value:

In your .php script file:


Or in php.ini file:

max_execution_time=300;300 seconds

Note that in later example this limit will be used for EVERY script.

But the problem is that not always you have access to php.ini file (E.g. when using shared hosting) or overwriting of max_execution_time is not allowed for scripts.

In this case, possible solution is to divide script execution into parts limited by time execution (Like you can limit query results in MySql with help of LIMIT 20, 30 or similar).

I wrote a small class which makes code division a very simple thing.
Continue reading

Share Button