Commit Graph

281 Commits

Author SHA1 Message Date
Philipp Holzer d43a8184f4
2) Refactor App->config[] into Core\PConfig 2019-02-03 19:04:41 +01:00
Philipp Holzer be6b229534
1) Refactor App->config[] into Core\Config 2019-02-03 18:54:25 +01:00
rabuzarus 0993f3e6ef fix isssue if friendica is installed into a subdirectory 2019-01-30 01:00:40 +01:00
Hypolite Petovan 7f2dc40601 Fix potential bugs without expected behavior change
- Fix uninitialized variables
- Fix potentially not set variables
- Fix wrong parameter default value
- Fix method scope
- Fix missing return value
2019-01-21 11:04:19 -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
Philipp Holzer 2e602afd3e Add Monolog 2019-01-21 10:10:40 -05:00
Hypolite Petovan 2f49c4a058 Revert "Add monolog" 2019-01-21 10:08:09 -05:00
Philipp Holzer 6e48df2163 Refactor Loglevels 2019-01-21 10:00:46 -05:00
Philipp Holzer 6150c2fa9c Bugfixing 2019-01-21 09:59:11 -05:00
Philipp Holzer 8f9c0fe149 Adding Develop and normal Logging instances 2019-01-21 09:59:08 -05:00
Philipp Holzer fe8f0e0045 Add Monolog 2019-01-21 09:58:05 -05:00
Hypolite Petovan 55e54bb950 Replace deprecated Addon::callHooks with Hook::callAll
- Update documentation
2019-01-21 09:50:56 -05:00
fabrixxm 75daf96590 Revert "Catch HTTPExceptions in App::runFrontend()"
This reverts commit 58bd75f8f3.
2019-01-21 08:59:59 -05:00
fabrixxm 89eaf508f1 Catch HTTPExceptions in App::runFrontend()
Set correct http response header, display error message using "404.tpl"
2019-01-21 08:49:17 -05:00
Hypolite Petovan 89cb1b276d Move rawContent before theme initialization 2019-01-19 22:03:49 -05:00
Hypolite Petovan af7b852d04 Insert theme init after module init but before post/content 2019-01-19 21:52:43 -05:00
Michael 2a0e18c7dd Bugfix: Theme functions hadn't been executed anymore 2019-01-18 20:08:35 +00:00
Hypolite Petovan f6092ebebb Add App->mobileDetect property 2019-01-11 20:48:29 -05:00
Hypolite Petovan 979230da27 Allow theme setting in module
- Restore theme name caching
2018-12-29 15:40:04 -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 607f7daf51 Add PHP 5 compatible recursive dirname() 2018-12-15 02:46:08 -05:00
Michael Vogel 5a3991d4f7
Merge pull request #6219 from MrPetovan/task/remove-x
Remove x()
2018-12-01 23:40:51 +01: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
Michael 4a1f9a9bdd Improved url detection for redirects 2018-11-30 11:27:17 +00:00
Hypolite Petovan d6eb1135e5 Add support for PHP array config files
- Add new base config files
- Remove useless DIRECTORY_SEPARATOR instances
2018-11-25 01:42:05 -05:00
Jonny Tischbein 9aea59d4e3 Change Worker to use only MemFree in isMinMemoryReached 2018-11-19 23:21:40 +01:00
Hypolite Petovan 09c94dba86 Add URL encoding to toggle_mobile parameter 2018-11-10 08:55:48 -05:00
Adam Magness ffc406d819 normalise_link calls
implement normaliseLink function
2018-11-08 11:28:29 -05:00
Adam Magness 5276c28a78 link_compare calls
implement compareLink function.
2018-11-08 10:46:50 -05:00
Hypolite Petovan 8a46c786f3
Merge pull request #6053 from zeroadam/CoreRenderer
Core Renderer Class
2018-10-31 13:57:12 -04:00
Adam Magness 70f01d6c00 Template Engine and props to Renderer
move methods and props from App to Renderer
2018-10-31 13:25:38 -04:00
Adam Magness 3f74ba88c2 Move delimiter props and functions
move left and right delimiter functions and properties to Render class.
2018-10-31 12:12:15 -04:00
Adam Magness 35abc4bb64 get markup template
implement getMarkupTemplate function
2018-10-31 10:44:06 -04:00
Adam Magness 91facd2d0a replace macros
implement new replaceMacros function
2018-10-31 10:35:50 -04:00
Philipp Holzer f08f063a38
Replaced check_db in App 2018-10-31 14:44:24 +01:00
Adam Magness c3ee9afa59 Bug fix
update Logger::DEBUG to Core\Logger::
2018-10-30 11:43:27 -04: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
Philipp Holzer e586e49c82
Bugfixing missing 'REQUEST_URI' for relative path installation 2018-10-30 12:58:15 +01:00
Hypolite Petovan 4bcd2d7708 Declare missing `$lang` for default template in App->runFrontend 2018-10-26 08:13:31 -04:00
Hypolite Petovan 14237a9599 Move $pager and $page_offset out of App
- Move infinite scroll data output in a module hook
- Use Pager instead of paginate() and alt_pager()
2018-10-25 00:07:15 -04:00
Philipp Holzer 072eeb8bec
making english sentences 2018-10-24 20:52:38 +02:00
Philipp Holzer 99a33b7335
Code standards 2018-10-24 20:44:19 +02:00
Philipp Holzer 310d49b82a
removed use Friendica\Core\System again 2018-10-24 20:24:22 +02:00
Philipp Holzer 48535c0959
Bugfixing redirects
- Adding App->redirect if both redirects are possible
2018-10-24 20:18:46 +02:00
fabrixxm 035603a516 Replace Frienica\Core\Addon::isApp() withi Friendica\Core\Hook::isAddonApp()
fix #6010
2018-10-23 17:27:53 +02:00
Philipp Holzer 3e6ea9383b
Making redirect message more informative 2018-10-23 12:17:41 +02:00
Hypolite Petovan b6a0b686c4
Fix missing instance of Addon::isEnabled in App 2018-10-22 21:09:53 -04:00
Hypolite Petovan 373df31817
Fix wrong namespace for Core\System in App 2018-10-22 18:07:00 -04:00
Hypolite Petovan f6e064195a
Fix Fatal Error in App 2018-10-22 18:01:17 -04:00
Hypolite Petovan 9eaedc576c Remove unused dbstructure hook call in App->loadDatabase 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 ca9cad3491 Move hook-related methods from Core\Addon to Core\Hook 2018-10-22 16:50:54 -04:00
Michael Vogel c0abff0bda
Merge pull request #5990 from MrPetovan/task/move-apps-out-of-app
Road to Router Part 4: Move $apps out of App
2018-10-22 22:47:22 +02:00
Philipp Holzer 3072c56057
goaway fix in App 2018-10-22 22:15:50 +02:00
Philipp Holzer a9510ffcdf
description fix 2018-10-22 22:13:37 +02:00
Philipp Holzer d00ddc01af
Split goaway to System::externalRedirectTo() and App->internalRedirect() 2018-10-22 22:13:35 +02:00
Philipp Holzer 2ef81108b3
Renamed System::redirect() to $a->redirect() 2018-10-22 22:13:22 +02:00
Benjamin Lorteau 339a5da946 Move $apps out of App
- Move $nav_sel out of App
- Add new Content\Nav::getAppMenu() method
2018-10-22 16:02:15 -04:00
Hypolite Petovan c6f0bea51d Move $strings from App to Core\L10n
- Add L10n::init() call in App constructor
- Improve pushLang/popLang
- Remove no longer needed references to App
2018-10-22 15:58:42 -04:00
Benjamin Lorteau 37f00b5fd1 Use System::httpExit for 403 error in App 2018-10-22 15:16:59 -04:00
Hypolite Petovan a0bd96d587 Remove unwarranted doxygen comments in App 2018-10-22 08:17:55 -04:00
Hypolite Petovan e2c5a423c5 Improve App->runFrontend formatting
- Use single-quotes instead of double
- Use strpos() instead of substr()
- Add/remove comments
- Use Config::get default value and drop the exact match for config.private_addons
2018-10-22 00:07:56 -04:00
Hypolite Petovan 279196959c Move index.php content to App->runFrontend
- Replace all x() by !empty() in App
- Replace all killme() with exit()
2018-10-21 22:24:47 -04:00
Philipp Holzer 4392858662
Move Global Functions - Part 3
- Replaced every CACHE definition
- Moved check_url to App->checkURL()
- Removed unused definition "ZCURL_TIMEOUT"
2018-10-20 18:19:55 +02:00
Philipp Holzer 4f7cb049fb
isAjax bugfix 2018-10-13 19:10:46 +02:00
Philipp Holzer 2c541afd47
Moved functions out of boot.php into class
- z_root() => $a->getBaseURL()
- absurl() => removed because no usage
- is_ajax() => $a->isAjax()
- current_load() => System::currentLoad()
- argc() => $a->argc
- argv($x) => $a->getArgumentValue($x)
2018-10-13 19:03:08 +02:00
Hypolite Petovan ac1ff6c8ce Try additional $_SERVER properties to get relative path of Friendica 2018-10-11 08:54:45 -04:00
Philipp Holzer 97dc4bba1a
some more renamings & doku 2018-10-10 09:16:06 +02:00
Philipp Holzer 3d04562c87
some more renamings & doku 2018-10-10 08:54:18 +02:00
Philipp Holzer 307286fc47
parameters and getURLpath to getURLPath 2018-10-10 01:18:47 +02:00
Philipp Holzer 3eb4332f33
Bugfixing Backend 2018-10-10 01:16:51 +02: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
Philipp Holzer 31148e25cf
Changing Friendica\App\Mode from static methods to public methods
- Changing from static methods to public methods
- Adding dev-composer-dependency Mockery for static method mocking (f.e. Config, DBA)
- Adding ModeTest with Mocking
- removing bootstrap from phpunit.xml because of double loading tests\bootstrap.php
2018-10-06 16:27:20 +02:00
Philipp Holzer 947cc98cc4
delete unused use 2018-10-05 22:41:11 +02:00
Philipp Holzer 065340dc32
Creating Friendica\App\Mode for encapsulating the App Mode 2018-10-05 22:36:09 +02:00
Michael Vogel 103535d620
Merge pull request #5773 from MrPetovan/task/rewrite-js-hooks
Rewrite JS hooks
2018-10-01 17:10:30 +00:00
Hypolite Petovan adbc1d3224 Missing $a to $this conversion in App 2018-09-22 12:45:49 -04:00
Benjamin Lorteau 489d5f41d2 Add Doxygen headers for multiple function in App 2018-09-21 09:54:40 -04:00
Benjamin Lorteau f0cdd25e34 Register Friendica stylesheet using App->registerStylesheet()
- Remove mentions of {{$stylesheet}} in head.tpl templates
2018-09-21 09:54:09 -04:00
Hypolite Petovan 2ae6556b32 Add new 'head' hook
- Add new App->registerStylesheet method
- Reworked App->init_pagehead into App->initHead
2018-09-20 21:30:51 -04:00
Hypolite Petovan 1eaa523e61 Remove unused App->page['end']
- Remove unused empty templates
2018-09-20 21:02:28 -04:00
Hypolite Petovan 55f1d7b90e Add new footer hook
- Add new App->footerScripts array
- Add footer.tpl template
- Add documentation
- Rework App->init_page_end to App->initFooter
2018-09-20 21:01:05 -04:00
Hypolite Petovan 791a77f441 Add overwrite parameter to App->loadConfigFile 2018-09-08 02:37:53 -04:00
Michael 821429fdf1 Good news, everyone - again somce notices removed 2018-09-04 17:48:09 +00:00
Philipp 2838e4ebaf Automatic Install Tests & Doku (#5674)
* Automatic Installation Testing
- New dev-library "mikey179/vfsStream"
- created "reload" method for App-Reloads
- ConsoleTest now using virtual directory
- Adding Automatic Installation Tests
- Fixing some probable install-failures

* Updating README for Automatic Installation

* Updating README for Automatic Installation

* Bugfix normal installation

* Fixing copying of config files
2018-08-27 00:15:55 -04:00
Philipp d7395299fb Automatic Installation fix (#5565)
* Automatic Install Config Fix

* new unittest for AutomaticInstallation

* unittest for autoinstall
- removed password check

* removed bak-file

* automatic install
- always save environment variables
- just skip db environment if not `--savedb` is set

* fixed help (options)

* fixed help (options)

* Deleting Auto-Install tests until fix for proper DB restoring
2018-08-20 16:15:39 -04:00
Hypolite Petovan 45de8a28cd Fix missing $_SESSION variable in src/App 2018-08-05 15:56:21 +02:00
Michael Vogel a2cea16954 Some more notices (#5526)
* Some more notices

* Fixed nasty to find notice in DFRN and OStatus

* And more notices ...

* Yeah, some removed notices ... again ...
2018-07-30 06:41:20 +02:00
Michael de984cdaa1 Issue 5467: Fix worker and daemon 2018-07-24 03:42:44 +00:00
Hypolite Petovan ecea7425f8 Rename DBA::is_result to DBA::isResult 2018-07-23 11:04:14 -04:00
Hypolite Petovan 0ec44f3e8a Rename DBM method calls to DBA method calls 2018-07-23 11:02:24 -04:00
Hypolite Petovan 38f341e064
Add missing space between PHP path and script in App->proc_run (#5468) 2018-07-23 10:43:39 -04:00
Michael Vogel 2d0a749734
Merge pull request #5431 from MrPetovan/task/5410-rename-database-methods
Move DBA to src/ part 3.1: Rename DBA methods
2018-07-23 15:18:58 +02:00
Philipp cd52d0b3e9 Using getopt for CLI arguments (#5446)
* Adding Argument class to Friendica

* Adding Argument class to Friendica

* Adding Argument class to Friendica

* fixing arguments for `spawnWorker`

* Adding `use Friendica\BaseObject` to `ApiTest.php`

* Refactoring the argument-usages of Friendica

* Refactoring the argument-usages of Friendica

* removing superfluous []
2018-07-23 07:40:52 -04:00
Hypolite Petovan f051ae1698 Rename DBA::fetch_first to DBA::fetchFirst 2018-07-22 19:27:34 -04:00
Hypolite Petovan af6dbc654f Rename Friendica\Database\dba to Friendica\Database\DBA 2018-07-20 08:19:26 -04:00
Hypolite Petovan daa1177e3a Update use statement lists with new Friendica\Database\dba class
- Remove unused use statement
- Remove superfluous use statements (classes in the same namespace)
- Add missing use statements
2018-07-19 22:15:21 -04:00
Michael Vogel 01b67c4eb3 Little fixes (#5414)
* We now store the item delivery data in a separate table

* Reorganized table structure

* Fix  a notice when using the profiler / ensure that permissions are strings
2018-07-19 18:40:39 -04:00
Hypolite Petovan d993c8584c Add support for legacy $lang config in App->loadConfig 2018-07-17 02:05:52 -04:00
Hypolite Petovan 007ec92ae4 Remove exception for legacy config file in App->loadDatabase 2018-07-17 02:05:36 -04:00
Hypolite Petovan bad2774817 Separate default config values between file-only and admin settings 2018-07-16 19:38:19 -04:00
Hypolite Petovan 9b01a23c9b Code standards in App 2018-07-16 19:38:19 -04:00
Hypolite Petovan 3001951075 Move the addon-specific config in config/addon.ini.php
- Add sample addon.ini.php file
- Add config/addon.ini.php file to git ignore
2018-07-16 19:38:18 -04:00
Hypolite Petovan bd04c03c9f Fix urlpath determination on the root page 2018-07-16 19:38:17 -04:00
Hypolite Petovan e98216b5bb Improve comparison in App->loadDatabase() 2018-07-16 19:38:15 -04:00
Hypolite Petovan d8096a402c Update use of environment variables in loadDatabase 2018-07-16 19:38:15 -04:00
Hypolite Petovan cd9b864045 Rework App modes
- Replace App mode constants with capability-based flags
- Add App->isInstallMode()
- Add file config fallback in (P)Config abstraction
- Removed logger disabling code
2018-07-16 19:38:15 -04:00
Hypolite Petovan d487c399dd Standards: Rename App methods
- Rename App->max_processes_reached to App->isMaxProcessesReached
- Rename App->maxload_reached to App->isMaxLoadReached
2018-07-16 19:38:14 -04:00
Hypolite Petovan 73b4e0552d Fix wrong urlpath determination 2018-07-16 19:38:14 -04:00
Hypolite Petovan 2e2930d770 Add addon config hook 2018-07-16 19:38:14 -04:00
Hypolite Petovan decfc553f7 Set BaseObject::setApp in App 2018-07-16 19:38:13 -04:00
Hypolite Petovan e952d6677b Rename App->path to App->urlpath 2018-07-16 19:38:13 -04:00
Hypolite Petovan 5fdff3d813 Centralize startup steps in Friendica\App
- Add loadDatabase startup step
- Add loadConfigFiles startup step
- Remove startup() in boot.php
- Replace App::checkMaintenanceMode() with App::determineMode()
2018-07-16 19:38:13 -04:00
miqrogroove b5fe1c60a9 Fix Broken Profile Links (#5286)
* Expose the block_public setting to head.tpl

* Do not include hovercard.js if block_public
2018-07-14 16:31:46 -04:00
Michael Vogel 3792e2819d Use a process identifier for logging that contains the pid (#5359) 2018-07-10 18:32:47 -04:00
Michael Vogel 0360f7197a Several more warnings ... (#5340)
* Some more warnings removed

* Even more warnings ...

* Will it ever end? ;-)

* Avoid warning in dbstructure

* Origin and OStatus ...

* There are more warnings solved ... yeah!

* And again ...

* We are not done yet

* And more ...

* And some new places ...

* And more in the feeds

* Avoid some more

* And some backend stuff

* Notifications cleared

* Some more stuff

* and again ...

* It's getting fewer ...

* Some warnings had been hidden in the notifications

* Fix the fix

* And another missing one ...

* We need the owner here, not the user

* Forgotten user

* And more ...

* And some more warnings disappeared ...

* Some more frontend warnings

* Some backend warnings removed

* Fixed sidebar for "vier"

* And more ...

* Some more ...

* And something for "remote self"

* Am I stuck in an endless loop?

* Fix: Clear tag and file field on update

* Preset page content
2018-07-10 08:27:56 -04:00
Michael 69db696ab1 Improve test behaviour 2018-07-08 05:29:06 +00:00
Hypolite Petovan 58e1470ddb Fix Undefined index: HTTP_USER_AGENT in App 2018-07-02 22:19:21 -04:00
Hypolite Petovan 07e06341df Simplify config.php_path access in App->proc_run 2018-07-02 07:48:33 -04:00
Hypolite Petovan 89e4629c16 Replace system.proc_windows config by PHP_OS test 2018-07-02 07:47:42 -04:00
Hypolite Petovan 28741c8366 Remove startup() function
- Enable notice errors
2018-07-02 07:23:47 -04:00
fabrixxm 574bfecdfd Create config keys if they not exists on set. 2018-06-14 13:18:01 +02:00
rabuzarus c66d1f01a3 add missing database use statements 2018-05-25 09:05:16 +02:00
rabuzarus f013625382 fix typo in comment 2018-05-25 08:52:03 +02:00
rabuzarus 8174bfeb2b Bugfix: compute the current theme each time we want to know which theme is beeing used 2018-05-25 08:44:01 +02:00
Michael 9d0ed1a2af Issue 4956: Don't fail during installation because of a missing theme configuration 2018-05-20 05:44:20 +00:00
Michael f1b5e828db Fix for the slow spawning of workers 2018-05-14 05:02:18 +00:00
Philipp Holzer b4f5311e7f Add Install Mode
- merge `friendica/develop` to `nupplaphil/install_mode`
2018-04-29 20:15:12 +02:00
Hypolite Petovan 964bf3f3cc Add new methods to src
- Add App::getCurrentTheme()
- Add App::getCurrentThemeStylesheetPath()
- Add Theme::getStylesheetPath()
2018-04-28 18:30:13 -04:00
Philipp Holzer a97ad9dc42 Add Install Mode (Part 2)
- Added constants to class `App`
- Added global App-Mode to `dba:connect()` instead parameter `$install`
2018-04-28 12:36:40 +02:00
Philipp Holzer d5b68cd146 Add a App-Mode with defined constants
- Normal Mode = 0
- Install Mode = 1
- Maintenance Mode = 2

Moved Install-Mode check to class `App`

Replaced all maintenance and install checks with $a->mode checks
2018-04-27 21:07:04 +02:00
Philipp Holzer 6973aaefc2 Add Install Mode
- Added $install_mode in Class App instead
- Extracted the install business logic to a new Class Install
- Replaced all $a->module == 'install' with $a->install_mode
2018-04-23 22:56:59 +02:00
Tobias Diekershoff ef8e984c62 noreply should not be translate-able in email addresses 2018-04-11 08:17:44 +02:00
Hypolite Petovan a86d1806ae Add App->getSenderEmailAddress method 2018-04-06 21:47:16 -04:00
Michael 3d487c263e Fixes missing command line argument 2018-03-31 08:19:19 +00:00
Hypolite Petovan 87f2d18554 Move *ConfigValue functions to App 2018-03-06 20:04:04 -05:00
Hypolite Petovan 22fd2409ca Add cache to performance arrays 2018-03-04 23:13:19 -05:00
Hypolite Petovan 42c97db724 Switch register_template_engine() to the only one available
- get_declared_classes() can't be used with autoloading
- Removed killme() to prevent infinite loop during App object
instantiation
2018-02-02 07:46:13 -05:00
Adam Magness 07d306aa37 Finish t() for src
Update t() calls in src folder
2018-01-22 18:03:26 -05:00
Adam Magness b86b04a81a Change plugin to addon
change the use of plugin to addon where appropriate.
2018-01-20 07:48:22 -05:00
Hypolite Petovan ad88b6e3af Fix issues in App.php
- Fix formatting
- Add method visibility
- Remove unused properties
- Remove unused methods
- Remove unused parameters
- Fix implode parameter order (?!)
2018-01-17 00:17:58 -05:00
Hypolite Petovan 78ac7afe9c Move process functions to Model\Process
- Add start|endProcess functions to Core\Worker
2018-01-17 00:17:58 -05:00
Hypolite Petovan e36f2bb1fb Use short form array syntax everywhere
- Add short form array syntax to po2php.php generation
2018-01-15 14:07:17 -05:00
Hypolite Petovan 819592c3bd Fix Scrutinizer issues in mod [_well_know -> contactgroup]
- Remove unused variables and parameter
- Updated function documentation
- Fix formatting
- Add back uninitialized variables
- Simplify nested conditions
2018-01-04 19:42:48 -05:00
Hypolite Petovan 585c00347d Fix PHP notices in boot, index and App
- Use defaults() with $_GET variables in boot
- Initialize $a before checking for object member in boot
- Initilialize the $_SESSION variable for backend mode in index
- Add member variable page_offset to App
2018-01-02 08:09:49 -05:00
Michael Vogel fa11959919
Merge pull request #4095 from MrPetovan/task/fix-phpstan-errors
Fix phpstan errors
2017-12-18 07:28:23 +01:00
Hypolite Petovan 4b5894817e Fix class methods staticity/return value 2017-12-17 15:30:26 -05:00
Hypolite Petovan 916236ce2f Fix docblocks types 2017-12-17 15:27:50 -05:00