Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for Travis

  • Loading branch information...
commit 2560404bee5e773f1a035525fdeffad2dc9fb8e6 1 parent 9a45c69
@mbontemps mbontemps authored
View
4 .gitignore
@@ -1 +1,3 @@
-phpunit.xml
+/phpunit.xml
+/vendor/symfony
+/Tests/autoload.php
View
14 .travis.yml
@@ -0,0 +1,14 @@
+language: php
+php:
+ - 5.3
+ - 5.4
+env:
+ - SYMFONY_VERSION=v2.0.5
+ - SYMFONY_VERSION=origin/master
+before_script: php vendor/vendors.php
+
+script: phpunit --coverage-text
+
+notifications:
+ email:
+ - travis@knplabs.com
View
2  README.markdown
@@ -3,6 +3,8 @@ Provide markdown conversion to your Symfony2 projects.
This implementation is based on Michel Fortin work.
We added PHP5 sugar, feature selection, and unit tests.
+[![Build Status](https://secure.travis-ci.org/knplabs/KnpMenuBundle.png)](http://travis-ci.org/knplabs/KnpMarkdownBundle)
+
## INSTALLATION
Add the following entry to ``deps`` the run ``php bin/vendors install``.
View
23 Tests/autoload.php.dist
@@ -0,0 +1,23 @@
+<?php
+
+$libDir = __DIR__.'/..';
+$vendorDir = $libDir.'/vendor';
+require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
+
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+ 'Symfony' => $vendorDir.'/symfony/src',
+));
+$loader->register();
+
+spl_autoload_register(function($class) {
+ $class = ltrim($class, '\\');
+ if (0 === strpos($class, 'Knp\Bundle\MarkdownBundle\\')) {
+ $file = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('Knp\Bundle\MarkdownBundle\\'))).'.php';
+ if (file_exists($file)) {
+ require $file;
+ }
+ }
+});
View
10 Tests/bootstrap.php
@@ -1,7 +1,7 @@
<?php
-require_once $_SERVER['SYMFONY'].'/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-
-$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
-$loader->registerNamespace('Knp\\Bundle\\MarkdownBundle', __DIR__.'/../../../..');
-$loader->register();
+if (file_exists($file = __DIR__.'/autoload.php')) {
+ require_once $file;
+} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
+ require_once $file;
+}
View
4 phpunit.xml.dist
@@ -17,10 +17,6 @@
</testsuite>
</testsuites>
- <php>
- <server name="SYMFONY" value="/path/to/symfony/src" />
- </php>
-
<filter>
<whitelist>
<directory>./</directory>
View
22 vendor/vendors.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+<?php
+
+set_time_limit(0);
+
+$vendorDir = __DIR__;
+$deps = array(
+ array('symfony', 'http://github.com/symfony/symfony', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
+);
+
+foreach ($deps as $dep) {
+ list($name, $url, $rev) = $dep;
+
+ echo "> Installing/Updating $name\n";
+
+ $installDir = $vendorDir.'/'.$name;
+ if (!is_dir($installDir)) {
+ system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)));
+ }
+
+ system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));
+}
Please sign in to comment.
Something went wrong with that request. Please try again.