Tools For Better Developers

News: 2021 Aug 30 - Sep 10

2021 September News

2 years ago ∙ 2 minutes read

From now on, this website is deployed on push, and by the way, you can easily play with the website copy locally. In the Osm framework, new Osm_Project application allows reflecting over modules and classes regardless to which application they belong. New experimental project is aimed at quick creation of the Admin UI.

More details:

Sample Admin Panel Project v0.1.0

Initial iteration

An experimental project that will allow quick creation of the Admin UI and the HTTP API.

The whole idea is, that you'll define what kind of data the application operates, and the admin user interface will be generated from that. For example, the following class should create a table in the database, a search index, the product grid and the product editing form in the system backend:

/**
 * @property string $sku #[
 *      DbColumn\String_, Filterable, Searchable, Sortable,
 *      Field\String_('SKU'), Column
 * ]
 * @property string $description #[
 *      DbColumn\Data, Searchable,
 *      Field\Text('Description'), Column
 * ]
 */
#[Table('products')]
class Product extends Record
{
}    

In the first iteration, the first class and property attributes (Table, DbColumn, and more) have been defined.

We have also created the osmt generate command that will generate everything. In the initial iteration, it generates migration files that create database tables and search indexes.

osm.software Website v0.2.3

Diff

New Content

New articles have been written, and previous articles have been edited and revised:

Other Changes

  • Status reports category renamed to News
  • The latest news are shown directly on home page
  • All changes are automatically deployed to production on Git push
  • New readme

Osm Framework v0.11.2

Diff

Important. After switching to this major version, apply these changes to the project files.

Changes and fixes:

  • Descendants::byName() can collect classes not only by #[Name] attribute, but also by another compatible attribute
  • Console treats PHP warnings and errors as exceptions
  • URLs of failed pages are collected in http.log

Project Template v0.11.0

Diff

  • switched to framework: ^0.11
  • new Osm_Project app added to Gulp configuration
  • deployment script, and a GitHub action that invokes it added to the project. Read this article for a real-world example.

Osm Core v0.9.1

Diff

The new version allows introspecting all modules and classes of the project regardless to which application they belong. Use it as follows:

use Osm\Project\App;
...

$result = [];

Apps::run(Apps::create(App::class), function (App $app) use (&$result) {
    // use $app->modules and $app->classes to introspect 
    // all modules and classes of the projects and its 
    // installed dependencies

    // put the introspection data you need into `$result`. Don't reference
    // objects of the `Osm_Project` application, as they'll won't work 
    // outside this closure. Instead, create plain PHP objects and arrays, 
    // and fill them as needed 
});

Notice. The Osm_Project application is for introspection only. Invoking user code in context of this application may produce unexpected results.