Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache] Add PDO + Doctrine DBAL adapter#19519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:cache-pdo
Aug 19, 2016

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedAug 3, 2016
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PRsymfony/symfony-docs#6858

This PR adds a PDO adapter for our PSR-6 cache items. The implementation heavily borrows from PdoSessionHandler.


private function init($pdoOrDsn, $namespace, $defaultLifetime, array $options)
{
if (isset($namespace[0]) && preg_match('#[^-+.A-Za-z0-9]#', $namespace, $match)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wouldn'tstrpbrk be more efficient ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

not sure, less readable, and not perf critical code path anyway (run once code) :)

@nicolas-grekasnicolas-grekas changed the title[Cache] Add PDO adapter + tag aware adapter[Cache] Add PDO adapterAug 4, 2016
@nicolas-grekasnicolas-grekasforce-pushed thecache-pdo branch 7 times, most recently fromab167dc todcc7915CompareAugust 5, 2016 19:04
/**
* {@inheritdoc}
*/
protected $maxIdLength = 255;
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

phpdoc seems useless to me

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

removed

@nicolas-grekasnicolas-grekas changed the title[Cache] Add PDO adapter[Cache] Add PDO + Doctrine DBAL adapterAug 6, 2016
@nicolas-grekas
Copy link
MemberAuthor

This now also accepts a Doctrine DBAL Connection.

"require-dev": {
"cache/integration-tests":"dev-master",
"doctrine/cache":"~1.6",
"doctrine/dbal":"~2.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

From a "component" point of view, you may adddoctrine/dbal to thesuggest section, what do you think ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Bof... This would never end: install redis, install apcu, install... etc. No value. Read the doc instead (I'm on it).

@nicolas-grekasnicolas-grekasforce-pushed thecache-pdo branch 4 times, most recently from11e8765 to5007996CompareAugust 16, 2016 16:19
$value =false;
}elseif (false ===$value =unserialize($value)) {
$value =null;
$this->values[$key] =$value =null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

isn't this a bugfix which should go separately ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

break;
case 'pdo_sqlsrv':
$this->driver = 'sqlsrv';
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

what about handling the default case here, for unknown drivers ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

we use only pgsql and sqlsrv, so I'd rather remove all the unused cases than add a default

Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasAug 16, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok, bad answer :) yet, the adapter doesn't handle other drivers, so we don't care for a default case here

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit82a0de2 intosymfony:masterAug 19, 2016
fabpot added a commit that referenced this pull requestAug 19, 2016
This PR was merged into the 3.2-dev branch.Discussion----------[Cache] Add PDO + Doctrine DBAL adapter| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        |symfony/symfony-docs#6858This PR adds a PDO adapter for our PSR-6 cache items. The implementation heavily borrows from PdoSessionHandler.Commits-------82a0de2 [Cache] Add PDO + Doctrine DBAL adapter
@nicolas-grekasnicolas-grekas deleted the cache-pdo branchAugust 19, 2016 16:53
@fabpotfabpot mentioned this pull requestOct 27, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@nicolas-grekas@fabpot@stof@Tobion@mickaelandrieu@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp