Commit Graph

387 Commits

Author SHA1 Message Date
Michael e333f45d0f Ensure that the initial values are set 2020-05-15 17:49:07 +00:00
Michael 89b47afb09 Testmode added 2020-05-15 15:41:50 +00:00
Michael d71c3e0812 Activate test mode for database 2020-05-15 15:05:17 +00:00
Michael 7a82171bfe The "term" table is removed 2020-05-15 06:50:20 +00:00
Michael faaf3d89e3 The next boolean 2020-05-11 19:07:18 +00:00
Michael c5be1092d0 Use "quoteIdentifier" 2020-05-11 18:59:36 +00:00
Michael a7f777ee43 DBStructure is now using "q(" nevermore 2020-05-10 20:23:58 +00:00
Michael 7f55e1b2bc We now support real foreign keys 2020-05-10 14:55:03 +00:00
Michael 5fe6a2dfcd We now store verbs in a new side table 2020-05-09 15:38:40 +00:00
Michael 0f042b064a Fix warning, notice and DB Error 2020-05-05 21:49:48 +00:00
Hypolite Petovan f7a45e4153
Merge pull request #8577 from annando/no-term2
File and category aren't using "term" anymore
2020-05-05 13:45:48 -04:00
Michael 7de6e60328 Merge remote-tracking branch 'upstream/develop' into issue-8550 2020-05-05 15:56:24 +00:00
Michael 5725784055 Update database definition, cleaned code 2020-05-05 15:47:35 +00:00
Michael 59675c4f0b Merge remote-tracking branch 'upstream/develop' into no-term2 2020-05-05 15:44:24 +00:00
Michael 875d6b36e9 File and category aren't using "term" anymore 2020-05-03 15:13:40 +00:00
Michael 1a4beaf061 post update function added 2020-05-02 21:27:37 +00:00
Michael 6d4962a571 1,000 is better than 100 2020-04-30 12:13:13 +00:00
Michael bb0d6ce6f6 Better check for finished conversion 2020-04-30 09:03:05 +00:00
Michael 88931e5053 Post update functionality for tags 2020-04-30 06:09:57 +00:00
Michael Vogel e1d21e736a
Update src/Database/Database.php
Co-Authored-By: Hypolite Petovan <hypolite@mrpetovan.com>
2020-04-29 19:13:23 +02:00
Michael 6487daa4a9 Issue 8550: Check for a good table_definition cache value 2020-04-29 06:28:06 +00:00
Michael 70e5639e29 Merge 2020-04-28 13:33:03 +00:00
Michael fd752be114 Issue 8546: Added option to not use prepared statements 2020-04-28 05:40:23 +00:00
Michael 6c59e03805 Renamed comment 2020-04-26 16:20:17 +00:00
Michael 51bc5279a0 Documentation and unneeded stuff removed 2020-04-25 18:36:58 +00:00
Michael afa712b811 DBView is View 2020-04-24 08:48:34 +00:00
Michael c3aa2730de Improved definition style 2020-04-23 07:02:18 +00:00
Michael 63ebbb8a16 We now can define views 2020-04-23 06:19:44 +00:00
Michael 01c6179feb Check for Antelope and convert to Barracuda 2020-04-01 18:11:06 +00:00
Hypolite Petovan f047944b2d Switch all item deletion logging to info level 2020-03-04 15:59:19 -05:00
Hypolite Petovan b4597a643d Add callstack context to cascade deletion debug logging 2020-03-04 10:30:55 -05:00
nupplaPhil 23c64b9a11
Add license info at Friendica classes 2020-02-09 15:45:36 +01:00
Hypolite Petovan bac5159f6f Clarify update.php doc and mention Database\PostUpdate 2020-01-20 07:47:53 -05:00
Hypolite Petovan 559879f41f Enable Model lazy updating based on only the changed data
- Simplify update decision in Database
2020-01-20 07:32:48 -05:00
Hypolite Petovan 353dab166e Rename PermissionSet::fetchIDForPost to PermissionSet::getIdFromACL
- Allow creating/retrieving a permission set id with arbitrary parameters
- Rename ACLformatter->sanitize to ACLFormatter->sanitizeItem
- Move PermissionSet::sortPermissions to ACLformatter->sanitize
2020-01-20 07:32:47 -05:00
nupplaPhil ed9392469e
Remove unneeded Config namespace usages 2020-01-19 22:50:44 +01:00
nupplaPhil d5a473abda
Shorten "PConfiguration" to "PConfig" again, since the Wrapper is gone 2020-01-19 22:23:44 +01:00
nupplaPhil 21640ec5d8
Add missing Friendica\DI namespace to files (PHPStorm inspection) 2020-01-19 21:26:42 +01:00
nupplaPhil 3411ced833
Move Config::set() to DI::config()->set() 2020-01-19 21:21:53 +01:00
nupplaPhil 6c36fd9e01
Move Config::get() to DI::config()->get() 2020-01-19 21:21:13 +01:00
nupplaPhil 174129af94
add missing namespaces/fix wrong class-names 2020-01-19 16:31:35 +01:00
nupplaPhil d6efc90194
cleanup namespace usages for L10n 2020-01-19 16:31:33 +01:00
nupplaPhil 5dfee31108
Move L10n::t() calls to DI::l10n()->t() calls 2020-01-19 16:31:16 +01:00
Michael 845f71b7dd Missing "*" 2020-01-19 10:10:53 +00:00
Michael 572a3f1180 And the rest of the new lines 2020-01-19 09:55:28 +00:00
Michael 0a4119adaf @brief is removed completely 2020-01-19 06:05:23 +00:00
Michael fd1f1999f0 Remove @brief in DBA.php 2020-01-18 20:33:20 +00:00
Hypolite Petovan ef6e9ef26b Add DBA::collapseCondition method
- Update Database->update for use with DBA::collapseCondition
2020-01-06 20:48:26 -05:00
Michael 20d570823d Fix post update / clean up code 2020-01-05 10:16:01 +00:00
Michael a4268a973f Added post update 2020-01-05 09:10:32 +00:00
nupplaPhil 388b963714
Replace BaseObject class with DI::* calls 2019-12-29 20:17:38 +01:00
Hypolite Petovan 51ee24f652 Fix capitalization of table definition key in DBStructure
- Addresses https://github.com/friendica/friendica/issues/7998#issuecomment-569481865
2019-12-29 02:23:47 -05:00
Hypolite Petovan 9c9e07dbab Add support for empty values array in Database\DBA 2019-12-24 16:21:00 -05:00
Hypolite Petovan fd5b2d6af2 Fix wrong type-hints for table parameter in Database->selectToArray and DBA::selectToArray 2019-12-16 08:49:01 -05:00
Hypolite Petovan 5dcf6bfc58 Remove extra spaces before closing parentheses in src/ 2019-10-16 08:58:09 -04:00
Hypolite Petovan 146646c4d4 Replace deprecated calls to defaults() by ?? and ?: in src/ 2019-10-16 08:38:52 -04:00
Hypolite Petovan 185f1fc687
Merge pull request #7636 from annando/manage
Restructured "manage" functionality, added count parameters
2019-09-30 11:12:46 -04:00
Philipp Holzer d5dd12b8f8
Add Drone CI
- Add drone test environment
- Add drone config
- apt phpunit
- Fix api.php
- Fix item.php
- Fix DBStructure
- Check if caching is possible during tests
2019-09-30 14:03:12 +02:00
Michael d41399496e Merge remote-tracking branch 'upstream/develop' into manage 2019-09-30 06:30:13 +00:00
Philipp Holzer ca36ea17f9
Fix Auto-Installer 2019-09-23 12:51:07 +02:00
Michael 8237d35a87 Restructured "manage" functionality, added count parameters 2019-09-17 04:05:26 +00:00
Michael Vogel 3b92f7357c Renamed function 2019-08-30 07:52:21 +02:00
Michael Vogel 438394bc1d Type hints, corrected wrong documentation 2019-08-30 07:38:42 +02:00
Michael Vogel 66eab2b44f Don't handle deleted contacts / removed unneeded parameter 2019-08-29 07:22:29 +02:00
Michael Vogel 503a5be06c Fixed query (not all duplicates had been found) 2019-08-29 06:55:36 +02:00
Michael Vogel 141bcf149d Added post update to remove duplicated contacts 2019-08-29 06:06:41 +02:00
Philipp Holzer 4b4dbd38d9
Fixing PHP Fatal Error for Database-Reconnects with PDO 2019-08-28 01:40:34 +02:00
Hypolite Petovan 0e0fff3324 Correctly escape identifier names
- Add support for schema, multiple tables in $table parameters
- Remove Database->formatTableName method
2019-07-29 00:23:40 -04:00
Hypolite Petovan a61ce4fed0 Ensure *toArray returns an array 2019-07-28 00:03:42 -04:00
Philipp Holzer 51d2db3998
merge DBA::selectToArray 2019-07-27 23:57:38 +02:00
Philipp Holzer 37d03bbeae
Introduce test optimization
- Add static connection for whole tests
- Introduce ExtendedPDO class to enable nested transactions
- Add rollback logic for tests to ensure reliability and increase speed
2019-07-27 23:54:13 +02:00
Philipp Holzer 6c2cf494b5
Remove DependencyFactory
- Include all necessary classes in `dependencies.config.php`
- Add DI-reference to BaseObject (acts as a global registry)
- Refactor all static "init()" methods to use the global registry

- Refactor Logging for Worker-Logger a little bit
2019-07-27 23:54:12 +02:00
Michael 5d9472dccf Type hints 2019-07-27 17:00:06 +00:00
Michael 555c444b4e Moved function to Database.php 2019-07-27 16:08:48 +00:00
Michael 2be0ceac6b Added "selectToArray" functions in DBA and Item 2019-07-27 14:33:17 +00:00
Philipp Holzer 7aa9917ca8
Fix DB_UPDATE_VERSION constant 2019-07-21 14:34:42 +02:00
Philipp Holzer a8e6a57e9b
Fixing installer 2019-07-21 14:21:02 +02:00
Philipp Holzer 55999730e0
Introduce DICE
- Adding dice library
- Adding dependency config

- Removing Factories
- Refactoring App\Mode constructor
- Refactoring App\Router constructor
- Refactoring BasePath for DI usage
- Refactoring ConfigFileLoader constructor
- Refactoring Profiler constructor

- Adjust entrypoints (index, console, worker, ..)

- Adding functional test for DI
- Fix tests because of refactorings
2019-07-21 01:22:10 +02:00
Philipp Holzer 92fb0a82ca
Dynamic config loading
- Move settings, defaults and dbstructure to directory 'static'
- Dynamic loading of config files (after the static loading)
- Filter out '-sample.config.php' and '-sample.ini.php' files
- Remove unnecessary ConfigFileManager
- Move ConfigFileLoader to Utils
- Add tests for multi-loading for INI, config and sample-filtering
2019-07-16 20:16:43 +02:00
Philipp Holzer 4913502922
bugfix: add lost changes due merge 2019-07-14 22:12:45 +02:00
Philipp Holzer c82127ffb7
Splitting ConfigCache & PConfigCache
- Remove IConfigCache & IPConfigCache
- Add new PConfigCache
- Add missing Logger::init() (bugfixing tests)
2019-07-12 22:53:37 +02:00
Philipp Holzer 91c295b55f
Rebase type-hint based on af9ce6b92a 2019-06-24 09:36:07 +02:00
Philipp Holzer 082634adbc
Moving from DBA to Database 2019-06-24 09:36:07 +02:00
Hypolite Petovan af9ce6b92a Add type-hint for dynamic variables in DBA 2019-06-13 19:07:04 -04:00
Michael 30143aa5b1 Identifier have to be escaped different than values 2019-05-21 05:34:41 +00:00
Michael 1f6f588872 Fix table name sanitation / enable table schemes 2019-05-20 20:38:18 +00:00
Philipp Holzer 419cc81ef1
renaming 2019-05-19 05:13:06 +02:00
Philipp Holzer e00f110ef1
Move mod/dirfind to src/Module/DirFind 2019-05-19 04:28:16 +02:00
Philipp Holzer 8bb85b1da7
Move mod/randprof to src/Module/RandomProfile 2019-05-18 22:17:57 +02:00
Hypolite Petovan a7feb4bf9f Add Two-factor recovery code model
- [DBA] Add NULL value handling in condition array
2019-05-13 01:52:00 -04:00
Philipp Holzer 90a38a00d8
Adding basepath, urlpath, hostname and ssl_policy to installation 2019-04-14 14:23:06 +02:00
Philipp Holzer f17d6e88fd
fix loglevel 2019-04-13 21:03:07 +02:00
Philipp Holzer e2f69a04b9
trim whitespaces 2019-04-13 20:57:21 +02:00
Philipp Holzer fbd056327a
DBA-Logger fix 2019-04-13 20:46:58 +02:00
Philipp Holzer ec2c84a4e9 code lisibility & filter optimization 2019-03-22 22:55:48 -04:00
Philipp Holzer b2edb85588 Replace "q" calls 2019-03-22 22:55:48 -04:00
Hypolite Petovan 8a48ff1f95 Relax type constraint on limit parameter in Database\DBA 2019-03-20 00:33:26 -04:00
Hypolite Petovan 67aa188830 Improve Logger calls
- Add context in various calls
- Remove deprecated Logger::log call in Processor
2019-02-23 17:32:13 -05:00
Hypolite Petovan 8c1db51a76 Improve Logger calls
- Replace various deprecated Logger::log calls
- Reassign log level for verbose log calls
2019-02-23 17:32:11 -05:00
Philipp Holzer 5f17ce574f
Fixing DBA::(re-)connect() 2019-02-23 12:50:52 +01:00
Philipp Holzer c53f0a4382
Fixing DBA::reconnect() 2019-02-23 12:48:39 +01:00
Philipp Holzer 8c3aebc376
Bugfixings in Config
- replaced usage of "!<unset>!" with null-returns
- fixed bool settings (0/1)
- fixed overriding config-values
- fixed basepath problems
2019-02-22 23:51:13 +01:00
Philipp Holzer eafcf3592d
Config FollowUp
- New Configuration (Config is now only holding the instance)
- New PConfiguration (PConfig is now only holding the instance)

- Config & PConfig-Adapter don't need "ConfigCache" anymore

- DB-Connection is now outside App->reload() for better dependency-chaining
2019-02-17 20:40:27 +01:00
Philipp Holzer 0a7861da65
Dependency of callstack moved one layer up 2019-02-16 23:17:10 +01:00
Philipp Holzer 5e6e1a8025
Introducing Profiler 2019-02-16 23:11:30 +01:00
Philipp Holzer d78ac57514
Updating type-hints and some naming conventions 2019-02-04 09:30:48 +01:00
Philipp Holzer 0f5a50b46b
Bugfixing tests 2019-02-03 22:53:39 +01:00
Philipp Holzer 1e0e1674f2
4) Adding Factories to other entrypoints 2019-02-03 22:46:50 +01:00
Philipp Holzer 4af0119b73
3) Introducing ConfigFactory 2019-02-03 22:22:04 +01:00
Philipp Holzer be6b229534
1) Refactor App->config[] into Core\Config 2019-02-03 18:54:25 +01:00
Hypolite Petovan 8a554fef2d Fix missing library include in Database\DBstructure 2019-01-23 21:22:26 -05:00
Hypolite Petovan 1ee1d7ef4e Add new PostUpdate function to initialize delivery data 2019-01-23 00:02:00 -05:00
Hypolite Petovan 4a95ca280d Remove unused code
- Remove commented code
- Remove unused/immediately overwritten variables
- Remove extraneous parameters
- Remove unreachable code
- Remove duplicate array keys
2019-01-21 10:48:40 -05:00
Hypolite Petovan cb3f09ae4f Refactor namespaces
- Remove unused use statements
- Add required use statements
- Escape global classes
2019-01-21 10:43:42 -05:00
Hypolite Petovan 3282ce5389 Fix PHPDoc comments project-wide 2019-01-21 10:35:51 -05:00
Jeroen De Meerleer ff180fb0f1 Updated towards code review 2019-01-21 09:12:38 -05:00
Jeroen De Meerleer a224308d42 4 spaces to tab 2019-01-21 09:12:37 -05:00
Jeroen De Meerleer 0906c3532c Added post-update script
Please review first. I don't want to test changes that are not going pass the review.
2019-01-21 09:12:37 -05:00
Michael 5554448162 Now storing the "manually approve" data / fix update routine 2019-01-14 06:36:08 +00:00
Hypolite Petovan 5e1ceb57de Escape global namespaced get_app() calls
- Add deprecated status
2019-01-03 21:27:36 -05:00
Hypolite Petovan acaee626f5 Remove include/ requires that are now done directly from Composer 2018-12-24 09:56:25 -05:00
Hypolite Petovan d53ff9c34d Add support for FULLTEXT indices in Database\DBStructure 2018-12-23 15:40:49 -05:00
Hypolite Petovan 48a356dba2 Fix formatting in Database\DBStructure 2018-12-23 15:32:23 -05:00
Hypolite Petovan c5558cc459
Merge pull request #6224 from annando/dba-delete-contact
Avoid duplicated contacts, improve contact deletion, avoid memory issues
2018-12-02 16:16:59 -05:00
Michael 066a040cc7 Avoid duplicated contacts, improve contact deletion, avoid memory issues 2018-12-02 16:25:25 +00:00
Hypolite Petovan 458981f75c Replace x() by isset(), !empty() or defaults()
- Remove extraneous parentheses around empty() calls
- Remove duplicate calls to intval(), count() or strlen() after empty()
- Replace ternary operators outputting binary value with empty() return value
- Rewrite defaults() without x()
2018-11-30 09:06:22 -05:00
Hypolite Petovan 6eb6cc94c7 Move config/dbstructure.php to config/dbstructure.config.php 2018-11-25 01:14:44 -05:00
fabrixxm c13e078c42 dbstructure: check for comment value or use default
fix #6119
2018-11-17 11:43:01 +01:00
Philipp Holzer 270e817954
Adding force to update routine
- Introduced Cache::NEVER Lock (never expiring lock)
- Force flag for dbstructure update
- Moving the business logic to central place in Update class
2018-10-31 14:44:40 +01:00
Philipp Holzer 87f3fe24f7
Moving UPDATE defines/constants out of boot 2018-10-31 14:44:23 +01:00
Adam Magness 50da89d861 Logger Levels
update logger levels in calls
2018-10-30 09:58:45 -04:00
Adam Magness 14fde5dc9b Log function
implement log() function.
2018-10-30 09:57:14 -04:00
Hypolite Petovan a22196edae Add/Fix Doxygen headers for classes 2018-10-22 16:50:55 -04:00
Hypolite Petovan 2debdbd0c9 Fix dbstructure console outputting addon structure as well 2018-10-22 16:50:55 -04:00
Hypolite Petovan 19ffc0510b Move DB_UPDATE_VERSION from boot.php to config/dbstructure.php 2018-10-22 16:50:55 -04:00
Hypolite Petovan fad99b8619 Switch from dbstructure.json to dbstructure.php 2018-10-22 16:50:55 -04:00
Hypolite Petovan e511790d62 Move NULL_DATE from boot.php to DBA::NULL_DATETIME
- Add DBA::NULL_DATE constant
2018-10-22 16:50:55 -04:00
Hypolite Petovan 4ffcb77554 Simplify L10n::t + sprintf instances 2018-10-20 09:02:35 -04:00
Hypolite Petovan a8d3a4d218 Add missing L10n::popLang calls 2018-10-20 09:02:10 -04:00
Michael Vogel 389685e099
Merge pull request #5920 from MrPetovan/bug/remove-password-from-register
Avoid storing plaintext password in register table
2018-10-17 21:04:11 +02:00
Hypolite Petovan 481b0ac138 Fix notices in include/enotify 2018-10-15 23:13:00 -04:00
Hypolite Petovan 7f143c3159 Fix various spelling mistakes 2018-10-14 11:32:54 -04:00
Philipp Holzer 5a02e39a65
Rename App Methods
- renamed a lot of App methods to CamelCase
- replaced direct public variables with get-/set-Methods
2018-10-10 00:16:06 +02:00
Michael 5250552fe2 Removed obsolete post update that sometimes never finishes 2018-09-02 17:48:25 +00:00
Michael Vogel cf6140e86f Ensure that the post update doesn't end prematurely (#5684) 2018-08-28 07:56:25 -04:00
Roland Häder 61693419e8 Cleanups: isResult() more used, readability improved (#5608)
* [diaspora]: Maybe SimpleXMLElement is the right type-hint?

* Changes proposed + pre-renaming:
- pre-renamed $db -> $connection
- added TODOs for not allowing bad method invocations (there is a
  BadMethodCallException in SPL)

* If no record is found, below $r[0] will fail with a E_NOTICE and the code
doesn't behave as expected.

* Ops, one more left ...

* Continued:
- added documentation for Contact::updateSslPolicy() method
- added type-hint for $contact of same method
- empty lines added + TODO where the bug origins that $item has no element 'body'

* Added empty lines for better readability

* Cleaned up:
- no more x() (deprecated) usage but empty() instead
- fixed mixing of space/tab indending
- merged else/if block goether in elseif() (lesser nested code blocks)

* Re-fixed DBM -> DBA switch

* Fixes/rewrites:
- use empty()/isset() instead of deprecated x()
- merged 2 nested if() blocks into one
- avoided nested if() block inside else block by rewriting it to elseif()
- $contact_id is an integer, let's test on > 0 here
- added a lot spaces and some empty lines for better readability

* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)

* Rewrites:
- moved PAGE_* to Friendica\Model\Profile class
- fixed mixure with "Contact::* rewrite"

* Ops, one still there (return is no function)

* Rewrite to Proxy class:
- introduced new Friendica\Network\Proxy class for in exchange of proxy_*()
  functions
- moved also all PROXY_* constants there as Proxy::*
- removed now no longer needed mod/proxy.php loading as composer's auto-load
  will do this for us
- renamed those proxy_*() functions to better names:
  + proxy_init()           -> Proxy::init()         (public)
  + proxy_url()            -> Proxy::proxifyUrl()   (public)
  + proxy_parse_html()     -> Proxy::proxifyHtml()  (public)
  + proxy_is_local_image() -> Proxy::isLocalImage() (private)
  + proxy_parse_query()    -> Proxy::parseQuery()   (private)
  + proxy_img_cb()         -> Proxy::replaceUrl()   (private)

* CR request:
- moved all PAGE_* constants to Friendica\Model\Contact class
- fixed all references of both classes

* Ops, need to set $a here ...

* CR request:
- moved Proxy class to Friendica\Module
- extended BaseModule

* Ops, no need for own instance of $a when self::getApp() is around.

* Proxy-rewrite:
- proxy_url() and proxy_parse_html() are both non-module functions (now
  methods)
- so they must be splitted into a seperate class
- also the SIZE_* and DEFAULT_TIME constants are both not relevant to module

* No instances from utility classes

* Fixed error:
- proxify*() is now located in `Friendica\Util\ProxyUtils`

* Moved back to original place, ops? How did they move here? Well, it was not
intended by me.

* Removed duplicate (left-over from split) constants and static array. Thank to
MrPetovan finding it.

* Renamed ProxyUtils -> Proxy and aliased it back to ProxyUtils.

* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Ops, was added accidentally ...

* Ops, why these wrong moves?

* Ops, one to much (thanks to MrPetovan)

* Ops, wrong moving ...

* moved back to original place ...

* spaces added

* empty lines add for better readability.

* convertered spaces -> tab for code indenting.

* CR request: Add space between if and brace.

* CR requests fixed + move reverted
- ops, src/Module/*.php has been moved to src/Network/ accidentally
- reverted some parts in src/Database/DBA.php as pointed out by Annando
- removed internal TODO items
- added some spaces for better readability
2018-08-24 01:05:49 -04:00
Michael Vogel dc3d2d5988 "dba" is now "DBA". This hadn't been respected at some places (#5655)
* "dba" is now "DBA". This hadn't been respected at some places

* Cleaning up unneeded stuff
2018-08-23 09:51:58 -04:00
Michael Vogel 16a081871c Improved profile page, improved "limit" handling (#5639)
* Improved profile page, improved "limit" handling

* Update will now work again

* Update will work now
2018-08-20 06:26:05 +02:00
Roland Häder e06fc2aa69 Stopped using deprecated constants NETWORK_* (#5537)
* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Removed deprecated NETWORK_* constants as per code reviewer's request.
2018-08-11 22:40:44 +02:00
Michael 5037f9c460 Console script to ensure that all post updates are finished 2018-08-10 21:20:25 +00:00