Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Crude CRUD
  • Crude CRUD is a GUI scaffolding generator.
    It differs from Oil in that it is designed to generate CRUD operations from tables in the currently configured database.
    It is very rough and thereby named Crude! ;) https://github.com/paulboco/crude
  • I pack my app and upload it in my blog : http://xmory.com/a-fuel-zip-pack-with-crude-module/
  • xm ory wrote on Tuesday 4th of October 2011:
    I pack my app and upload it in my blog : http://xmory.com/a-fuel-zip-pack-with-crude-module/

    Thank you! :)
  • I like this package very much. It will help me a lot.
    But now I have a trouble:. When I unzip the package pack and modify config file, a error occurs:
    Fuel\Core\Fuel_Exception [ Error ]: You have specify a valid path to store the session data files. COREPATH/classes/session/file.php @ line 319
    315 case 'path':
    316 // do we have a path?
    317 if ( empty($item) OR ! is_dir($item))
    318 {
    319 throw new \Fuel_Exception('You have specify a valid path to store the session data files.');
    320 } I don't know why?
    I try fuel core from 1.0.1 to 1.1, the same error.
    I try to modify the session config file in crude package, and doesn't succeed. What should I do?
  • Thanks for pointing this out, @xmory.
    I failed to mention in the install instructions that Crude requires the file session driver. That has now been updated at GitHub.
    My only suggestion at this point is to check that the 'path' item in your session configuration is pointing to a directory that exists and is writable. Edit: An easy way to set all writable directories is to run 'oil refine install'. See here http://fuelphp.com/docs/installation/instructions.html#manual
  • Why include a session config file (that might not work for someone) and not rely on the default config provided by fuel (which is based on a cookie, works on every setup)? If it is due to size restrictions (the only reason I can think of), it is better to check the session config, and throw an error if it is configured for cookies. Altough you should not need to to that, the Session class will throw an error if the session data grows beyond the size of the cookie.
  • You are correct, @WanWizard. I use the file driver as the cookie driver kept throwing the size error you mentioned.
  • My path is set to '/tmp', and I also have a tmp directory in APP path. My os is windows xp, so the directory can be written of course. My server is WampServer 2.1, and php version is 5.3.5.
  • xm ory wrote on Tuesday 4th of October 2011:
    I pack my app and upload it in my blog : http://xmory.com/a-fuel-zip-pack-with-crude-module/
    Sorry, I do not fount any info about SQL file.
    Which tables should be in db fuel_dev? "Error:
    No tables found in database fuel_dev.
    "
  • @xmory- I don't have a windows machine to test with, but here are some suggestions: 1) Create a fresh install of Fuel.
    2) Set session driver to 'file' as per http://fuelphp.com/docs/classes/session/config.html.
    3) Test session file driver:
    a) Replace method 'action_index()' in 'APPPATH/classes/controller/welcome.php' with ...
     public function action_index()
     {
      $userid = 'fred';
      Session::set('userid', 'barney');
      $userid = Session::get('userid');
      Debug::dump($userid);
    
      $this->response->body = View::factory('welcome/index');
     }
    

    b) 'http://example.com/' should show 'barney' in the dump. If you don't get any errors at this point, install Crude. Let me know what happens.
  • It's very kind of you. Thanks, I will try it later.
  • @PaulBoCo, That doesn't work as a test, sessions are only written at the end of script execution. Try this instead:
    public function action_index() {
    
        $userid = Session::get('userid');
    
        if ( empty($userid))
        {
            Debug::dump('Init session - no var present');
            Session::set('userid', 'barney');
        else
        {
            Debug::dump($userid);
        }
    
        $this->response->body =  View::factory('welcome/index'); }
    

    If you keep getting the 'init session' message, something is wrong.
  • Holy crumb, that is pretty impressive.
    This helped me understand a bit more about fuel.
    Thank you for sharing your package. Some notes from paulboco-crude-ac5a1fa.zip (looks like your last efforts were Aug 8): The main page displays:
    Runtime Notice!
    ErrorException [ Runtime Notice ]: Non-static method Crude\Table::get_listing() should not be called statically, assuming $this from incompatible context APPPATH/modules/crude/classes/controller/crud.php @ line 55: More exclamations:
    No input option configured in crude config for column type decimal!
    No input option configured in crude config for column type tinyint!
    No input option configured in crude config for column type smallint!
    No input option configured in crude config for column type mediumtext! Plus some huffing about underscores and table names and no durn prefix.
    Which made perfect sense on a second read. Good stuff.
  • Thanks WanWizard, I didn't even think of that.
  • Crude is a CRUD generator. Therefore, you would configure the app to one of your databases.
  • Thanks for pointing out these errors, @steward.
    Runtime Notice!
    ErrorException [ Runtime Notice ]: Non-static method Crude\Table::get_listing() should not be called statically, assuming $this from incompatible context APPPATH/modules/crude/classes/controller/crud.php @ line 55:
    This has now been fixed in the master branch.
    More exclamations:
    No input option configured in crude config for column type decimal!
    No input option configured in crude config for column type tinyint!
    No input option configured in crude config for column type smallint!
    No input option configured in crude config for column type mediumtext!

    This error is produced when a column data type has not been associated with a form input type. This can be configured in the file crude/config/crude.php as such:
    'datatype' = array(
        'input_type' => 'label',
    )
    
    i.e.
    'tinyint' = array(
        'text' => 'Text Box',
    )
    

    Hope this helps
  • Paul Boco wrote on Saturday 8th of October 2011:
    Crude is a CRUD generator. Therefore, you would configure the app to one of your databases.

    Problem solved. Thank you! :)
  • I have tried the code, but the same error comes.
    Bad luck...
  • Then the path is still not correct. You mentioned before you used '/tmp', maybe try 'C:\TMP'? (I can't test myself, I don't use Windows).
  • When I change 'path' to 'c:/session', and also create the directory, it works!
    So I modify the 'path' to APPPATH.'/tmp', it is also OK!
    I guess the old value('/tmp') have something wrong?
    Thanks a lot~~~
  • "Welcome to the Wonderful World of Windows"... :)
  • This looks very interesting :)
    I will download and play. Thanks PaulboCo
  • The package requires a class name finfo? I can't find it.
  • Thanks for taking the time to look at this, Phil F.
    Crude is the result of an upcoming project with 22 existing tables that I want to build with Fuel.
    All responses are welcomed.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion