Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 17 18:05

    jcheron on 2.4.1

    (compare)

  • Jan 17 18:04

    jcheron on 2.4.1

    (compare)

  • Jan 17 18:03

    jcheron on master

    [skip ci] fix models cache gene… (compare)

  • Jan 17 16:00

    jcheron on 2.4.1

    (compare)

  • Jan 17 16:00

    jcheron on master

    [skip ci] Fix MessageTrait inve… (compare)

  • Jan 17 15:59

    jcheron on 2.4.1

    (compare)

  • Jan 17 15:44

    jcheron on 2.4.1

    (compare)

  • Jan 17 15:39
    jcheron closed #166
  • Jan 17 15:38

    jcheron on master

    [skip ci] Update CHANGELOG for … (compare)

  • Jan 17 15:35
    jcheron commented #151
  • Jan 17 15:27

    jcheron on master

    [skip ci] Update to 2.4.1 (compare)

  • Jan 17 14:52

    jcheron on 1.2.21

    (compare)

  • Jan 17 14:50

    jcheron on master

    Update to 1.2.21 (compare)

  • Jan 17 13:43

    jcheron on 2.3.16

    (compare)

  • Jan 17 13:33

    jcheron on master

    [skip ci] update getFormTitle f… (compare)

  • Jan 17 03:10

    jcheron on master

    [skip ci] fix CRUD message icon… (compare)

  • Jan 16 23:56

    jcheron on master

    add hasActiveRowSelector to Sem… (compare)

  • Jan 16 01:14

    jcheron on master

    [skip ci] add dark theme for CR… (compare)

  • Jan 14 17:54
    jcheron locked #65
  • Jan 14 17:54
    jcheron closed #65
teachtocode
@teachtocode
Hi , I am very happy with your framework , my doubt is how can i disable Admin panel ui(web tools) , i needed the web tools ui in my local development but how can i disable when i am going to deploy it.
jcheron
@jcheron
getit0
@getit0
Hello there! I found ubiquity pretty awesome! Trying to get msaccess odbc connection to have easy relationships for my models. Is it possible? How to fill dropdowns with table data, maby some ready grid or example iteration? How to easy deploy public in production server? Trying to find an easy frontend framework, that automaticaly find, say date fields and create fast ui. Please an example for many to many auto select drop down fields, that shows text related field from pivots. Nice to meet you!
jcheron
@jcheron

Hi @getit0 and thank you for this feedback!
That's a lot of questions...

MsAccess

this is unfortunately not possible.
You can easily perform DAO operations (via PDO), but not generate the classes (you would need a specific wrapper for MSAccess, which has not been implemented).

jcheron
@jcheron

UI

For the UI and Front-End part, Ubiquity uses by default phpMv-UI (PHP components library based on Semantic-UI and jQuery)
So to generate a Semantic UI dropdown from a model, you can do :

public function clientsDropDownTest(){    
    $clients=DAO::getAll(\models\Client::class);
    $form=$this->jquery->semantic()->htmlForm('frm');
    $form->addDropdown('clients',JArray::modelArray($clients,'getId','__toString'));
    $this->loadView('ddTest.html');
}

In the associated view, you can display the form:

{{ q['frm'] | raw }}
CRUD scaffolding can give you an idea of the possibilities.
jcheron
@jcheron

Deployment

For the deployment, everything depends on the available server solution. I advise you to read the Servers and Optimization parts of the guide.
And to come back to me if you have other questions
jcheron
@jcheron

ManyToMany and Dropdown

The easiest first step is to create a CRUD controller for the model, and see if you can get the desired result by customizing it.
getit0
@getit0
Thank you for your speedly answers!!! I have a lot to test!
churow
@churow
Can I DAO::save() same instance twice (the first one will insert and the second one should update)? The Ubiquity\orm\parser\Reflexion's static variable $classProperties stores the first time (insert) properties, which lack primary key, so the second DAO::save(), which needs primary key to update, fails with "SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens" error.
jcheron
@jcheron
I've just tried (2 consecutive calls of the save method for the same object) and I didn't notice this problem.
jcheron
@jcheron
@churow Have you solved your problem?
churow
@churow
Hi, @jcheron. I just bypassed the problem by rewriting the code to DAO::save() only once..
jcheron
@jcheron
And can you show me your code (the old one), that I can check to see if there is a bug, thank you @churow .
hdqtian
@hdqtian_twitter
Hi~ I want to know whether ubiquity-framework support ReactPHP or not, and I have not seen the document about the ReactPHP extension. Thx @jcheron
jcheron
@jcheron

Hi,
If it is about this extension ReactPHP
yes, it is implemented with Ubiquity :
Just do:

Ubiquity serve -t=react

The composer dependencies are added as needed and the server starts on port 8095 (which can be changed with -p).

jcheron
@jcheron

Nevertheless, I will not advise its use in production.
Benchmarks performed on Techempower have led to poor results when testing React with php-pm. React reacts badly to a high level of concurrency (see php-pm/php-pm#456).

The React or php-pm solution are not documented for this reason.

It is preferable to use Ubiquity with more stable solutions :

  • Swoole
  • Workerman
  • nginx with php-ngx

And there, the performance really takes off.

jcheron
@jcheron
@hdqtian_twitter for the above answer
hdqtian
@hdqtian_twitter
Thank you~
Poule-magique
@Poule-magique
Hello everybody :)
Can we include FastHttp (written in Go) with Ubiquity ?
jcheron
@jcheron
Hi @Poule-magique
There are no explicit plans for FastHttp in Ubiquity,
so for the moment no, but it may be a good RFC.
Poule-magique
@Poule-magique
I'll do that, thanks for your feedback
Ah, if I have another question before tackling Ubiquity, do you know if it provides all the tools to write secure applications ? Such as built-in encryption, CSRF protection, cookie forgery protection, RBAC authorization, token-based authentication, validation, etc.
jcheron
@jcheron
Token authentication is built into the rest service.
For the encryption part, CSRF protection, Cookie protection, you can find it in Ubiquity-security (installable and configurable from the webtools).
The management based on roles is in Ubiquity-acl, also installable and configurable with the webtools.
The documentation of these 2 modules is in progress
Marwan Rabbâa
@waghanza

Hi,
I have

Cannot assign null to property Ubiquity\cache\CacheManager::$annotationsEngine of type Ubiquity\annotations\AnnotationsEngineInterface

when running ./vendor/bin/Ubiquity bootstrap prod

Vladas Lapinskas
@Lapinskas

Hi @Poule-magique ,

Maybe you can find interesting the RoadRunner and Ubiquity integration.
Road Runner is written in Go with the idea of PHP workers pool.

Poule-magique
@Poule-magique
Hi @Lapinskas
Yes I saw their project and it's very interesting, I even opened a topic to change the base of net/http by FastHttp.
I'm interested in two frameworks, Spiral and Ubiquity.
Quick question people, is Ubiquity ready for production or rather for personal projects at the moment ?
jcheron
@jcheron
It is used in production, and I think it is stable and efficient enough to give satisfaction in this context, but I am a bit partisan to give my opinion...
I have very few bug feedbacks: thanks to the continuous integration and benchmarks!
Poule-magique
@Poule-magique
Thanks @jcheron
On Friday, I have a meeting for the technology selection for a certain project, and two executives have been chosen, Spiral and Ubiquity, but I'd like you to tell me what additional point I can make about Ubiquity versus Spiral, aside from the fact that it's a good performer because I've already integrated it into my presentation.
jcheron
@jcheron
Hi @Poule-magique
In terms of performance, all other things being equal (with the same Roadrunner platform), there is a big difference between the two, based on the Techempower benchmarks use cases.
see Ubiquity vs Spiral With Roadrunner on Techempower benchmarks
It's from simple to double.
Otherwise, there is also a big difference in terms of ease of use.
If you consider an example of how to use ORM, I use this example provided by the Spiral ORM README:
load all active users and pre-load their paid orders sorted from newest to olders
//Spiral loading
$users = $orm->getRepository(User::class)
        ->select()
        ->where('active', true)
        ->load('orders', [
            'method' => Select::SINGLE_QUERY,
            'load'   => function($q) {
            $q->where('paid', true)
            }
            ])
            ->fetchAll();
The same with Ubiquity ORM with a simpler and more object-oriented approach:
//Ubiquity loading
$users=DAO::uGetAll(User::class,'active= ? and orders.paid = ?',[true,true]);

Otherwise, I would say that you also have to take into consideration the needs of your teams, their skills and the projects you're going to work on.
The choice of a framework depends more on this adaptation to needs and skills than on the intrinsic characteristics of a framework.

Last but not least, you should not forget that the quality of your developments depends more on your best practices than on the tools, languages or frameworks you choose to use.

Poule-magique
@Poule-magique
Hi @jcheron

Hello, so watch out RoadRunner on Techempower it's due to the fact that they took the net/http, if you switch to fasthttp it arrives at the top of the list, then swoole and then workerman, it was tested recently by our teams, I am wary of Techempower because not always reliable, but it must be said that the tests are not very simple to perform either because there is a whole process to be taken into account on each framework/server to perform good tests.

But the good news is that RoadRunner (with fasthhtp) integrates well with Ubiquity.

Thank you for this example, I add it to my presentation, because I would really like to work with Ubiquity.

jcheron
@jcheron
All other things being equal: Ubiquity like Spiral does not use fastHttp for Techempower tests, or I missed a step...
Thae Htet San
@ths.thaehtetsan_gitlab
The framework works only with embedded server. If I run the project with Apache Vhost on my local machine of Ubuntu 20.04, all of routes except the default are 404. How to deploy on production?
jcheron
@jcheron
@jcheron
Hi @ths.thaehtetsan_gitlab
Without knowing anything about your configuration, it is difficult to help you.
It would be better in this case to open an issue, to be able to explain your problem correctly.
You will be able to put there the configuration file (app/config/config.php), or the .htaccess file.
Otherwise, you have some documentation on the configuration of the servers.
Thae Htet San
@ths.thaehtetsan_gitlab

Hi

The framework works only with embedded server. If I run the project with Apache Vhost on my local machine of Ubuntu 20.04, all of routes except the default are 404. How to deploy on production?

Here is the configuration file <VirtualHost *:80>
ServerName testub.local
ServerAlias www.testub.local
ServerAdmin webmaster@testub.local
DocumentRoot /var/www/testub.local

<Directory /var/www/testub.local>
    Options -Indexes +FollowSymLinks
    AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/testub.local-error.log
CustomLog ${APACHE_LOG_DIR}/testub.local-access.log combined

</VirtualHost>

jcheron
@jcheron
Hi @ths.thaehtetsan_gitlab
As I told you before, it would be better with the framework configuration files (app/config/config.php, .htaccess files).
Not sure, I think that the .htaccess file at the root of the project does not refer to the correct RewriteBase,
this would be:
AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f  
    RewriteCond %{HTTP_ACCEPT} !(.*images.*)
    RewriteRule ^(.*)$ index.php?c=$1 [L,QSA]
</IfModule>
jcheron
@jcheron
You also need to make sure that the rewrite mod is active:
sudo a2enmod rewrite
jcheron
@jcheron
You can also check the creation of the cache, and the routes:
Ubiquity info:routes
image.png