Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 30 12:07
    jcheron commented #83
  • Nov 30 11:52
    jcheron commented #83
  • Nov 30 11:34
    parsfanavar commented #83
  • Nov 30 03:36
    jcheron commented #83
  • Nov 30 03:33
    jcheron commented #83
  • Nov 30 03:31
    jcheron commented #83
  • Nov 29 20:38
    parsfanavar labeled #83
  • Nov 29 20:38
    parsfanavar assigned #83
  • Nov 29 20:38
    parsfanavar opened #83
  • Nov 29 01:30

    jcheron on master

    Update UArray(DateTime) & UDate… (compare)

  • Nov 28 02:12

    jcheron on master

    Update HtmlListItem.php (compare)

  • Nov 26 01:58

    jcheron on master

    Add SimpleView controllers (compare)

  • Nov 25 06:56
    jcheron closed #73
  • Nov 25 06:56
    jcheron commented #73
  • Nov 23 13:15
    jcheron labeled #56
  • Nov 23 13:15
    jcheron labeled #56
  • Nov 20 18:50

    jcheron on master

    [skip ci] Add ControllerView (compare)

  • Nov 20 18:20

    jcheron on master

    Update Controller.php (compare)

  • Nov 20 17:31
    jcheron closed #80
  • Nov 20 17:31
    jcheron commented #80
jcheron
@jcheron
Thanks :-)
Ubiquity-oAuth version is based on HybridAuth
NoTeefy
@NoTeefy
are you planning on releasing it at some point or is it more like something that you use for yourself?
jcheron
@jcheron
For the moment, it is not publishable as it stands.
NoTeefy
@NoTeefy
alright, gonna need to work on an own implementation of it then
jcheron
@jcheron
I ping you when I publish something on this subject
NoTeefy
@NoTeefy
sounds great! Thanks a bunch :thumbsup:
NoTeefy
@NoTeefy
Just had a little talk with one of my customers. It would be really nice if we could get that dynamic placeholder (@activeTheme) for PHP views aswell because of some integrations we have to work on in the near future
Just wanted to let you know :)
And as another suggestion: Would it be possible to add single authentification checks to the current native auth controllers aswell? Because there might be cases where one would only want to protect a single method instead of a whole controller/class
jcheron
@jcheron
it's heard for the @activeTheme of php views
jcheron
@jcheron

@Noteefy
For the implementation of an AuthController on only 1 method, it is already possible:

/**
 * {@inheritDoc}
 * @see \Ubiquity\controllers\auth\AuthController::isValidUser()
 */
public function _isValidUser($action=null) {
    if($action!=='index'){
        return true;
    }
    return USession::exists($this->_getUserSessionKey());
}

In the AuthController class created, by overriding the _isValidUser method, I added here a control only on the index method

Alexey
@doublesystems_gitlab
@jcheron I plan start a big platform (Forex/stocks/currencies and so on). Spent many time trying to choose the best framework. The last experience with Symfony (3.x a) was bad (we had to rewrite many code to native to radically increase speed). I am doubting and hesitating between Symfony 5 and Yii and to tell the truth don't want any of them. Suddenly found your project, it soudns that I desire long time. So, is't it appropriate for big portal on Nginx/PostgreSql/Memcached/Redis with multilang ?
Je parle France un petit
jcheron
@jcheron
Hi @doublesystems_gitlab
Ubiquity does not currently offer a solution for Redis.
For the other parts, I will advise you to do some trials, asking me if you need anything.
:thumbsup: pour le Français !
Alexey
@doublesystems_gitlab
@jcheron First of all, we need admin module, where may do list/view/sort/search/pagination/edit for our entities (like Users, Companies, Stocks and so on), similar as SonataAdminBundle for Symfony. Is it something like that for Ubiquity?
jcheron
@jcheron
Yes, it's the Models part of the web-tools that handles that.
It is also possible to generate CRUD controllers with these features.
image.png
Alexey
@doublesystems_gitlab
Merci. What 's about admin roles: Superadmin/Moderator/Editor/... . And is it module to fast create user's member area (with authorization login/password) for several user types, like Registered user, Premium user, Organization and so on?
Alexey
@doublesystems_gitlab
And how do you exaplain that Phalcon shows so weak results here: https://orm-benchmarks.kobject.net/ ?
The choice of language(Zephir/C for Phalcon) is not enough to establish performance.
jcheron
@jcheron
For authentication management, you can use the AuthControllers see https://micro-framework.readthedocs.io/en/latest/scaffolding/auth.html
As far as role management is concerned, there is no ACL module, it is a choice: generally, the ACL modules provided by the frameworks are too complex to be efficiently usable, whereas it is quite easy to implement yourself
Alexey
@doublesystems_gitlab
Merci!
Alexey
@doublesystems_gitlab
There is some unclear description in doc about configuration urls.
We setup Admin and play. We found that it's admin for developer, not for classic admin. Therefore question: how do you think will faster for us: develope admin module from scratch or use SonataAdminBundle or admin from Yii?
For admin module we need:
  • CRUD for all entities
  • Several roles (Superadmin/Moderator/Editor/...)
  • New sections, like stats and fin reports
Alexey
@doublesystems_gitlab
Another question. We plan use several web-servers and want save session_id outside in Redis cluster (and also cache). So, how can we configure it using your framework? I remember that you said that it's not support Redis, so where we should add some code to support it?
jcheron
@jcheron
Hi @doublesystems_gitlab
It is indeed an administration module for developers.
I would advise against mixing Ubiquity with Sonata or the Yii admin module.
There is not much work to do to develop this module from scratch, based on CrudControllers.
I think I'll add a module like this, with ACL, when I'm done with the email module.
To manage the session with Redis, you must create a class inheriting from \Ubiquity\utils\http\AbstractSession.
That's also a good idea for the future.
Alexey
@doublesystems_gitlab
Merci
Alexey
@doublesystems_gitlab
Also in table of rows (CRUD) there is no sorting. Will it in near time? We'll show many tables (users, analytics, reports and so on)
jcheron
@jcheron
you can enable sorting, but it will only be on the client side

It is necessary to generate the Viewer, and override the following method:

use Ubiquity\controllers\crud\viewers\ModelViewer;
use Ajax\semantic\widgets\datatable\DataTable;

/**
 * Class UsersCrudViewer
 */
class UsersCrudViewer extends ModelViewer {

    protected function getDataTableInstance($instances, $model, $totalCount, $page = 1): DataTable {
        $dt = parent::getDataTableInstance($instances, $model, $totalCount, $page);
        $dt->setSortable(1);
        return $dt;
    }
}

The parameter of setSortable is the number of the field on which the default sorting is performed.

jcheron
@jcheron
you must also add jquery tablesort to the included js files: https://www.npmjs.com/package/jquery-tablesort
Alexey
@doublesystems_gitlab
sort on client side is inappropriate, because if we have several pages we'll sort only first page
Alexey
@doublesystems_gitlab
but we will have many pages )
jcheron
@jcheron
ok
For a server-side sorting, it is the CrudDatas class and the _getInstancesFilter method that must be redefined
namespace controllers\crud\datas;

use Ubiquity\controllers\crud\CRUDDatas;

/**
 * Class UsersCrudDatas
 */
class UsersCrudDatas extends CRUDDatas {

    public function _getInstancesFilter($model) {
        return "1=1 order by name";
    }
}
jcheron
@jcheron
And if the field you want to sort on must be dynamically defined, you can set it in the url:
?field=name
class UsersCrudDatas extends CRUDDatas {

    public function _getInstancesFilter($model) {
        $f = URequest::get('field', 'id');
        $fields = OrmUtils::getFieldNames($model);
        if (\array_search($f, $fields)) {
            return "1=1 order by $f";
        }
        return '1=1';
    }
}
Alexey
@doublesystems_gitlab
Thank you.
Do you know something about what's overhead of using Docker's "VOLUME" ?
jcheron
@jcheron
I have no idea, what do you mean by overhead: disk space?
To finish with the sorting, if you want to add links on the column headers of the dataTable:
/**
 * Class UsersCrudViewer
 */
class UsersCrudViewer extends ModelViewer {
    /**
     *
     * {@inheritdoc}
     * @see \Ubiquity\controllers\crud\viewers\ModelViewer::getCaptions()
     */
    public function getCaptions($captions, $className) {
        $captions = parent::getCaptions($captions, $className);
        $result = [];
        $uri = \strtok($_SERVER['REQUEST_URI'], '?');

        foreach ($captions as $caption) {
            $field = \strtolower($caption);
            $result[] = "<a href='{$uri}?field={$field}'>{$caption}</a>";
        }
        return $result;
    }
}
Alexey
@doublesystems_gitlab
Thank you.
About overhead I mean speed: if db socket in VOLUME and php-backend (php scripts) in VOLUME, how it slowly if they work totally without container or into one container.
jcheron
@jcheron
I don't know enough about how Docker volumes work to be able to answer you on this subject. I assumed, perhaps wrongly, that performance depends mainly on the resources available (cpu and memory)
about Docker
jcheron
@jcheron
Thank you, that's interesting.