diff --git a/Makefile b/Makefile deleted file mode 100644 index 2dd7951..0000000 --- a/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -SHELL := /usr/bin/env bash -PIP := /usr/bin/env pip -PYTHON := /usr/bin/env python - -.PHONY: bootstrap clean -.DEFAULT_GOAL := all - -all: - -bootstrap: .requirements_satisfied tools/generate.py - @echo "running generate" - @$(PYTHON) tools/generate.py - -.requirements_satisfied: tools/requirements.txt - @echo "checking requirements" - @$(PIP) install --user -r tools/requirements.txt - @touch $@ - -clean: - @find . -type f -name '*.pyc' -delete - @find . -type f -name '*~' -delete - @find . -type f -name '*.bak' -delete - @find . -type f -name '.requirements_satisfied' -delete -# @find . -type f -name 'etc/tftpd-hpa/rewrite.rules' -delete -# @find . -type f -name 'etc/nginx/site-available/tftpboot' -delete diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..fb3d4e5 --- /dev/null +++ b/build.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..1c64463 --- /dev/null +++ b/composer.json @@ -0,0 +1,45 @@ +{ + "name": "chan-sccp/provisioner", + "type": "library", + "description": "SCCP/Skinny Provisioner", + "keywords": ["sccp","skinny","sip","cisco","tftp","http","chan-sccp"], + "homepage": "http://github.com/dkgroot/provision_sccp", + "license": "Apache-2.0", + "authors": [ + { + "name": "Diederik de Groot", + "email": "ddegroot@talon.nl", + "homepage": "http://github.com/chan-sccp/", + "role": "Developer" + }, + { + "name": "Marcello Ceschia", + "email": "marcello@ceschia.de", + "homepage": "https://github.com/marcelloceschia/", + "role": "Developer" + } + ], + "support": { + "issues": "https://github.com/dkgroot/provision_sccp/issues", + "wiki": "https://github.com/dkgroot/provision_sccp/wiki", + "source": "https://github.com/dkgroot/provision_sccp" + }, + "autoload": { + "psr-4": { + "provision\\": "lib/" + } + }, + "require": { + "php": ">=5.6.0", + "psr/log": ">= 1.0.0" + }, + "require-dev": { + "phing/phing": "*", + "phpunit/phpunit": "*", + "codeclimate/php-test-reporter": "*", + "php-coveralls/php-coveralls": "*", + "phpmd/phpmd": ">=2.5.0", + "squizlabs/php_codesniffer": ">=3.4.0", + "sebastian/phpcpd": "*" + } +} diff --git a/lib/utils.php b/lib/utils.php index c2b93ca..20f9c2a 100644 --- a/lib/utils.php +++ b/lib/utils.php @@ -12,12 +12,16 @@ function utf8_urldecode($str) { function log_debug($message) { global $logger; - $logger->log('LOG_DEBUG', $message); + if ($logger) { + $logger->log('LOG_DEBUG', $message); + } } function log_error($message) { global $logger; - $logger->log('LOG_ERROR', $message); + if ($logger) { + $logger->log('LOG_ERROR', $message); + } } function log_error_and_throw($message) { diff --git a/tests/resolverTest.php b/tests/resolverTest.php new file mode 100644 index 0000000..cd94877 --- /dev/null +++ b/tests/resolverTest.php @@ -0,0 +1,17 @@ +assertInstanceOf( + \SCCP\Resolve\Resolver::class, + $resolver + ); + } +} +