Add composer and phing dependency
Signed-off-by: Diederik de Groot <ddegroot@talon.nl>
This commit is contained in:
25
Makefile
25
Makefile
@@ -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
|
36
build.xml
Normal file
36
build.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- phing build file -->
|
||||
<project
|
||||
name="provision_sccp"
|
||||
default="build"
|
||||
basedir="."
|
||||
description="SCCP/Skinny Provisioner">
|
||||
|
||||
<target name="install">
|
||||
<exec command="./composer.phar install" checkreturn="true" passthru="true"/>
|
||||
<exec command="./composer.phar update" checkreturn="true" passthru="true"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="build"/>
|
||||
</target>
|
||||
|
||||
<target name="prepare">
|
||||
<mkdir dir="build" mode="0755"/>
|
||||
</target>
|
||||
|
||||
<target name="fixstyle">
|
||||
<exec command="phpcbf --tab-width=4 --standard=PSR2 src test"
|
||||
checkreturn="true"
|
||||
passthru="false"/>
|
||||
</target>
|
||||
|
||||
<target name="test">
|
||||
<exec command="phpunit -v --debug tests"
|
||||
checkreturn="true"
|
||||
passthru="true"/>
|
||||
</target>
|
||||
|
||||
<target name="build" depends="clean, prepare, test"/>
|
||||
|
||||
</project>
|
45
composer.json
Normal file
45
composer.json
Normal file
@@ -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": "*"
|
||||
}
|
||||
}
|
@@ -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) {
|
||||
|
17
tests/resolverTest.php
Normal file
17
tests/resolverTest.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php declare(strict_types=1);
|
||||
use PHPUnit\Framework\TestCase;
|
||||
include_once "lib/resolver.php";
|
||||
|
||||
final class ResolverTest extends TestCase
|
||||
{
|
||||
public function testCanBeCreated(): void
|
||||
{
|
||||
global $config;
|
||||
$resolver = new \SCCP\Resolve\Resolver($config);
|
||||
$this->assertInstanceOf(
|
||||
\SCCP\Resolve\Resolver::class,
|
||||
$resolver
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user