Share » Forums » Install & configuration » Layout/structure of extensions

Layout/structure of extensions

Layout/structure of extensions

Wednesday 24 March 2010 3:25:43 am - 5 replies

Author Message

Nicolas Pastorino

Wednesday 24 March 2010 3:49:02 am

Let's start some brainstorming all together :)

So you are saying that specifying the full relative path to an extension in site.ini actually works ?
Tried with many different extension types ?

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Peter Rudolfsen

Wednesday 24 March 2010 4:05:50 am

There are probably some extensions out there that have 'ifs' or similar logic around the names of an extensions, but those can be easily overcome by exploding the string and getting the last element.

But of course, if there are loads of extensions with logic around extension-names, it might not be that easy to specify paths like this.

I still think this is a good idea, cause you could also add support for enabling extensions based on it's parent, or parents parent etc...

Peter Rudolfsen

Sunday 28 March 2010 11:46:53 pm

I have a few additions around this...

ExtensionAutoloadPath also needs to be modified to fit the new structure.

And the worst part is that all the $eZTemplateOperatorArray arrays need to be changed too. I was hoping to make this possible without having to change any code, but I can't see how that's possible at this time.

Peter Rudolfsen

Sunday 25 April 2010 1:50:17 am

I've managed to structure all extensions / sites in a tree, and still load them the traditional way by using this method:

http://share.ez.no/forums/setup-design/multiple-siteaccess-design-solution#comment58711

Abdelkader RHOUATI

Sunday 25 April 2010 6:37:09 am

class eZExtension
{

....


  static function activateExtensions( $extensionType = false ){
                $extensionDirectory = eZExtension::baseDirectory();            $activeExtensions = eZExtension::activeExtensions( $extensionType );              $hasExtensions = false;
        $ini = eZINI::instance();
        foreach ( $activeExtensions as $activeExtension )
        {
          $extensionSettingsPath = $extensionDirectory . '/' . $activeExtension . '/settings';
          if ( file_exists( $extensionSettingsPath ) )                 {
             $ini->prependOverrideDir( $extensionSettingsPath, true );
             if ( isset( $GLOBALS['eZCurrentAccess'] ) )
             { 
                eZExtension::prependSiteAccess( $activeExtension );
             }                              
             $hasExtensions = true;
         }
         else if ( !file_exists( $extensionDirectory . '/' . $activeExtension ) )
         {
                eZDebug::writeWarning( "Extension '$activeExtension' does not exist, looked for directory '" .  $extensionDirectory . '/' . $activeExtension . "'" );
         }
      }
      if ( $hasExtensions )
           $ini->loadCache();

     }

.......

}

Peter, The operation that you describe is quite logical, above the function ez, which checks if an extension enabled exist, with the line:
! File_exists ($ extensionDirectory. '/'. ActiveExtension $);

($extensonDirectory: the directory "extension" ;
$activeExtension: name / path in the settings files for each extension)

I think if you put the name of the extension,or the path of the extension, EZ doesn't care, the important thing is that the directory of the extension exists

.
It will be useful, sometimes you end up with more that 20 extensions, it will be good to group them into separate directories, somethings like that:

extension /
ezsystem /
.... (Default extension that comes with ez)
Design /
....
webservices /
....

TKS,

Regrads

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu