by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jul 09 14:13
    n0nag0n closed #125
  • Jul 09 14:13
    n0nag0n commented #125
  • Jul 09 08:50
    jcheron labeled #125
  • Jul 09 08:50
    jcheron commented #125
  • Jul 09 04:06
    n0nag0n assigned #125
  • Jul 09 04:06
    n0nag0n opened #125
  • Jul 09 02:12

    jcheron on master

    [skip ci] remove statements bef… (compare)

  • Jul 09 02:02

    jcheron on master

    [skip ci] close connection afte… (compare)

  • Jul 09 01:07

    jcheron on master

    [skip ci] Fix DAO cache warmup (compare)

  • Jul 09 00:27

    jcheron on master

    [skip ci] Fix db closing after … (compare)

  • Jul 09 00:20

    jcheron on master

    [skip ci] close db at end of wa… (compare)

  • Jul 08 23:43

    jcheron on master

    [skip ci] add useArray for Memc… (compare)

  • Jul 08 23:37

    jcheron on master

    Fix pk names pb + Add DAO cache… (compare)

  • Jul 08 23:37
    jcheron closed #124
  • Jul 08 23:37
    jcheron closed #123
  • Jul 08 23:13
    jcheron opened #124
  • Jul 08 23:10

    jcheron on fix-pk-names-pb

    [skip ci] Fix MemcachedDriver pb (compare)

  • Jul 08 12:47

    jcheron on fix-pk-names-pb

    [skip ci] remove useCache from … (compare)

  • Jul 08 02:01

    jcheron on fix-pk-names-pb

    [skip ci] Fix DAOSerialCache ty… (compare)

  • Jul 08 01:21

    jcheron on fix-pk-names-pb

    [skip ci] fix dao cache pb (compare)

jcheron
@jcheron
The use of die() in an action does not prevent the execution of the initialize method...
James Mahy
@JamesMahy
@jcheron not sure what you mean, if you look at my code I'm not including any headers at all, i've removed that header and footer view from the original code - yet if I put a die in, the framework auto spits out a HTML container
jcheron
@jcheron
It's very strange and unexpected...
James Mahy
@JamesMahy
haha it is!
jcheron
@jcheron
In order to understand, I need you to give me all the information. Which address (controller+action) do you access to get this header?
James Mahy
@JamesMahy
if I put the die in the initilize method, any end point as long as it extends that class
jcheron
@jcheron
Okay, I'll give it a shot on my end.
jcheron
@jcheron
I tried with a die in the initialize, and I don't have that kind of problem...
James Mahy
@JamesMahy
I think I found my problem
there's a "ControllerBase" in vendor/phpmv/ubiquity/src/Ubiquity/controllers
jcheron
@jcheron
yes
James Mahy
@JamesMahy
PHPStorm extended that and not my controller base and I didn't notice
Yup that was it
again, sorry and thank you!
jcheron
@jcheron
Never mind, I was already there.
James Mahy
@JamesMahy

new one for you

Made it live on a production server and now every request this outputs. debug=false, what have I done wrong?

#0 /var/www/src/vendor/twig/twig/src/Loader/FilesystemLoader.php(87): Twig\Loader\FilesystemLoader->addPath()
#1 /var/www/src/vendor/twig/twig/src/Loader/FilesystemLoader.php(45): Twig\Loader\FilesystemLoader->setPaths()
#2 /var/www/src/vendor/phpmv/ubiquity/src/Ubiquity/views/engine/Twig.php(36): Twig\Loader\FilesystemLoader->__construct()
#3 /var/www/src/vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(53): Ubiquity\views\engine\Twig->__construct()
#4 /var/www/src/vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(80): Ubiquity\controllers\Startup::startTemplateEngine()
#5 /var/www/src/vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(68): Ubiquity\controllers\Startup::init()
#6 /var/www/src/index.php(7): Ubiquity\controllers\Startup::run()
#7 {main}
James Mahy
@JamesMahy
It's because I was missing the "views" folder
seems a bit of a bug ;)
also if the .ubiquity folder doesn't exist you can't run init-cache
seems a bit weird that it's a requirement
NoTeefy
@NoTeefy
@jcheron Hey. I am really sorry for the delayed response, I have a lot of projects going on atm. It worked after using the transaction and committing it manually after the update routine. It seems like they changed the default flag for autocommit on the latest MariaDB version which is why it didn't happen before.
Thanks a lot for your precious work and the fast support.
I am pretty sure I had that PDO flag in my options and it didn't work with them, but I could retest that behaviour if you want
I really hope to be able to contribute to this awesome project at some point :)
@JamesMahy Not really if you think about what's containted in that directory. It holds all configs like the autoloader, your router, and the default startup routine
the autoloader is required for the init-cache command afaik
jcheron
@jcheron

seems a bit weird that it's a requirement

@JamesMahy
The .ubiquity folder is what allows the Ubiquity client to correctly identify the location and structure of the project. It is what allows you to launch an Ubiquity command whatever folder you are in, inside the project.
And as @NoTeefy rightly points out, it is also used by servers (php, Swoole, RoadRunner...) to store their configuration and index page.

jcheron
@jcheron
@NoTeefy
It might be good to try again, yes.
It will be embarrassing if this behavior is encountered again.
James Mahy
@JamesMahy

.ubiquity is just an empty folder it doesn't contain anything but it's used like a sort of lock file so init-cache doesn't recognise you're inside a ubiquity project unless it's there.

The issue here is that when you store the project in github, to deploy you need recreate the folder or put a .gitkeep file inside of it.

Wouldn't a .ubiquity file make sense instead of a folder?

also it seems weird that the system would just barf a stack trace because the views folder doesn't exist, I had to dig through the code to understand what the issue was. Not all projects will require the views folder and if you insist it's a requirement, shouldn't it just throw an error out to the error log, not the client?
jcheron
@jcheron
@JamesMahy
The folder is empty because you are not using any asynchronous servers.
It may be possible that an .ubiquity file is an equivalent.
jcheron
@jcheron
If the framework emits an error for the absence of the views folder, you have started the template engine.
I guess if you don't have this folder, you are not using the views.
So you should remove these 2 lines from the configuration file :
        "templateEngine"=>'Ubiquity\\views\\engine\\Twig',
        "templateEngineOptions"=>array("cache"=>false),
And you won't be needing any more views folder.
James Mahy
@JamesMahy
ok ty
jcheron
@jcheron
And you probably don't need the injection of the graphics library either,
so you can also remove:
        "di"=>["@exec"=>["jquery"=>function($controller){
                        return \Ubiquity\core\Framework::diSemantic($controller);
                    }]],
And you don't use that either:
        "isRest"=>function(){
            return \Ubiquity\utils\http\urequest::getUrlParts()[0]==="rest";
        },
James Mahy
@JamesMahy

hey @jcheron

Remember our key name issue? I'm still getting it but only when I try to create multiple objects in a loop

class SomeModel
{
    /**
     * @id
     */
    private int $id = 0;

    /**
     * @column("name"=>"unique_id")
     */
    private string $uniqueId = '';
}
for($x=1;$x<=250;$x++){
            $model = new SomeModel();
            $model->setUniqueId(substr(bin2hex(random_bytes(40)), 0, 40));

            if(DAO::save($model)){
                echo $model->id;
            }
        }

The first iteration always succeeds, every subsequent one I get

[Wed Jun 10 17:06:51.719239 2020] [php7:error] [pid 84] [client 172.17.0.1:42490] PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'uniqueId' in 'field list' in /var/www/html/vendor/phpmv/
ubiquity/src/Ubiquity/orm/traits/DAOUpdatesTrait.php:145\nStack trace:\n#0 /var/www/html/vendor/phpmv/ubiquity/src/Ubiquity/orm/traits/DAOUpdatesTrait.php(145): PDOStatement->execute()\n#1 /var/www/html/vendor/phpmv/ubiquity/src/Ubiqui
ty/orm/traits/DAOUpdatesTrait.php(315): Ubiquity\\orm\\DAO::insert()\n#2 /var/www/html/app/controllers/Index.php(139): Ubiquity\\orm\\DAO::save()\n#3 /var/www/html/vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(148): contro
llers\\Index->generateBots()\n#4 /var/www/html/vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(100): Ubiquity\\controllers\\Startup::runAction()\n#5 /var/www/html/vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(69
): Ubiquity\\controllers\\Startup::forward()\n#6 /var/www/html/index.php(7): Ubiquity\\controllers\\Startup::run()\n#7 {main}\n  thrown in /var/www/html/vendor/phpmv/ubiquity/src/Ubiquity/orm/traits/DAOUpdatesTrait.php on line 145
James Mahy
@JamesMahy
This message was deleted
So in phpmv\ubiquity\src\Ubiquity\orm\parser\Reflexion.php line 53 - line 58
self::$classProperties Isn't populated on the first instance but is incorrectly populated on the 2nd instance - I'm guessing this is meant to be some sort of caching mechanism?
James Mahy
@JamesMahy
if (isset ( self::$classProperties [$className] )) {
            foreach ( self::$classProperties [$className] as $prop ) {
                $ret [$prop->getName ()] = $prop->getValue ( $instance );
            }
            return $ret;
        }
If I comment out this chunk of code, everything works as expected

Line 68

self::$classProperties [$className] [] = $prop;

If i change to

self::$classProperties [$name] [] = $prop;

it works. Don't know if this is correct so will leave it down to your expertease :)

jcheron
@jcheron
Hi @JamesMahy
There was indeed a problem on the lines you mentioned.
It should be better with this fix: phpMv/ubiquity@7c6e58a
James Mahy
@JamesMahy
Awesome, thanks @jcheron
Damir Zelenika
@dysback
Hi
I installed Ubiquity by:
composer global require phpmv/ubiquity-devtools
but it is not globally available
on my Ubuntu-1804-bionic-64-minimal
I found it at $HOME/.config/composer/vendor/phpmv/ubiquity-devtools/src/Ubiquity
Damir Zelenika
@dysback
is it possible to set Ubiquity command globally available during installation?
jcheron
@jcheron
Hi @dysback
by placing export PATH="$HOME/.config/composer/vendor/bin:$PATH" into your ~/.bashrc file.
James Mahy
@JamesMahy

Hey @jcheron it's your favourite annoying dev again :) Was wondering if there's a method to retrieve a twig view into a string instead of rendering it with $this->loadView

I would like to use Twig to parse my mail templates so that I don't have to build a seperate template parser

jcheron
@jcheron

Hi @JamesMahy ,
You should use the third parameter of the loadview method:

$str=$this->loadView('viewName',['datas'=>$datas],true);

see https://api.kobject.net/ubiquity/class_ubiquity_1_1controllers_1_1_controller.html#a80a71e60aa536de9b98b7b773fb54bec