Skip to content

Conversation

@simensen
Copy link
Contributor

As I mentioned here, the composer.json needs to have autoload information in order for Composer to actually be able to autoload the classes.

It would probably be good to have a new beta2 tag as soon as this goes in as anyone who asks for @beta or minimum-stability: beta is going to have a problem with the existing beta1 version.

It would probably be good to test an install from Packagist using @dev after this change is merged to make sure that there are not other issues before doing the beta2 tag, though.

I'm happy to help! Excited to start directing people here over my fork. :)

michelf added a commit that referenced this pull request Jan 14, 2013
Define autoload for Composer.
@michelf michelf merged commit 03fe190 into michelf:lib Jan 14, 2013
@michelf
Copy link
Owner

michelf commented Jan 14, 2013

Merged. Can you check that things are working fine before I add a new tag? I haven't setup anything for testing composer on my computer yet.

@simensen
Copy link
Contributor Author

I just tested it and it looks fine. Thanks!


If you want a low impact isolated way to test this yourself to verify it works you can try this:

mkdir test-php-markdown-autoload
cd test-php-markdown-autoload
wget http://getcomposer.org/composer.phar
php composer.phar init --require=michelf/php-markdown:1.3.*@dev -n
php composer.phar install

Should result in:

Loading composer repositories with package information
Installing dependencies                                                     
  - Installing michelf/php-markdown (dev-lib 03fe190)
    Cloning 03fe1905452bbdc7e2a5a974a141434fae2a5d5a

Writing lock file
Generating autoload files

Then create a test.php file that looks like this:

<?php

require __DIR__.'/vendor/autoload.php';

use \michelf\Markdown;

$my_text = '# Hello World';

$my_html = Markdown::defaultTransform($my_text);

print $my_html;

Then run:

php test.php

...and you should get

<h1>Hello World</h1>

@michelf
Copy link
Owner

michelf commented Jan 14, 2013

Tag added. Thanks for these detailed instructions.

@simensen
Copy link
Contributor Author

Sure thing, glad I can help.

I tested the tag just now and it looks good. The only things I changed from the commands above was requiring 1.3.*@beta instead of 1.3.*@dev.

mkdir test-php-markdown-autoload-beta2
cd test-php-markdown-autoload-beta2
wget http://getcomposer.org/composer.phar
php composer.phar init --require=michelf/php-markdown:1.3.*@beta -n
php composer.phar install

Resulted in:

Loading composer repositories with package information
Installing dependencies
  - Installing michelf/php-markdown (1.3-beta2)
    Downloading: 100%         

Writing lock file
Generating autoload files

Worked like a charm.

Thanks again for working on this! I'll experiment with it a bit and start migrating some of my projects over to using php-markdown 1.3 once you start releasing stable versions. :)

@simensen simensen deleted the fix-composer branch January 14, 2013 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants