Commit graph

729 commits

Author SHA1 Message Date
Alejandro Celaya
bdc93a45b5 Created EntityManagerDecorator to handle the automatic reopening, and removed this behavior from ClosDbConnectionMiddleware 2019-08-02 19:28:10 +02:00
Alejandro Celaya
aff1df32f2 Updated to coding-standard library v1.2.2 2019-08-01 19:49:54 +02:00
Alejandro Celaya
9cb316bdfa Added more headers to inspect while looking for the remote IP address 2019-08-01 18:27:43 +02:00
Alejandro Celaya
f5878a5e7b Ensured EntityManager is reopened by CloseDbConnectionMiddleware after an error closed it 2019-07-31 20:54:41 +02:00
Alejandro Celaya
406de16a0d Ensured database connection is closed even if an error is thrown during dispatch process 2019-07-31 20:08:46 +02:00
Alejandro Celaya
a6727c5382 Fixed coding styles 2019-07-23 22:09:38 +02:00
Alejandro Celaya
173bfbd300 Updated tests to fit current implementations 2019-07-23 22:04:01 +02:00
Alejandro Celaya
999beef349 Fixed GeolocationDbUpdater so that it does not try to interact with the reader if the file does not exist, preventing later errors 2019-07-23 17:07:40 +02:00
Alejandro Celaya
c6fdd8a59f Improvements and ensured LocateVisitsCommand does not swallow exceptions 2019-07-23 16:41:32 +02:00
Alejandro Celaya
4c76df91ce Added ConfigProviderTest for EventDispatcher module 2019-07-20 12:16:31 +02:00
Alejandro Celaya
a1c7e7d5da Updated tests 2019-07-20 12:11:07 +02:00
Alejandro Celaya
f28540a53e Updated GeolocationDbUpdater so that it handles a lock which prevents the db to be updated in parallel 2019-07-20 11:30:26 +02:00
Alejandro Celaya
e0e522c3f5 Updated LocateShortUrlVisit listener so that it updates geolite db is needed 2019-07-20 11:21:00 +02:00
Alejandro Celaya
37e286df48 Created more tests 2019-07-20 10:47:12 +02:00
Alejandro Celaya
bc99ee6ebe Created EventListenerTaskTest 2019-07-19 21:16:09 +02:00
Alejandro Celaya
7e8126a421 Added AsyncEventListenerTest 2019-07-19 21:06:34 +02:00
Alejandro Celaya
af4ee8f7ec Created TaskRunnerTest 2019-07-19 20:59:06 +02:00
Alejandro Celaya
af40e8de5c Improved ListenerProviderFactoryTest 2019-07-19 20:28:56 +02:00
Alejandro Celaya
d086131630 Moved all event-dispatching stuff to its own module 2019-07-19 19:54:39 +02:00
Alejandro Celaya
bccc177414 Created task running system based on event listener which are transparently cast into tasks 2019-07-18 19:07:07 +02:00
Alejandro Celaya
0dfadcbb4a Added package to delegate the execution of event listeners to a swoole task worker 2019-07-14 10:46:31 +02:00
Alejandro Celaya
4380b62715 Fixed event handler not being properly registered as a service 2019-07-13 15:47:19 +02:00
Alejandro Celaya
91698034e7 Added event dispatcher to track when a short URL is visited 2019-07-13 12:04:21 +02:00
Alejandro Celaya
46a27a9d0a Added meta property to ShortUrlDataTransformer 2019-07-08 18:23:38 +02:00
Alejandro Celaya
f45e34cfcf Documented deprecated endpoint 2019-05-05 09:52:49 +02:00
Alejandro Celaya
320c8e2d6b Ensured accepted methods on CORS requests are dynamically fetched from route match when possible 2019-05-05 09:45:35 +02:00
Alejandro Celaya
988de0b96e Updated edit short URL endpoint to be used with patch instead of put 2019-05-05 09:21:57 +02:00
Alejandro Celaya
479760c0ee Created config post processor that parses a simplified config to what shlink expects 2019-04-18 10:37:38 +02:00
Alejandro Celaya
4084e3f0d8 Removed superfluous option from command tester 2019-04-14 22:20:58 +02:00
Alejandro Celaya
4866fe241e Updated LocateVisitsCommand to update the database if needed 2019-04-14 18:00:19 +02:00
Alejandro Celaya
6613cb5c60 Updated amount of days to wait for the GeoLite2 database to be updated 2019-04-14 13:18:03 +02:00
Alejandro Celaya
0f48dd567f Registered GeolocationDbUpdater service and added callable which is invoked when db is going to be updated 2019-04-14 11:19:21 +02:00
Alejandro Celaya
b24511b7b5 Created service that updated GeoLite database when it is older than 7 days 2019-04-14 10:54:01 +02:00
Alejandro Celaya
935562acc9 Created exception to handle cases in which downloading a new geolite db fails 2019-04-14 10:10:20 +02:00
Alejandro Celaya
feb67e76f0 Updated commands 2019-04-14 09:10:00 +02:00
Alejandro Celaya
f27058e255 Updated lang files 2019-04-14 08:59:55 +02:00
Alejandro Celaya
6ddbbb4ba0 Restyled error templates and removed copyright 2019-04-14 08:57:48 +02:00
Alejandro Celaya
68f38fd9fe Dropped support for all caches other than APCu and Array 2019-04-11 22:36:50 +02:00
Alejandro Celaya
734fdf83c1 Added test covering the case in which fetching existing short URLs, more than one result is found 2019-03-30 07:45:57 +01:00
Alejandro Celaya
2906d42f97 Updated how existing short URLs are checked, so that not only the first one matching the slug or url is checked 2019-03-30 07:36:57 +01:00
Alejandro Celaya
34ff831473 Added support to ignore errors in UpdateDbCommand 2019-03-16 11:08:12 +01:00
Alejandro Celaya
6fa255386b Defined config to run database tests against mysql and postgres 2019-03-05 20:36:35 +01:00
Alejandro Celaya
0f81c3ab92 Fixed error when using postgres in a SELECT count query where a ORDER BY was added by mistake 2019-03-05 13:50:44 +01:00
Alejandro Celaya
4b556cd79f Updated to shlinkio coding standard 1.1.0 2019-02-26 22:56:43 +01:00
Alejandro Celaya
0b4c334163 Fixed typo 2019-02-26 22:42:33 +01:00
Alejandro Celaya
312fc0984b Fixed mutation score by provideing more tests 2019-02-26 22:41:04 +01:00
Alejandro Celaya
30bf1c2641 Added tests for new cases with non-locatable addresses 2019-02-26 22:31:07 +01:00
Alejandro Celaya
2d1d7357a3 Given more semantic cases in which a visit cannot be located 2019-02-26 21:39:45 +01:00
Alejandro Celaya
d2fad0128f Fixed bug missing unprocessed visits while iterating and updating, while drastically improving the performance 2019-02-23 09:58:02 +01:00
Alejandro Celaya
091ea974eb Simplified implementation iterating unlocated visits 2019-02-23 07:29:07 +01:00
Alejandro Celaya
7d4de590e5 Created ImplicitLoopPaginatorTest 2019-02-22 19:53:10 +01:00
Alejandro Celaya
292937b962 Updated VisitRepository::findUnlocatedVisits methods so that it paginates the amount of elements loaded in memory 2019-02-22 19:31:03 +01:00
Alejandro Celaya
38cc83a4ee Removed uneeded inline type hints 2019-02-17 20:32:18 +01:00
Alejandro Celaya
687a1cc9c7 Reduced amount of dead lines in tests 2019-02-17 20:28:34 +01:00
Alejandro Celaya
1bcd03b150 Renamed method 2019-02-17 13:21:07 +01:00
Alejandro Celaya
e2abe23895 Defined stricter model to represent one geo location 2019-02-17 13:01:21 +01:00
Alejandro Celaya
580050cb7d Updated to phpstan 0.11 2019-02-17 10:06:34 +01:00
Alejandro Celaya
eab5659163 Added status codes returned by CLI commands 2019-02-16 23:21:40 +01:00
Alejandro Celaya
c0130c997a Deprecated commands to generate secret and charset 2019-02-16 22:53:49 +01:00
Alejandro Celaya
ce7d2d1fb0 Fixed coding styles 2019-02-16 22:04:11 +01:00
Alejandro Celaya
2175b8a7bb Improved tests to increase MSI to 70% 2019-02-16 21:58:14 +01:00
Alejandro Celaya
6c0893cdf8 Improved tests to increase MSI to 69% 2019-02-16 21:24:32 +01:00
Alejandro Celaya
b8cb38ae5c Updated testing tools 2019-02-16 10:53:45 +01:00
Alejandro Celaya
672321abab Removed class which is now part of the installer package 2019-02-04 20:16:29 +01:00
Alejandro Celaya
2059b4050b Removed installer and used external package instead 2019-02-04 20:14:59 +01:00
Alejandro Celaya
abbc66ac07 Unified config for installer tool 2019-02-03 13:12:17 +01:00
Alejandro Celaya
2d18ef5cee Updated installer so that it no longer asks for a charset and instead just generates one 2019-02-03 13:02:12 +01:00
Alejandro Celaya
04d4d4a8d7 Updated GenerateShortUrlCommand to accept the findIfExists flag 2019-02-03 12:11:22 +01:00
Alejandro Celaya
810b25ff14 Added API tests covering creating short URLs with new findIfExists param 2019-02-03 11:01:38 +01:00
Alejandro Celaya
c4fd8d5120 Implemented feature to optionally return an existing short url when all provided params match an existing one 2019-02-03 09:40:32 +01:00
Alejandro Celaya
772494f46f Moved process of sluggifying custom slug to a filter 2019-02-03 08:17:27 +01:00
Alejandro Celaya
594e7da256 Created new findIfExists meta param 2019-02-02 11:05:28 +01:00
Alejandro Celaya
49668547d7 Fixed typo 2019-02-02 11:05:28 +01:00
Alejandro Celaya
4c46aaead8 Improved API tests and added test for short URLs creation 2019-02-02 11:05:28 +01:00
Alejandro Celaya
d61f5faf59 Refactored UrlShortener public method to receibe DTOs instead of primitive params 2019-02-02 11:05:28 +01:00
Alejandro Celaya
5756609531 Deleted deprecated constant 2019-02-02 11:05:28 +01:00
Alejandro Celaya
d289c62532 Fixed config file being deleted by mistake by build script 2019-01-28 10:52:05 +01:00
Alejandro Celaya
d6a7a6ce66 Created new API test 2019-01-27 12:36:22 +01:00
Alejandro Celaya
05c7672de3 Improved API tests by adding fixtures 2019-01-27 12:14:22 +01:00
Alejandro Celaya
76d8fd1023 Improved how API tests are executed 2019-01-27 10:54:04 +01:00
Alejandro Celaya
558e259b84 Minor refactorings 2019-01-27 10:30:38 +01:00
Alejandro Celaya
22d61fead7 Prepared configs for API tests 2019-01-26 10:19:20 +01:00
Alejandro Celaya
c4af1471f0 Simplified and united configs for tests 2019-01-26 09:42:08 +01:00
Alejandro Celaya
87ba7a7179 Updated structure for tests config files 2019-01-26 09:09:57 +01:00
Alejandro Celaya
687d8d91a9 Changed references to functional tests by database tests 2019-01-20 21:49:07 +01:00
Alejandro Celaya
144a5415da Handled connection exceptions in Health action 2018-12-29 13:50:42 +01:00
Alejandro Celaya
d58e24bce5 Created health action related tests 2018-12-29 11:54:28 +01:00
Alejandro Celaya
0f86123ccb Finished health action implementation 2018-12-29 11:54:28 +01:00
Alejandro Celaya
3f65ef998c Created HealthAction 2018-12-29 11:54:28 +01:00
Alejandro Celaya
32070b1fa7 Do not use ServerRequestFactory::fromGlobals in tests 2018-12-25 23:19:36 +01:00
Alejandro Celaya
58dbee10c5 Used DQL for non-dynamic query in VisitRepository 2018-12-19 14:36:03 +01:00
Alejandro Celaya
f8207994dc Removed superfluous method docs 2018-12-19 14:31:52 +01:00
Alejandro Celaya
2030401859 Migrated non-dynamic query to DQL in ShortUrlRepository 2018-12-19 14:29:43 +01:00
Alejandro Celaya
a28c1d17c5 Moved entities mappings from annotations to external config files 2018-12-16 12:08:03 +01:00
Alejandro Celaya
97a9289d5f Created ShlinkTableTest 2018-12-08 14:11:14 +01:00
Alejandro Celaya
1983fc9b67 Added current page message in list short urls CLI command 2018-12-08 12:16:39 +01:00
Alejandro Celaya
bb40d84212 Used ShlinkTable on every location rendering a CLI table 2018-12-08 12:12:11 +01:00
Alejandro Celaya
46a35c553e Created class to wrap CLI table rendering behavior 2018-12-08 11:32:16 +01:00
Alejandro Celaya
080943e810 Updated how Symfony commands are used to fulfill API from v4.2 2018-12-08 10:34:04 +01:00
Alejandro Celaya
c0bdd8fc77 Removed concept of execution context and piped CloseDbConnectionMiddleware always 2018-12-07 19:46:46 +01:00
Alejandro Celaya
737137b19f Added favicon 2018-12-07 09:17:31 +01:00
Alejandro Celaya
a562bc661d Improved CacheFactory class 2018-12-06 21:05:11 +01:00
Alejandro Celaya
7c5825d1bc Removed custom AccessLogFactory by updating to zend-expressive-swoole 2.2 2018-12-05 21:26:19 +01:00
Alejandro Celaya
3faf6e967f Updated changelog adding v1.15 2018-12-02 19:15:58 +01:00
Alejandro Celaya
a7a5667301 Improved repository tests 2018-12-02 19:13:49 +01:00
Alejandro Celaya
d7e89ebdae Ensured custom slugs are case sensitive 2018-12-01 21:38:29 +01:00
Alejandro Celaya
b876870bd8 Encapsulated in VisitsParams how the itemsPerPage param is handled 2018-11-29 08:02:22 +01:00
Alejandro Celaya
1d4ef4e9a4 Ensured pagination params in visits list are properly parsed to integer 2018-11-28 20:53:04 +01:00
Alejandro Celaya
d0e0aea0f1 Updated visits to support pagination 2018-11-28 20:39:08 +01:00
Alejandro Celaya
b0f250ed8a Created factory method to build VisitParams from a raw dataset 2018-11-28 19:58:45 +01:00
Alejandro Celaya
45254606d4 Added DTO used to pass filtering params to VisitsTracker 2018-11-27 21:09:27 +01:00
Alejandro Celaya
282ffef200 Ensured different loggers are used for swoole and for the app regular logs 2018-11-25 17:14:03 +01:00
Alejandro Celaya
f0330e9ae3 Ensured CloseDbConnectionMiddleware clears the entity manager 2018-11-24 13:24:43 +01:00
Alejandro Celaya
ccbc6c7a75 Created middleware which closes DB connection after every request 2018-11-24 12:55:00 +01:00
Alejandro Celaya
2fc2ad98aa Updated config so that shlink logger dynamically uses standard output when running with swoole 2018-11-24 09:38:00 +01:00
Alejandro Celaya
16590b2dbb Prepared project to support both swoole and regular app servers with fast cgi 2018-11-24 08:43:48 +01:00
Alejandro Celaya
f40349479e Used more strict types in UrlShortener private methods 2018-11-24 07:52:57 +01:00
Alejandro Celaya
5abd9d1a40 Made test properties to be private instead of protected 2018-11-20 19:37:22 +01:00
Alejandro Celaya
0ae5a53d86 Enforced property types comments in one line 2018-11-20 19:30:27 +01:00
Alejandro Celaya
09add5fbff Moved locale middleware to before the not found handler, so that it never gets executed otherwise 2018-11-18 20:15:37 +01:00
Alejandro Celaya
e30f49a791 Simplified error templates 2018-11-18 20:04:12 +01:00
Alejandro Celaya
64737b741b Removed CLI language param from installation 2018-11-18 19:55:23 +01:00
Alejandro Celaya
d4d65bdf37 Added missing X-Api-Key header to cross domain middleware 2018-11-18 17:03:50 +01:00
Alejandro Celaya
90732a4fad Removed translations from Rest module 2018-11-18 16:28:04 +01:00
Alejandro Celaya
c5015f5828 Removed translations from CLI module 2018-11-18 16:02:52 +01:00
Alejandro Celaya
b8faa6714a Increased MSI to 65% (for sure this time) 2018-11-17 19:32:31 +01:00
Alejandro Celaya
f48f98f4d7 Updated changelog for v1.14.1 2018-11-17 19:27:00 +01:00
Alejandro Celaya
79b2a0839f Increased MSI to 65% 2018-11-17 19:23:49 +01:00
Alejandro Celaya
6094d17718 Increased MSI to 64% 2018-11-17 18:40:53 +01:00
Alejandro Celaya
d2ed7d6417 Increased MSI to 62% 2018-11-17 18:06:21 +01:00
Alejandro Celaya
a705ef21a9 Increased MSI to 61% 2018-11-17 17:36:22 +01:00
Alejandro Celaya
ed3883b52c Updated translations 2018-11-17 14:29:54 +01:00
Alejandro Celaya
dd2cffeee9 Reused ProcessVisitsCommand name as the lock name 2018-11-17 14:16:45 +01:00
Alejandro Celaya
1ceabf3bc3 Added locking capabilities to process visits command 2018-11-17 14:11:16 +01:00
Alejandro Celaya
0aae0d888c Moved visits iteration logic from command to service to allow lazy loading of entries in resultset 2018-11-17 09:42:15 +01:00
Alejandro Celaya
1bc01057f3 Reduced the number of arguments in private method 2018-11-17 08:02:42 +01:00
Alejandro Celaya
c1906606c6 Updated VisitService to have a method which locates visits and allows entity manager to be cleared 2018-11-17 07:47:42 +01:00
Alejandro Celaya
1363194909 Improved code in LoggerFactory 2018-11-17 07:31:51 +01:00
Alejandro Celaya
4745a37549 Used a lower level on phpstan to avoid errors produced by Symfony 4.1.5 new phpdocs 2018-11-16 16:44:48 +01:00
Alejandro Celaya
9964d3e24b Added progress bar to command downloading new GeoLite2 database file 2018-11-12 21:30:30 +01:00
Alejandro Celaya
58e8c8e182 Updated spanish translations 2018-11-12 21:04:02 +01:00
Alejandro Celaya
c7339f6cfa Created an EmptyIpLocationResolver which always returns an empty resolution and can be used as a fallback while resolving IP addresses 2018-11-12 20:58:14 +01:00
Alejandro Celaya
1aa78f766a Added step to download GeoLite2 db during installation 2018-11-12 20:51:53 +01:00
Alejandro Celaya
bf56e6adaf Created UpdateDbCommandTest 2018-11-12 20:37:30 +01:00
Alejandro Celaya
e915b7e499 Updated GeoLite2 db reader service so that it is lazily created 2018-11-12 20:22:42 +01:00
Alejandro Celaya
de0470d200 Created command to update GeoLite2 database 2018-11-12 20:06:12 +01:00
Alejandro Celaya
3d7cf6992e Created service to update geolite2 database file 2018-11-11 21:28:42 +01:00
Alejandro Celaya
06db082e3f Updated translations 2018-11-11 21:28:42 +01:00
Alejandro Celaya
4a383cecaf Set chain IP resolver as the default IP resolver 2018-11-11 21:28:42 +01:00
Alejandro Celaya
9a0f9207be Fixed region resolved in GeoLite2 2018-11-11 21:28:42 +01:00