Commit Graph

64 Commits

Author SHA1 Message Date
Toby Zerner
bd50a23966 Update json-api dependency 2016-03-31 20:02:42 +10:30
Franz Liedke
9e79470603 Update fig-cookies dependency and use new shortcut 2016-03-31 09:43:17 +09:00
Franz Liedke
77086c9be6 Travis: Do not run PhpUnit through Composer
We need to run PhpUnit with xDebug enabled in order to collect
code coverage information. It is disabled for performance reasons,
though: https://github.com/travis-ci/travis-ci/issues/5780.
2016-03-21 23:12:09 +09:00
Franz Liedke
3c629f091d Travis: Generate code coverage report when running tests 2016-03-21 20:21:51 +09:00
Franz Liedke
eef895c16f Composer: Sort dependencies alphabetically 2016-03-20 22:27:43 +09:00
Franz Liedke
2be964f8e2 Update to latest version of text-formatter 2016-03-20 22:25:45 +09:00
Toby Zerner
2391471937 Clean up linting stuff. closes #852 2016-03-10 17:13:30 +10:30
Franz Liedke
db7a03fbe5 Add some handy shortcuts for typical migration tasks
This will make it much easier for extension developers (and also less
error-prone) to create migrations for things like creating tables,
renaming columns and so on...
2016-02-25 00:50:03 +09:00
Toby Zerner
fb09cef540 Merge pull request #748 from JoshyPHP/Minifiers
Added support for new minifiers
2016-02-07 11:37:15 +10:30
Toby Zerner
2980c94247 Add Composer branch-alias
This allows installations to require version 0.1.0 with minimum-stability=dev, and they will get the latest from master.

See #727
2016-01-19 17:00:10 +10:30
JoshyPHP
09ad4a180b Added support for new minifiers 2016-01-15 16:59:56 +01:00
Toby Zerner
973ca16eee Add base OAuth2 controller 2015-12-05 15:25:10 +10:30
Toby Zerner
387109002e Rework sessions, remember cookies, and auth again
- Use Symfony's Session component to work with sessions, instead of a custom database model. Separate the concept of access tokens from sessions once again.
- Extract common session/remember cookie logic into SessionAuthenticator and Rememberer classes.
- Extract AuthenticateUserTrait into a new AuthenticationResponseFactory class.
- Fix forgot password process.
2015-12-05 15:11:25 +10:30
Franz Liedke
61b09ac982 Update text-formatter dependency 2015-11-19 13:00:32 +01:00
Franz Liedke
17619843b5 Update to newest version of Whoops middleware 2015-10-31 12:56:38 +01:00
Toby Zerner
7d4a04760c Use stable version of tobscure/json-api 2015-10-31 10:08:37 +10:30
Kirk Bushell
f0883471ef Updated tests namespace to be ps4-valid. Added tests for flooding exception, fixed broken code 2015-10-27 12:48:27 +00:00
Toby Zerner
c08b62af80 Refactor translation and validation
We now use Symfony's Translation component. Yay! We get more powerful pluralisation and better a fallback mechanism. Will want to implement the caching mechanism at some point too. The API is replicated in JavaScript, which could definitely use some testing.

Validators have been refactored so that they are decoupled from models completely (i.e. they simply validate arrays of user input). Language packs should include Laravel's validation messages.

ref #267
2015-10-15 22:30:45 +10:30
Franz Liedke
a23180f279 Revert previous commit 2015-10-14 13:52:52 +02:00
Franz Liedke
cc68c6f503 Fix version constraint for tobscure/json-api 2015-10-14 13:42:18 +02:00
Franz Liedke
d0a188bc42 Require version 0.1 of Whoops middleware 2015-10-14 13:40:02 +02:00
Franz Liedke
7b49f3c24c Clean up 2015-10-14 07:50:42 +02:00
Toby Zerner
8e5b13903e Add more info to composer.json 2015-10-11 11:18:30 +10:30
Toby Zerner
dd67291ce0 Major refactor and improvements
- Reorganised all namespaces and class names for consistency and structure. Following PSR bylaws (Abstract prefix, Interface/Trait suffix).
  - Move models into root of Core, because writing `use Flarum\Core\Discussion` is nice. Namespace the rest by type. (Namespacing by entity was too arbitrary.)
  - Moved some non-domain stuff out of Core: Database, Formatter, Settings.
  - Renamed config table and all references to "settings" for consistency.
  - Remove Core class and add url()/isInstalled()/inDebugMode() as instance methods of Foundation\Application.
  - Cleanup, docblocking, etc.

- Improvements to HTTP architecture
  - API and forum/admin Actions are now actually all the same thing (simple PSR-7 Request handlers), renamed to Controllers.
  - Upgrade to tobscure/json-api 0.2 branch.
  - Where possible, moved generic functionality to tobscure/json-api (e.g. pagination links). I'm quite happy with the backend balance now re: #262

- Improvements to other architecture
  - Use Illuminate's Auth\Access\Gate interface/implementation instead of our old Locked trait. We still use events to actually determine the permissions though. Our Policy classes are actually glorified event subscribers.
  - Extract model validation into Core\Validator classes.
  - Make post visibility permission stuff much more efficient and DRY.

- Renamed Flarum\Event classes for consistency. ref #246
  - `Configure` prefix for events dedicated to configuring an object.
  - `Get` prefix for events whose listeners should return something.
  - `Prepare` prefix when a variable is passed by reference so it can be modified.
  - `Scope` prefix when a query builder is passed.

- Miscellaneous improvements/bug-fixes. I'm easily distracted!
  - Increase default height of post composer.
  - Improve post stream redraw flickering in Safari by keying loading post placeholders with their IDs. ref #451
  - Use a PHP JavaScript minification library for minifying TextFormatter's JavaScript, instead of ClosureCompilerService (can't rely on external service!)
  - Use UrlGenerator properly in various places. closes #123
  - Make Api\Client return Response object. closes #128
  - Allow extensions to specify custom icon images.
  - Allow external API/admin URLs to be optionally specified in config.php. If the value or "url" is an array, we look for the corresponding path inside. Otherwise, we append the path to the base URL, using the corresponding value in "paths" if present. closes #244
2015-10-08 14:28:02 +10:30
Toby Zerner
0142b01cc5 Add server 2015-10-02 17:47:12 +09:30
kirkbushell
c3374197d1 Added zend-stragility (missing), removed some redundant code. 2015-09-28 15:59:07 +01:00
kirkbushell
bac3fe84da Moved psr-4 loading for tests out of the autoload 2015-09-28 15:44:35 +01:00
kirkbushell
a00226c05a Added some tests for the database setting repository 2015-09-28 15:34:32 +01:00
kirkbushell
7706714ad9 Removed phpsec as the testing library, added phpunit and converted the first spec test to phpunit format. Also added mockery. 2015-09-28 15:09:13 +01:00
Franz Liedke
4c6e03a692 Update TextFormatter
Fixes #532.
2015-09-23 09:03:24 +02:00
Daniel Klabbers
a2b43f6f78 version constraint must match laravel dependancies at least 2015-09-16 09:56:19 +02:00
Toby Zerner
a2def83045 Update dependencies 2015-09-14 18:45:49 +09:30
Toby Zerner
b7d8afe6a4 Add doctrine/dbal dependency so that migrations can rename columns 2015-09-14 15:31:05 +09:30
Franz Liedke
ba097dc147 Add Composer scripts 2015-08-30 14:59:10 +02:00
Toby Zerner
b49b3a14b4 Add flysystem dependency 2015-08-25 19:32:15 +09:30
Toby Zerner
ec2aa371b1 Fix installer issues 2015-08-17 14:32:38 +09:30
Toby Zerner
609d1825f3 Add missing dependency 2015-08-13 10:12:39 +09:30
Toby Zerner
47595ff9c4 Decouple from Laravel, implement translator 2015-08-12 18:33:39 +09:30
Toby Zerner
9f0358bb39 Update to Laravel 5.1
Eloquent `lists()` now returns a collection
2015-08-12 13:24:11 +09:30
Franz Liedke
0adf57b918 Update JSON-API dependency 2015-08-12 00:23:27 +02:00
Toby Zerner
a0fe68272c Implement TextFormatter for posts
Get rid of formatting on user bios, we'll do that with JavaScript
2015-07-22 16:03:48 +09:30
Franz Liedke
8a1b2fcede Install PhpSpec 2015-07-15 23:47:30 +02:00
Franz Liedke
38989a61bd Switch to stable version constraints where possible 2015-07-01 20:50:41 +02:00
Franz Liedke
074f8087fa Update FastRoute
This enables optional route parameters.

Required some code changes in the RouteCollection class; once we
actually use optional route parameters, we will have to see whether
route generation for those works as expected.

Closes flarum/core#108
2015-06-26 23:09:58 +02:00
Franz Liedke
391c510f90 Upgrade Zend Diactoros to 1.1
This gives us a bunch of handy helper classes for empty responses,
redirects, HTML and JSON content types.

Closes flarum/core#153
2015-06-26 22:38:43 +02:00
Franz Liedke
c2df8d5214 Merge branch 'master' into psr-7
Conflicts:
	composer.json
	composer.lock
	src/Api/Actions/TokenAction.php
	src/Core/Formatter/FormatterManager.php
	src/Core/Handlers/Events/EmailConfirmationMailer.php
	src/Forum/Actions/ConfirmEmailAction.php
	src/Forum/Actions/IndexAction.php
	src/Forum/Actions/ResetPasswordAction.php
	src/Forum/Actions/SavePasswordAction.php
	src/Forum/routes.php
2015-06-06 13:59:59 +02:00
Franz Liedke
9564778701 Upgrade to stable cookie dependency 2015-06-03 10:17:59 +02:00
Franz Liedke
d462eb585e Convert forum app to be PSR-7 compatible.
I also installed one new dependency: a helper library that makes it
easier to read and write cookies, given that there are no helper methods
for these purposes in the PSR-7 standard.
2015-06-03 02:04:57 +02:00
Toby Zerner
6cf1dbe648 Add HTMLPurifier after formatters are run.
After a morning of searching, it seems there is no PHP Markdown library
that has built-in XSS/sanitization support. The recommended solution is
to use HTMLPurifier.

This actually works out OK, though, as it’s probably a good idea to
enforce sanitization regardless of which formatters are enabled, and to
not leave them with the responsibility of sanitization (it’s a big
responsibility). Since we cache rendered posts, the slow speed of
HTMLPurifier isn’t a concern.

Note that HTMLPurifier requires a file to be loaded by Composer, but
Studio does not yet support this, so for now I have included it
manually.
2015-06-02 11:36:25 +09:30
Franz Liedke
22c0f3ec9e Require FastRoute and the PSR-7 interfaces. 2015-05-27 01:49:14 +02:00