Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into versioning
Browse files Browse the repository at this point in the history
Conflicts:
	composer.json
	src/Jackalope/Transport/DoctrineDBAL/Client.php
	tests/Jackalope/Test/Fixture/DBUnitFixtureXML.php
  • Loading branch information
dbu committed Jan 5, 2016
2 parents 09e50cd + 7178c61 commit ce604a0
Show file tree
Hide file tree
Showing 24 changed files with 420 additions and 311 deletions.
5 changes: 5 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
preset: psr2

enabled:
- long_array_syntax
- duplicate_semicolon
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ env:
- DB=pgsql PACKAGE_VERSION=high
- DB=sqlite PACKAGE_VERSION=high

sudo: false

cache:
directories:
- vendor
- $HOME/.composer/cache

matrix:
allow_failures:
Expand All @@ -30,8 +36,8 @@ matrix:
before_script:
- composer selfupdate
- rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- if [[ "$PACKAGE_VERSION" == "high" ]]; then composer update --prefer-source --no-interaction; fi
- if [[ "$PACKAGE_VERSION" == "low" ]]; then composer update --prefer-lowest --prefer-source --no-interaction; fi
- if [[ "$PACKAGE_VERSION" == "high" ]]; then composer update --prefer-dist --no-interaction; fi
- if [[ "$PACKAGE_VERSION" == "low" ]]; then composer update --prefer-lowest --prefer-dist --no-interaction; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "create database phpcr_tests;"; fi
- if [[ "$DB" == "pgsql" ]]; then psql -c "create database phpcr_tests;" -U postgres; fi
- php tests/generate_phpunit_config.php $DB
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Set up a new database supported by Doctrine DBAL. You can use your favorite GUI

### MySQL

Note that you need at least version 5.1.5 of MySQL, otherwise you will get ``QLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION cmf-app.EXTRACTVALUE does not exist``
Note that you need at least version 5.1.5 of MySQL, otherwise you will get ``SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION cmf-app.EXTRACTVALUE does not exist``

```sh
$ mysqladmin -u root -p create jackalope
Expand Down Expand Up @@ -175,7 +175,7 @@ $post->setProperty("jcr:description", "This is the first post on my blog! Do you
$session->save();
```

See [PHPCR Tutorial](https://github.com/phpcr/phpcr-docs/blob/master/tutorial/Tutorial.md)
See [PHPCR Tutorial](http://phpcr.readthedocs.org/en/latest/book/index.html)
for a more detailed tutorial on how to use the PHPCR API.


Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,28 @@
"php": ">=5.3.3",
"doctrine/dbal": ">=2.4.5,<3.0.x-dev",
"phpcr/phpcr": "~2.1.2",
"phpcr/phpcr-utils": "~1.2,>=1.2.6",
"phpcr/phpcr-utils": "^1.2.8",
"jackalope/jackalope": "dev-versioning as 1.3.0"
},
"provide": {
"jackalope/jackalope-transport": "1.1.0"
},
"require-dev": {
"psr/log": "~1.0",
"phpcr/phpcr-api-tests": "2.1.4",
"phpcr/phpcr-api-tests": "2.1.11",
"phpunit/phpunit": "4.7.*",
"phpunit/dbunit": "~1.3"
},
"autoload": {
"psr-0": { "Jackalope\\": "src/" }
},
"autoload-dev": {
"psr-0": { "Jackalope\\": "tests/" }
},
"bin": ["bin/jackalope"],
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.3-dev"
}
}
}
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="true"
strict="false"
bootstrap="tests/bootstrap.php">
<php>
<ini name="memory_limit" value="512M"/>
Expand Down
14 changes: 9 additions & 5 deletions src/Jackalope/Tools/Console/Command/InitDoctrineDbalCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use Doctrine\DBAL\Connection;

use Jackalope\Transport\DoctrineDBAL\RepositorySchema;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception\TableNotFoundException;
use Jackalope\Transport\DoctrineDBAL\RepositorySchema;

/**
* Init doctrine dbal.
Expand Down Expand Up @@ -63,7 +62,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$connection = $this->getHelper('jackalope-doctrine-dbal')->getConnection();
if (!$connection instanceof Connection) {

$output->write(PHP_EOL.'<error>The provided connection is not an instance of the Doctrine DBAL connection.</error>'.PHP_EOL);
throw new \InvalidArgumentException('The provided connection is not an instance of the Doctrine DBAL connection.');
}
Expand All @@ -82,14 +80,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (true === $input->getOption('dump-sql')) {
$output->writeln($sql);
} else {

$connection->exec($sql);
}
}
} catch (TableNotFoundException $e) {
if (false === $input->getOption('force')) {
throw $e;
}
// remove this once we require Doctrine DBAL 2.5+
} catch (DBALException $e) {
if (false === $input->getOption('force')) {
throw $e;
} else {
$output->writeln($e->getMessage());
}
}
}

Expand Down
Loading

0 comments on commit ce604a0

Please sign in to comment.