How make a tar.gz file to install a new module?

Discussion in 'General' started by danardf, Aug 10, 2009.

  1. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Into tar.gz file, there's a xml file.
    I think that this file is used to prepare at the module install, menu etc... But I don't see very well how do it!
     
  2. bmacias

    Joined:
    Sep 27, 2007
    Messages:
    205
    Likes Received:
    0
    Hmm,

    In, What version elastix you want make a tar.gz file to install?
     
  3. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Oups. I forgot. :laugh:

    1.6

    But, I use currently the dev module 1.0.5 Beta, and do you think that exist and new version or another tools to make easily a module?
    The dev module 1.0.5 is useful yet, but... but..

    Today, I try to make a new module (Hotel), and there are functions everywhere. It's dreadful. :S :blink: :side: :silly:
     
  4. Zenteno

    Joined:
    Mar 31, 2011
    Messages:
    2
    Likes Received:
    0
    Re: Re:How make a tar.gz file to install a new module?

    Actually in the version 2.3.0, you need make the same .(zip|tar|tgz) file but, the structure is a little bit different.

    So need something like this:

    - FooModule/
    |-- setup/
    |--- installer.php
    |-- menu.xml
    |-- modules/
    |--- barModule

    Here is a example about menu.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <module>
    	<menulist>
    	    <menuitem menuid="foomodule" desc="FooModule" parent="" module="no" link=""></menuitem>
    	    <menuitem menuid="barmodule" desc="BarModule" parent="foomdule" module="yes" link="" order="1"></menuitem>
        </menulist>
    </module>
    
    Inside the installer.php only need

    Code:
    <?php
    
    ?>
    
    If your installer doesn't need something like make a database.

    after that just
    Code:
    $tar -cvzf foomodule.tar.gz foomodule
    
    That's all
     
  5. Zenteno

    Joined:
    Mar 31, 2011
    Messages:
    2
    Likes Received:
    0
    Re: Re:How make a tar.gz file to install a new module?

    mmm but actually I'm trying to load a module, but this structure does not working

    This code located in the file ../modules/load_module/index.php line 130, I don't know why the function is returning null

    Code:
    function obtainName($file_name)
    {
        $newName = trim(`tar -tf $file_nm | head -n 1`);
        return $newName;
    }
    
    

    this function is called by this code:
    Code:
    
            if(file_exists("$tmpDir/module.xml")){
              $file_xml       = "$tmpDir/module.xml";
              $file_installer = "$tmpDir/installer/installer.php";
              $path_modules   = "$tmpDir";
            }
            else{
    
                $arrReg = obtainName($tmpFile);
                $file_xml       = "$tmpDir/$arrReg/menu.xml";
                $file_installer = "$tmpDir/$arrReg/setup/installer.php";
                $path_modules   = "$tmpDir/$arrReg/modules";
            }
    
    So always $arrReg is null, somebody can explain it?

    Regards
     

Share This Page