Skip to content

Commit

Permalink
fix autoloading from composer, loosen dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
globin committed Jan 2, 2014
1 parent 9554815 commit 5ad4b49
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 5 additions & 1 deletion bin/phpcb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@
* @since File available since 0.1.0
*/

require_once dirname(__FILE__) . '/../vendor/autoload.php';
if (file_exists(__DIR__ . '/../../autoload.php')) {
include_once __DIR__ . '/../../autoload.php';
} else {
include_once __DIR__ . '/../vendor/autoload.php';

This comment has been minimized.

Copy link
@brodkin

brodkin Mar 26, 2015

This seems to be an error unless I'm missing what you're going for. Assuming a default composer installation the binary would be installed at $basepath/vendor/bin/phpcb which means that the relative path to the autoloader would be ../../vendor/autoload.php. Running the latest release currently throws several errors since vendor/bin/../vendor/autoload.php cannot be loaded.

}

$app = new PHPCodeBrowser\Application();
$app->run();
12 changes: 6 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

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

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

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

<!-- Generate pmd-cpd.xml -->
<target name="phpcpd">
<exec executable="phpcpd">
<exec executable="vendor/bin/phpcpd">
<arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml' src" />
</exec>
</target>

<!-- Generate checkstyle.xml -->
<target name="phpcs">
<exec executable="phpcs">
<exec executable="vendor/bin/phpcs">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=PSR2" />
Expand Down Expand Up @@ -72,7 +72,7 @@
<antcall target="phpmd"/>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phpdoc"/>
<!-- <antcall target="phpdoc"/> -->
<antcall target="phpunit"/>
<antcall target="phpcb"/>
</target>
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
"require": {
"phpunit/php-file-iterator": "~1.3",
"monolog/monolog": "~1.7",
"symfony/console": "~2.4"
"symfony/console": "~2.1"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
"phpunit/phpunit": "3.7.*",
"phpmd/phpmd": "1.5.*",
"squizlabs/php_codesniffer": "1.*",
"phploc/phploc": "*",
"sebastian/phpcpd": "*"
},
"autoload": {
"psr-0": {"PHPCodeBrowser\\": "src/"}
Expand Down

0 comments on commit 5ad4b49

Please sign in to comment.