phptal / PHPTAL

PHP Template Attribute Language — template engine for XSS-proof well-formed XHTML and HTML5 pages
http://phptal.org
GNU Lesser General Public License v2.1
176 stars 42 forks source link

Adding first composer setup definition #4

Closed Ocramius closed 12 years ago

Ocramius commented 12 years ago

This feature makes phptal installable via composer and available on packagist.org.

kornelski commented 12 years ago

Looks good. Have you checked whether build.xml puts it in the archive?

tanakahisateru commented 12 years ago

I suggest to add "suggest" section including "ext-gettext" for i18n. It's shown by php composer.phar show --platform. Though "suggest" for php-extension has no effect but it can let users know why their i18n attribute didn't work well, I think.

tanakahisateru commented 12 years ago

Add license too. http://getcomposer.org/doc/04-schema.md#license It would displayed on Packagist page.

Ocramius commented 12 years ago

@pornel despite of getting 13 failures (will investigate) in phpunit tests, no, the json is not in the build, and the composer.json would be different as the directory structure changes a bit. I also saw the extdeps section of the phing config, will try to include that.

kornelski commented 12 years ago

Sorry about test failures — those related to namespaces in PHP DOM are known (really though to fix). I should probably move that code to a branch.

Ocramius commented 12 years ago

@pornel no need to be sorry :) You just built awesome stuff, better to know they're known failures at least ;)

kornelski commented 12 years ago

http://packagist.org/packages/phptal/phptal

Ocramius commented 12 years ago

@pornel sorry to bother, wanted to just know if you also added the post-receive hook as described in your http://packagist.org/profile/ :)

Seldaek commented 12 years ago

Is it really necessary to define classmap + PSR-0 autoloading? Either it's PSR-0 compliant and that's enough, or it's not and you should just use classmap IMO.

Ocramius commented 12 years ago

@Seldaek will give it a spin with both to try it, and eventually drop the classmap :)

tanakahisateru commented 12 years ago

@pornel @Ocramius Now GitHub's service hook is directly supporting Packagist instead of Post-Receive URL. I tried and prefer it :)

For smaller package classmap is faster than psr-0 because all class names are mapped to file path and saved into .composer while `php composer.phar install' and they are never evaluated in runtime. But too large mapping information might cause other overheads memory, disk io or such as.

I think, to use psr-0 is basically better way, but to place just only PHPTAL in classmap can be expected good performace. Because it would be used everytime but others are only for parsing on-demand.

Seldaek commented 12 years ago

Please don't try to outsmart Composer :) Use PSR-0 if you can, it's easier for development, and use classmap only if you must. For performance we will have soon a special dumper command that dumps an optimized autoloader.

tanakahisateru commented 12 years ago

Thanks, @Seldaek I trust you! I checked which we can remove classmap or not with real usage. I think that there are no problem if classmap would be removed.

Ocramius commented 12 years ago

FYI classmap autoloader was removed in c49172cf48c6da4b64f17fc130dec8828c0d817b