Search code examples
phpredbean

Redbean php R::freeze(true) not working


I have used R::freeze(true); in my php application. But I don't know why redbean alters my database table structure. I noticed that interger type column becomes text automatically.

Also i have updated variable protected $isFrozen = TRUE; in rb.php. But no effect.


Solution

  • Without knowing your PHP structure or framework (if any), it's impossible to provide any answer in relation to that. In any event, R::freeze( true ) is the correct syntax. Make sure you add the statement in the beginning of your application.

    I have a lot of SlimPHP applications using ReadBean and I put it at the very top of my index.php right after running R::setup();

    <?php
    
    require 'vendor/autoload.php';
    R::setup();
    R::freeze( true );