Giter Site home page Giter Site logo

Version 2.0.0 about easydb HOT 12 CLOSED

paragonie avatar paragonie commented on May 21, 2024
Version 2.0.0

from easydb.

Comments (12)

SignpostMarv avatar SignpostMarv commented on May 21, 2024

I was wondering if this should throw an exception/ log a warning?

$db = new EasyDB($pdo);
$db->setAttribute(\PDO::ATTR_EMULATE_PREPARES, true);

from easydb.

paragonie-scott avatar paragonie-scott commented on May 21, 2024

Yes, that would be a good idea :)

from easydb.

SignpostMarv avatar SignpostMarv commented on May 21, 2024

In that case, would the clone statement you added negate the issue of $db->getPdo()->setAttribute() bypassing EasyDB ?

from easydb.

paragonie-scott avatar paragonie-scott commented on May 21, 2024

Yes, it would. You'd have a cloned instance of the internal PDO but be unable to affect the PDO object used by EasyDB.

from easydb.

SignpostMarv avatar SignpostMarv commented on May 21, 2024

re: code style consistency commits & static analyses commits, are the tools you use available as gpg-signed binaries as with the phpunit runner ?

from easydb.

paragonie-scott avatar paragonie-scott commented on May 21, 2024

I'm actually just using PHPStorm's built in inspections, as I've found it to be as reliable as most third party tools.

from easydb.

SignpostMarv avatar SignpostMarv commented on May 21, 2024

I use Atom at home/work, although I run php-cs-fixer from cli rather than the atom package- the .editorconfig from #11 is another habit I got into so I don't break style between machines/projects.

from easydb.

SignpostMarv avatar SignpostMarv commented on May 21, 2024

I'm guessing the only benefit to automated linting on travis is to fail a pull request if someone doesn't meet your preferred coding style.

from easydb.

paragonie-scott avatar paragonie-scott commented on May 21, 2024

I prefer the @hintjens approach: Merge and fix the code style ourselves. :)

from easydb.

SignpostMarv avatar SignpostMarv commented on May 21, 2024

:)

Since we're already throwing exceptions if $string is empty or starts with a number, should we be throwing an exception in EasyDB::escapeIdentifier() if $str !== trim($string) (or $str !== $string for the even more paranoid approach)?
i.e. $str refers to something other than $string (since "foo@bar" ≠ "foobar") vs "your $string is terrible"? (possible overkill on the input paranoia there :P)

Furthermore, is it overkill to modify it further to support separator characters when quoting? i.e.

$db = new EasyDB($pdo);

 // would normally return [foobar], "foobar" or `foobar`
$tableThenField = $db->escapeIdentifier('foo.bar');

// would normally return [foobarbaz], "foobarbaz" or `foobarbaz`
$databaseThenTableThenField = $db->escapeIdentifier('foo.bar.baz');

p.s. since the linux box is currently segfaulting on php making testing a pain, I'll be off for the night- fingers crossed that the my main system works tomorrow when it comes back from repair tomorrow.

from easydb.

paragonie-scott avatar paragonie-scott commented on May 21, 2024

6c28b21

I've made separator support optional. To enable it, $edb->setAllowSeprators(true);.

from easydb.

SignpostMarv avatar SignpostMarv commented on May 21, 2024

I've found some bugs in the tests etc., will push them up later

from easydb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.