Commit Graph
100 Commits
Author SHA1 Message Date
kj 3c9db3ac53 refactor(neuron): remove return type hint from __get method 2026-06-05 13:28:19 -03:00
kj c5a4967ae4 refactor: Extract autoloader to dedicated file 2026-02-10 14:09:13 -03:00
kj c0b9f3851a chore(router): Remove redundant middleware count check 2026-02-02 10:23:48 -03:00
kj 78e199e300 feat(router): Introduce withMiddleware() for scoped middlewares 2026-02-01 08:25:54 -03:00
kj 8cd5e114dd refactor(router): Align type hint for optional parameter in docblock 2026-02-01 07:47:04 -03:00
kj ce03bdb27d fix(model): Fix postgresql search. 2025-10-27 15:16:54 -03:00
kj b24598b118 fix(sqlite): Correct base table for RIGHT JOIN conversion 2025-10-27 15:15:45 -03:00
kj 5019b89cc0 docs(readme): Update PostgreSQL compatibility status 2025-10-27 10:27:18 -03:00
kj d030e8d30e refactor(model)!: Allow groupBy to accept multiple args instead an array 2025-10-27 10:26:12 -03:00
kj b2672ad92f fix(model): Remove ON clause from cross join 2025-10-27 10:24:25 -03:00
kj 4c57770b43 refactor(model): Remove backticks from column names 2025-10-27 10:23:55 -03:00
kj 8e84450f95 fix(query): Adjust LIMIT OFFSET clause syntax 2025-10-27 10:23:31 -03:00
kj ece32b9bbe docs(readme): Update supported where clauses 2025-10-27 06:50:13 -03:00
kj a5cf9d239d refactor(model): Fix typo on WHERE EXISTS/NOT EXISTS methods 2025-10-27 06:46:17 -03:00
kj b9509c49ed refactor(model): Add string type hint to select columns 2025-10-21 16:26:39 -03:00
kj 6e433b4d06 feat(query-builder): Implement advanced WHERE and new JOIN clauses 2025-10-17 13:13:01 -03:00
kj 892b3614ec refactor(db): Detect DB type using PDO driver name 2025-10-17 13:12:02 -03:00
kj a0b544eae5 refactor(Model): Rename bindValue to bind and make public 2025-10-17 11:55:37 -03:00
kj 20fd78ab53 docs(Request): Remove param comment 2025-10-16 20:51:52 -03:00
kj f5411daaa5 Translate comments to English 2025-10-16 20:02:54 -03:00
kj 7e7ec68fd7 refactor(router): Use Neuron object for route parameters 2025-10-16 12:04:05 -03:00
kj ac9a661bc0 fix(htaccess): Block direct access to vendor and src folders 2025-10-11 12:15:15 -03:00
kj c8d7b69367 feat(bootstrap): Introduce Libs\Loader for directory loading 2025-10-11 10:44:20 -03:00
kj 7f62e06ff9 docs: Improve documentation and translate comments to English 2025-10-10 21:18:22 -03:00
kj 674c9d5ff4 fix(validator): Improve filter_var robustness in validation methods 2025-10-10 21:17:41 -03:00
kj 2f50532e13 refactor(Model): Type hint setNull variadic arguments 2025-10-10 21:06:11 -03:00
kj b41514a491 fix(di): Improve parameter resolution and validation 2025-10-10 19:15:07 -03:00
kj a1a15f492c refactor!: add Synapsis for dependency resolution and injection
- Remove Middleware class and custom callback handling logic.
- Implement Synapsis as a dependency injection container for automatic
resolution.
- Refactor Router to use Synapsis for process route callbacks and not found
handler.
- Update Request to remove middleware-specific properties and use
Router::$currentParams for path parameters.
2025-10-10 17:44:49 -03:00
kj b19e7d8789 Remove a forgotten debug line. 2025-09-07 18:52:33 -03:00
kj 4dfdb52519 Remove unnecessary and really never-used tableSufix property. 2025-09-07 15:25:48 -03:00
kj b0891885f9 BREAKING CHANGE: Make select, from, and setNull methods variadic. 2025-09-07 15:20:06 -03:00
kj b282d5479f Convert object/database naming conventions.
Adhere to PSR-12 by converting object properties to "lowerCamelCase" for objects
and "snake_case" for database interactions.

Backward compatibility is maintained: object properties already using
"snake_case" will continue to work without issue.
2025-09-07 15:01:45 -03:00
kj c9f467345b BREAKING CHANGE: Adhere to PSR-12 coding standards.
- Model: where_in method was renamed as whereIn.
2025-09-07 11:07:07 -03:00
kj 0f46848d15 Remove the predefined 'id' property.
This property is not necessary and gives less flexibility.
2025-08-15 14:51:16 -03:00
kj b2cb8d6883 Allow statically call beginTransaction, rollback and commit methods. 2025-07-15 18:12:41 -03:00
kj e9126e7cde Fix: Implicitly marking parameter as nullable is deprecated.
PHP 8.4 deprecation.
2025-06-07 14:27:47 -03:00
kj 7169d2cae3 Fix: render is not using the defined extension. 2025-06-07 14:17:11 -03:00
kj 66b2bc0d91 Remove unnecesary php close. 2025-06-07 14:14:16 -03:00
kj c8ab2aa2cc Remove unnecesary echo. 2025-05-20 12:49:20 -03:00
kj 1e302a9ea7 BREAKING CHANGE: Change unnecesary false return type. 2025-04-19 15:44:16 -03:00
kj d0d0d4dc76 Verify if a valid http query string after run parse_str. 2025-02-20 08:22:47 -03:00
kj 595e9c1316 Save body request as a property. 2025-02-20 08:22:37 -03:00
kj 45abea5301 Add delete request params. 2025-02-20 06:28:03 -03:00
kj d441f001ec Add type of items on array on dockblock for "all" method. 2025-02-03 16:04:39 -03:00
kj 19da122e05 Add type of items on array on dockblock for get method. 2025-02-03 16:02:27 -03:00
kj 1a0164c8ed Change static methods to non-static and made onInvalid public. 2024-10-30 11:53:44 -04:00
kj ad9f8ec67d Remove unnecesary brackets. 2024-10-29 19:12:25 -04:00
kj 31c5c63952 Remove innecesary return. 2024-10-29 19:10:47 -04:00
kj 6aef212350 Fix className not returning the classname in the right format. 2024-10-25 10:40:57 -04:00
kj c600688725 Improve return array dockblocks. 2024-09-23 18:09:38 -04:00
kj 3e27b1b7af Allow null on enum properties. 2024-09-23 15:06:44 -04:00
kj 73b7b8f72a Change required valitator to not allow empty values and add exists.
The exists validator do the same as the old required.
2024-09-18 14:33:33 -04:00
kj 7baad428ec Refactor request library. 2024-09-08 14:43:56 -04:00
kj 3d2a607768 Fix where_in is wiping previous where/and/or.
For now, works as an AND, but maybe later, same as where will exists
new methods: AndIn and OrIN.
2024-08-30 16:26:03 -04:00
kj df424ffab5 Model properties now can be typed as enums.
With this PHP 8.0 support is dropped.
2024-08-27 19:01:02 -04:00
kj daf7250882 Catch and verify put and patch input values. 2024-08-13 10:22:44 -04:00
kj 05cd83fd10 Remove unused variable. 2024-07-31 03:29:49 -04:00
kj 6b470a181d Fix: Remove unnecesary parameter. 2024-07-10 09:06:51 -04:00
kj 7beb161d2b Ensure db is in transaction to commit or rollback. 2024-06-04 07:18:30 -04:00
kj 701caae7eb Change route method to static. 2024-05-29 13:24:20 -04:00
kj 100bdfe006 Change private method to protected instead. 2024-05-28 22:27:20 -04:00
kj f1b79fdbc0 Add http code 422 on verification failed. 2024-05-25 17:41:33 -04:00
kj 406f9a10a1 Add head comment. 2024-05-25 17:19:08 -04:00
kj cc3cb6be41 Fix: a return was forgot. 2024-05-25 17:11:07 -04:00
kj 59fff2a586 Add validation on Request. 2024-05-25 16:59:59 -04:00
kj cd1685d2e7 fix on a docblock. 2024-05-21 15:06:02 -04:00
kj b85fb7e034 Allow configure SITE_URL with or without slash at end. 2024-05-16 13:48:49 -04:00
kj a10308a8f6 Fix route and redirect methods error when path not start with slash. 2024-05-16 13:20:35 -04:00
kj 9a1e5a2379 Add some explanatory comments to config. 2024-05-14 02:54:23 -04:00
kj fa60ec5bb4 Move constant definition to config.php 2024-05-14 02:53:39 -04:00
kj b294b1d627 Update readme.
Fix description and add links to starting manual.
2024-05-13 01:08:44 -04:00
kj 27b5ed6015 Convert model name from PascalCase to snake_case (table name). 2024-05-12 04:38:45 -04:00
kj f9b2c678f7 Support multiple databases at same time. 2024-05-12 03:47:09 -04:00
kj e294eaa7af Add route function for View objects. 2024-05-09 23:12:59 -04:00
kj 186d640c8f fix: an empty SITE_URL return a incorrect value of basePath. 2024-05-09 23:10:58 -04:00
kj c65fcd27c8 Create new ROOT_CORE constant. 2024-05-09 18:36:48 -04:00
kj f5f803dde2 Reorganize code for PSR and others code prettify. 2024-05-09 15:13:52 -04:00
kj 6a1085b224 Allow Neuron as $params on view render. 2024-05-09 14:56:07 -04:00
kj 64bcfa0b00 Add Lib\Request. 2024-05-05 09:38:10 -04:00
kj cd01ab9e72 Change switch to match. 2023-10-20 16:26:17 -04:00
kj e2094ccb4a Add option to use another extensions, js and css methods. 2023-09-15 21:26:53 -04:00
kj 341d7837a1 Add Router::reconfigure method. 2023-09-08 22:42:50 -04:00
kj 030e1079dc add mising types, patch method and a new way to set middleware
- Removed resumed way to set controllers and middlewares:
  Now, the method of routers and middlewares need to be
  callables.
- Add patch method in order to support PATCH http method.
- Add a way to get add more middlewares after. For Example:

  <?php
    use Libs\Router;

    Router::get('/some-route', 'somefunction')
      ->middleware('firstmiddleware');
    Router::get('/other-route', 'otherfunction');

    // Recover first router and add a middleware
    Router::get('/some-route')->middleware('secondmiddleware');
  ?>
2023-08-22 01:48:04 -04:00
kj af673a68b8 Add exit after redirect in order to avoid other erros. 2023-08-09 08:54:17 -04:00
kj eff0b86762 Allow construct Neuron with named arguments.
Example:

<?php
$instance = new Neuron(stringValue: 'Hello world', integerValue: 50,
boolValue: false);

echo $instance->stringValue; // "Hello world" will be printed.
?>

Also, is possible to send infinite params without names and his names
will be numeric similar as a non-asociatie array, but as Neuron object.

Example:

<?php
$str = 'Hello world';
$int = 50;
$con = false;

$instance = new Neuron($str, $int);

echo $instance->{0}; // "Hello world" will be printed.
?>
2023-06-04 14:47:58 -04:00
kj 39a1f9d85a Improve magic function __get.
Is not necessary another conditionals. When __get is called
is only when the the property is not defined, so
only need return null in order to avoid the
PHP notice of undefined property.
2023-06-04 14:34:24 -04:00
kj d48f24ed98 Improve return types. 2023-04-22 05:32:37 -04:00
kj b326c8e1d0 Fix mising use. 2023-04-16 23:47:49 -04:00
kj 1267d6b2f6 Fix deprecation warnings on PHP8.2 2023-04-15 13:17:00 -04:00
kj a8d95cb55b Fix empty application/json. 2023-04-14 16:43:50 -04:00
kj 06b7907f7c Define mixed type to param $id on getById method. 2023-03-25 21:28:25 -04:00
kj 4d052efba6 Change return type from mixed to ?Model on getFirts and getById methods. 2023-03-25 18:28:21 -04:00
kj 11141a0eee Allow send string to setNull method. 2023-03-25 12:27:33 -04:00
kj 3c8a21161f Add missing docblocks and return types. 2023-03-25 12:26:42 -04:00
kj 1bde430251 Improve Neuron and allow use to clone another object. 2023-03-15 22:16:05 -04:00
kj 7d3d1615d5 Fix View:txt and add charset. 2022-11-22 00:59:20 -04:00
kj 404bd59569 Improve where, and, or and search method.
- static::$querySelect['AndOr'] is REMOVED.
- where, and, or and search now use only the
  static::$querySelect['where'] index.
- removed unnecesary brackets on buildQuery.
2022-08-22 15:26:32 -04:00
kj 53bdc92344 Add bindValue method to Libs\Model. 2022-08-18 16:38:40 -04:00
kj ad7b78f427 Fix prepare variables when special where/and/or columns. 2022-08-12 06:31:54 -04:00
kj 38d2a90318 Fix count when using joins. 2022-08-12 05:46:24 -04:00