Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save liuggio/2427058 to your computer and use it in GitHub Desktop.
Save liuggio/2427058 to your computer and use it in GitHub Desktop.
symfony2 store your assets into the github
//app/autoload.php
$loader->registerNamespaces(array(
...
// add TQ library to namespace
'TQ' => __DIR__.'/../vendor/PHP-Stream-Wrapper-for-Git/src',
...
));
....
//at the end of the file
use TQ\Git\Cli\Binary;
use TQ\Git\StreamWrapper\StreamWrapper;
StreamWrapper::register('php-git', new Binary('/usr/bin/git'));
# app/config/config.yml
framework:
# ...
templating:
# ...
assets_base_urls: [https://raw.github.com/liuggio/UsingGitHubAsAssetsCloudFiles/master/]
#
# YOU COULD ALSO USE PACKAGES INTO TWIG IN ORDER TO SPLIT THE FILES IN REPO
# packages:
# rscf:
# base_urls: [https://raw.github.com/liuggio/UsingGitHubAsAssetsCloudFiles/master/]
#...
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
write_to: php-git://UsingGitHubAsAssetsCloudFiles/ # this is the directory /UsingGitHubAsAssetsCloudFiles
java: /usr/bin/java
filters:
cssrewrite: ~
cssembed:
jar: %kernel.root_dir%/Resources/java/cssembed-0.3.6.jar
closure:
jar: %kernel.root_dir%/Resources/java/compiler.jar
yui_css:
jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar
yui_js:
jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar
[PHP-Stream-Wrapper-for-Git]
git=git://github.com/teqneers/PHP-Stream-Wrapper-for-Git.git
#!/bin/sh
# in you /UsingGitHubAsAssetsCloudFiles/.git/hooks/post-commit
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment