Search

A new extension, “EXSL Function Manager” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Note: I’ve mentioned this extension a couple times here on the forum. I never had a use for it until last week, where it saved my proverbial bacon on a big project, so I decided to release it.

Very cool Andrew!

Fantastic. Just today I was working on a project with the guys at R&B (where Rowan and Brendan works) and founded a need for this.

@Allen

Glad to hear it was useful! I ended up needing it to integrate Symphony into a larger site where the global page header and footer were function calls that took arguments for things like extra js or css to be put in the head.

I’ve considered using it for email as well, having the XSLT output a description of an email task that would then be parsed by a php class. Out of curiosity, what kind of application did you have for it?

@ashooner

this extension is perfect for my needs at the moment; I’m using Symphony 2.2RC3. I tried the “helloworld” example and it doesn’t work. The error in the image attachment comes up and I can’t track it …

Also this error comes up in the log:

23 February 2011 21:28 > UNKNOWN: Line: 38 - Object of class DOMDocument could not be converted to string in file C:\wamp\www\arc22\symphony\lib\toolkit\class.frontendpage.php on line 260

Any ideas?

Thanks!

Attachments:
efm_error.png

Hi vlad,

I haven’t updated this for 2.2. I’ll give it a look and let your know.

@vladG

Ok, the EFM is working in 2.2, but my hello world extension example left a bit to be desired. I’m having an issue updating my github repo right now, so for the time being here is the working hello world ‘client’ extension. You should be able to install this as an extension in 2.2. Use the included XSLT in the Page you want to test it on.

Attachments:
hello_world.zip

Great! It works now. Indeed, there are some aesthetic tweaks that can be done only in PHP. Your extension really does the trick.

This extension causes

PHP Warning:  Call-time pass-by-reference has been deprecated in
.../extensions/exsl_function_manager/extension.driver.php on line 29

Note that: "This method (to force arguments to be passed by reference at function call time) is deprecated and is likely to be unsupported in future versions of PHP/Zend. The encouraged method of specifying which arguments should be passed by reference is in the function declaration." (from php.ini).

I'm using:

  • PHP 5.2.17,
  • Symphony 2.2,
  • EXSL Function Manager 0.5

I think you should be able to remove the ampersand from this line and add it to this line. I think. When passing objects by reference, the ampersand goes in the argument definition on the receiving method rather than in the method call itself. I think.

I think.

As far as I know objects are always passed by reference. So you can simply remove ampersand from this line.

PS. Extension version here and here is 0.5 but here it is 0.1 :)

I never had a need to use this until today. This rocks!

I am implementing a voting mechanism (using the Member Claims extension) and needed a way to prevent users tampering with the submitted form data. I have exposed PHP's sha1 function so I can use it in my template:

<input type="hidden" name="hash" value="{php:sha1('stuff goes here')}"/>

This maps onto a function in my extension:

public static function sha1($string) {
    $salt = Symphony::Configuration()->get('salt', 'custom-config');
    return sha1($string . '-' . $salt);
}       

Where I am appending a salt (stored in the config file) and returning the hash. In the event that accepts the form post I rebuild the hash using PHP and check that they match. If the checksum doesn't match, the data has been tampered with.

Handy.

When you create your own extension (like hello world in this example) do you still put it under /your-site/extensions or you can tell the system to load it from somewhere under /workspace?

Thank you,

You need to put the function inside your extension's class. This may fix the error you're having too ;o)

You need to put the function inside your extension's class. This may fix the error you're having too ;o)

What do you mean by "your extension's class"?

Sorry, all extensions, like the example, must reside under /extensions to be loaded by Symphony.

I thought this was relating to your other thread with the errors you reported.

This extension need to be rock again with S2.3, some issue are not resolve yet.

Can you elaborate?

nick, I have spotted an error with S2.3 and logged the issue in EFM git:

Fatal error: Call to a member function notifyMembers() on a non-object in C:xampphtdocsxamppsymphonyextensionsexslfunctionmanagerlibclass.functionmanager.php on line 17

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details