aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/ModelPdo.php
AgeCommit message (Collapse)Author
2019-12-25tec: Improve logs on DB connection failure (#2734)Gravatar Marien Fressinaud
For a moment, PHP wasn't able to connect to my database. I tried to understand what happened, unfortunately, the logs were not very helpful (it basically showed me information that I had in my configuration file). I changed the dsn string by the message from the raised exception, I think it will be more useful. Other call of Minz_PDOConnectionException are passing error messages instead of string connection, so I took the opportunity to rename the constructor argument.
2019-11-08Fix CLI bug regarding an empty user (#2646)Gravatar Alexandre Alapetite
Fix https://github.com/FreshRSS/FreshRSS/issues/2644
2019-11-06Fix database autocreate at install (#2635)Gravatar Alexandre Alapetite
* Fix database autocreate at install Several bugs prevented the auto-creation of the database in Web and CLI installs. Fix https://github.com/YunoHost-Apps/freshrss_ynh/issues/84#issuecomment-549818408 * initDb https://github.com/FreshRSS/FreshRSS/pull/2635#discussion_r343107795
2019-10-05add dsnParams to exception log (#2559)Gravatar Robert Kaussow
2019-10-05Add optional database connection URI parameters (#2552)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/2549
2019-10-01Trim whitespace (#2544)Gravatar Alexandre Alapetite
2019-09-29PDO refactoring for code simplification (#2522)Gravatar Alexandre Alapetite
* PDO refactor * Automatic prefix when using the syntax `_tableName` * Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query * Use PDO methods exec(), query(), prepare() + execute() in a more efficient way * Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old) * The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language) * Rename `->bd` to `->pdo` (less of a frenshism, and more informative) * Fix some requests, which were not compatible with MySQL prepared statements * Whitespace * Fix syntax for PostgreSQL sequences + MySQL install * Minor formatting * Fix lastInsertId for PostgreSQL * Use PHP 5.6+ const Take advantage of https://github.com/FreshRSS/FreshRSS/pull/2527 https://www.php.net/manual/en/migration56.new-features.php * A bit of forgotten PHP 5.6 simplification for cURL * Forgotten $s * Mini fix custom user config https://github.com/FreshRSS/FreshRSS/pull/2490/files#r326290346 * More work on install.php but not finished * install.php working * More cleaning of PDO in install * Even more simplification Take advantage of PDO->exec() to run multiple statements * Disallow changing the name of the default category https://github.com/FreshRSS/FreshRSS/pull/2522#discussion_r326967724
2019-09-15CLI to export/import any database to/from SQLite (#2496)Gravatar Alexandre Alapetite
* CLI to export/import any database to/from SQLite Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/pull/2495 * Travis * Execution rights * Fix wrong static fields * Fix MySQL bad default buffering https://stackoverflow.com/questions/6895098/pdo-mysql-memory-consumption-with-large-result-set/6935271#6935271 https://php.net/manual/ref.pdo-mysql * Fix count on progression * Avoid static DB information To ease working with two DBs at the same time * Less static, simplify Needs some testing * Small corrections * Special case for SQLite to SQLite * Modify special case for SQLite * Remove special case for SQLite More uniform logic for the 3 databases. Fix wrong DROP TABLE for SQLite. * Drop indexes * Revert "Drop indexes" This reverts commit f28d2bae0935745c1c74ea38f2ee083f3fd4bf9d. * Fix deletion * Fix classic export * Update cli/README.md Co-Authored-By: Marien Fressinaud <dev@marienfressinaud.fr> * Addressing part of review * Remove goto :cry: * Travis * Comment for SQLite case * Fix missing fields when inserting
2019-08-20Require PHP 5.5+ (#2495)Gravatar Alexandre Alapetite
* Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/issues/2469#issuecomment-522255093 I think it would be reasonable to require PHP 5.5+ for the core of FreshRSS after all. As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the most popular PHP application. We would loose about 20% of the PHP servers according to https://w3techs.com/technologies/details/pl-php/5/all but I expect this number to drop fast after the release of CentOS 8 (CentOS accounts for 17% of Linux servers https://w3techs.com/technologies/details/os-linux/all/all ). Distributions: * no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze, Mageia, as all active versions have PHP > 7 * no impact on OpenSuze, Synology, as all active versions have PHP > 5.5 * we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch (2017-06) - current is Debian 10 Buster * we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05) * we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released soonish) When dropping older versions, I can better like when it is for a good reason, and there is actually one with PHP 5.5, namely generators (yield) https://php.net/language.generators.overview which I consider using. * Version note for JSON.php * hex2bin * Update .travis.yml Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2018-05-261888 postgresql unix socket workaround (#1889)Gravatar BartƂomiej Cieszkowski
* Workaround to enable postgres unix socket instead of tcp * Support Unix sockets for MySQL and PostgreSQL
2018-05-01JSON column for feeds (#1838)Gravatar Alexandre Alapetite
* Draft of JSON column for feeds https://github.com/FreshRSS/FreshRSS/issues/1654 * Add some per-feed options * Feed cURL timeout * Mark updated articles as read https://github.com/FreshRSS/FreshRSS/issues/891 * Mark as read upon reception https://github.com/FreshRSS/FreshRSS/issues/1702 * Ignore SSL (unsafe) https://github.com/FreshRSS/FreshRSS/issues/1811 * Try PHPCS workaround While waiting for a better syntax support
2017-09-22[ci] Add Travis (#1619)Gravatar Frans de Jonge
* [ci] Add Travis * Exclude some libs * Semi-auto whitespace fixes * line length in SQLite * Exclude tests from line length * Feed.php line length * Feed.php: get rid of unnecessary concat * Feed.php: line length * bootstrap.php: no newline at end of file * Allow concatenating across multiple lines * Add Travis badge * do-install line length * update-or-create-user line length * cli/create-user line length * tests/app/Models/SearchTest.php fix indentation * tests/app/Models/UserQueryTest.php fix indentation * tests/app/Models/CategoryTest.php fix indentation * [fix] PHP 5.3 on precise * cli/do-install no spaces * cli/list-users line length * cli/reconfigure line length * empty catch statements * api/index line length nonsense * spaces before semicolon * app/Models/EntryDAO bunch of indentation * extra blank lines * spaces before comma in function call * testing tabwidth * increase to 10 * comment out tabwidth line * try older phpcs version 3.0.0RC4 * line length exception for app/install.php * proper spaces * stray spaces in i18n * Minz/ModelPdo line length * Minz whitespace * greader line length * greader elseif placement * app/Models/Feed.php spacing in function argument * ignore php 5.3 * app/Models/ConfigurationSetter.php stray whitespace * EntryDAOSQLite line length * I vote for higher max line length =P * ignore SQL * remove classname complaint * line length/more legible SQL * ignore line length nonsense * greader line length * feedController issues * uppercase TRUE, FALSE, NULL * revert * importExportController lowercase null * Share.php default value not necessary because ! is_array () a few lines down * CategoryDAO constants should be UPPERCASE * EntryDAO reduce line length * contentious autofix * Allow failures on all versions of PHP except 7.1 because reasons
2016-11-15Function to disable MySQL buffering for large exportsGravatar Alexandre Alapetite
2016-10-24CLI actualize-userGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1095
2016-10-23CLI import ZIP/OPML/JSON for userGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1095 https://github.com/FreshRSS/FreshRSS/issues/851
2016-10-01PostgreSQL case-insensitive SQL LIKEGravatar Alexandre Alapetite
Compatibility with MySQL and SQLite
2016-09-11Merge dev: custom ports for PostgreSQL tooGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1241 https://github.com/FreshRSS/FreshRSS/pull/1244
2016-09-05Support custom MySQL portsGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1241
2016-08-31Quoted upper-cases instead of string replaceGravatar Alexandre Alapetite
2016-08-31MinzPDO inheritanceGravatar Alexandre Alapetite
2016-08-23More PostgreSQLGravatar Alexandre Alapetite
2016-08-02PostgreSQL draftGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/416 Based on @Damstre work https://github.com/FreshRSS/FreshRSS/pull/1071 Not tested
2016-07-30Update MySQL to utf8mb4 (full unicode) đŸ”„Gravatar Alexandre Alapetite
* Requires MySQL 5.5.3+ (drop support for MySQL 5.0) * Requires PHP 5.3.3+ (drop support for PHP 5.3.0) https://github.com/FreshRSS/FreshRSS/issues/789#issuecomment-73878076
2015-06-03PDO config issetGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/868
2015-06-03PDO options for e.g. SSLGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/868
2015-05-11More SQLite compatibilityGravatar Alexandre Alapetite
Additional changes to add compatibility with SQLite for the new hash/lastSeen mode of updating articles.
2015-01-05New configuration system (not working yet)Gravatar Marien Fressinaud
- Use only Minz_Configuration - register() method to load a new configuration file - get() to get a configuration - new exceptions related to configuration - fix a list configuration calls to have FRSS working Current problems to resolve: - How to handle configuration param verifications (i.e. check auth_type is a value from none, http_auth, persona or form) - We must use $conf = Minz_Configuration::get('system'); $general_conf = $conf->general; to access global system configuration which is quite annoying. How to change that? See https://github.com/FreshRSS/FreshRSS/issues/730
2014-12-21BREAKING FEATURE: move user dataGravatar Marien Fressinaud
- Create ./data/users/ folder - Move user configuration to ./data/users/username/config.php - Move sqlite db to ./data/users/username/db.sqlite - Move user logs to ./data/users/username/log.txt See https://github.com/FreshRSS/FreshRSS/issues/729
2014-10-30Fix bug size with SQLiteGravatar Marien Fressinaud
2014-10-17Fix a bug to get size of user (SQLite)Gravatar Marien Fressinaud
2014-10-05Fix a bug (has_transaction)Gravatar Marien Fressinaud
Introduced by the last commit.
2014-10-05Refactor feedControllerGravatar Marien Fressinaud
See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-09-16Fix sqlite bug ON DELETE CASCADEGravatar Marien Fressinaud
Foreign key constraints are not enabled by default. See https://github.com/marienfressinaud/FreshRSS/issues/579 See http://stackoverflow.com/questions/13534040/sqlite3-foreign-keys-on-pdo
2014-08-09SQLite: Bug creation new usersGravatar Alexandre Alapetite
Not tested much yet. Some MySQL parts changed a bit too to double-check. https://github.com/marienfressinaud/FreshRSS/issues/574
2014-07-05Add support for SQLiteGravatar Alexandre Alapetite
https://github.com/marienfressinaud/FreshRSS/issues/100 Warning: MySQL has been changed too, so bugs may have been introduced
2014-07-03Preparation for SQLiteGravatar Alexandre Alapetite
https://github.com/marienfressinaud/FreshRSS/issues/100
2014-01-02actualize_script compatible multi-utilisateurGravatar Alexandre Alapetite
* Messages plus verbeux dans actualize_script * Ajout d'un message syslog lorsque SimplePie fait une requĂȘte HTTP * Minz_Session ne fermait pas les sessions complĂštement. * Nouvelle option dans Minz_Dispatcher et Minz_FrontController pour ne pas utiliser ob_gzhandler. Contribue Ă  https://github.com/marienfressinaud/FreshRSS/issues/126
2013-12-31Multi-utilisateur fonctionnel en HTTP AuthGravatar Alexandre Alapetite
+ Possibilité d'ajout / suppression d'utilisateur (seulement par l'administrateur) + Divers changements pour le mode multi-utilisateur https://github.com/marienfressinaud/FreshRSS/issues/126 + Minz : Renomme "sel_application" en "salt'
2013-12-30Cache HTTP compatible multi-utilisateurGravatar Alexandre Alapetite
Contribue Ă  https://github.com/marienfressinaud/FreshRSS/issues/126
2013-12-15Grosse refactorisation pour permettre le chargement automatique des classesGravatar Alexandre Alapetite
C'est parti de changements pour https://github.com/marienfressinaud/FreshRSS/issues/255 et finalement j'ai continuĂ© la refactorisation... Ajout de prĂ©fixes FreshRSS_ et Minz_ sur le modĂšle de SimplePie_. Toutes les classes sont maintenant en chargement automatique (devrait amĂ©liorer les performances en Ă©vitant de charger plein de classes inutilisĂ©es, et faciliter la maintenance). Suppression de set_include_path(). Si souhaitĂ©, certaines classes de Minz pourraient ĂȘtre dĂ©placĂ©es dans un sous-rĂ©pertoire, par exemple les exceptions. Tests et relecture nĂ©cessaires.