Skip to content

Commit 5ad4b49

Browse files
committed
fix autoloading from composer, loosen dependency
1 parent 9554815 commit 5ad4b49

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

Diff for: bin/phpcb

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
* @since File available since 0.1.0
4848
*/
4949

50-
require_once dirname(__FILE__) . '/../vendor/autoload.php';
50+
if (file_exists(__DIR__ . '/../../autoload.php')) {
51+
include_once __DIR__ . '/../../autoload.php';
52+
} else {
53+
include_once __DIR__ . '/../vendor/autoload.php';
54+
}
5155

5256
$app = new PHPCodeBrowser\Application();
5357
$app->run();

Diff for: build.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
<!-- Run unit tests and generate junit.xml and clover.xml -->
1515
<target name="phpunit">
16-
<exec executable="phpunit" failonerror="true"/>
16+
<exec executable="vendor/bin/phpunit" failonerror="true"/>
1717
</target>
1818

1919
<!-- Generate jdepend.xml and software metrics charts -->
2020
<target name="pdepend">
21-
<exec executable="pdepend">
21+
<exec executable="vendor/bin/pdepend">
2222
<arg line="--jdepend-xml='${basedir}/build/logs/jdepend.xml'
2323
--jdepend-chart='${basedir}/build/pdepend/dependencies.svg'
2424
--overview-pyramid='${basedir}/build/pdepend/overview-pyramid.svg'
@@ -28,21 +28,21 @@
2828

2929
<!-- Generate pmd.xml -->
3030
<target name="phpmd">
31-
<exec executable="phpmd">
31+
<exec executable="vendor/bin/phpmd">
3232
<arg line="src xml codesize,design,naming,unusedcode --reportfile '${basedir}/build/logs/pmd.xml'" />
3333
</exec>
3434
</target>
3535

3636
<!-- Generate pmd-cpd.xml -->
3737
<target name="phpcpd">
38-
<exec executable="phpcpd">
38+
<exec executable="vendor/bin/phpcpd">
3939
<arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml' src" />
4040
</exec>
4141
</target>
4242

4343
<!-- Generate checkstyle.xml -->
4444
<target name="phpcs">
45-
<exec executable="phpcs">
45+
<exec executable="vendor/bin/phpcs">
4646
<arg value="--report=checkstyle" />
4747
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
4848
<arg value="--standard=PSR2" />
@@ -72,7 +72,7 @@
7272
<antcall target="phpmd"/>
7373
<antcall target="phpcpd"/>
7474
<antcall target="phpcs"/>
75-
<antcall target="phpdoc"/>
75+
<!-- <antcall target="phpdoc"/> -->
7676
<antcall target="phpunit"/>
7777
<antcall target="phpcb"/>
7878
</target>

Diff for: composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
"require": {
1414
"phpunit/php-file-iterator": "~1.3",
1515
"monolog/monolog": "~1.7",
16-
"symfony/console": "~2.4"
16+
"symfony/console": "~2.1"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "3.7.*"
19+
"phpunit/phpunit": "3.7.*",
20+
"phpmd/phpmd": "1.5.*",
21+
"squizlabs/php_codesniffer": "1.*",
22+
"phploc/phploc": "*",
23+
"sebastian/phpcpd": "*"
2024
},
2125
"autoload": {
2226
"psr-0": {"PHPCodeBrowser\\": "src/"}

0 commit comments

Comments
 (0)