php-windows Digest 12 Aug 2008 18:45:17 -0000 Issue 3509

Topics (messages 29004 through 29007):

Variables variables and the Object Factory
        29004 by: Jerome Hollon

Re: COM-problem: Uninitializing COM-Objects <-> runtime error
        29005 by: Mario Trojan

XML-RPC Windows
        29006 by: Bolle.Tiscali.co.uk

Executing a batch file on Windows from Linux using a PHP or a Shell-Script
        29007 by: Parag Kalra

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello php-windows mailing group, this is my first post! :P I hope I
get it right.
I have a problem with a web app I'm developing. It is an ajax web app
that is built on PHP and JQuery. It works fine on my windows computer
running Apache, however, when I move into production on an IIS server,
it breaks (Yes, I know, developing and production environments need to
be the same. I wish that it was the case here, but it is not, I'm a
student working and I don't have the political leverage to get XP Pro
and IIS).
I've worked through most of the problems and fixed them, however there
is one that I can't for the life of my figure out how to fix it. I
know what's causing it, but I don't know why, and therefore I can't
fix it.

I have this function that creates an object based on the string that
is passed to it. The string that is passed to it is the name of the
class that is being created. It uses a niffty php feature and I can
create a object by doing $object = new $var(); And that works fine as
long as I've included the object, on Apache. On IIS that little code
fails, silently. If I pass it a class name that doesn't exist it
happily throws an error, but other than that it fails silently. What I
mean by failing silently is that when the ajax request comes for the
object, Firebug (firebug's nice isn't it) highlights it in red and the
request fails to return anything, not even a 404. Firebug's view
stat's the AJAX request response being 'Loading...', I.E., it's
waiting on the server.

Does anyone know how to fix this? I haven't the faintest clue what's
causing it or why. The code is below:

       /**
        *      This method creates the pane and finds it based on the classpath
and the class name.
        *
        *      CAUTION: Uses an Object Factory!
        *
        *      @param $div - the id for the pane
        */
       public function createPane($div){
               require_once(INTRA_PANES_AB."/".$div.".inc.php");
               $classname = explode("_",$div);
               $classes = array();
               foreach($classname as $class){
                       $classes[] = ucfirst($class);
               }
               $classname = (implode($classes, "_"));

               $object = new $classname();
               $tmp = $object->getTitle();     //empty cannot read
return values :(
               $title = $tmp;
               if($object->getTitle() == ""){
                       $title = $object->getId();
               }
               if($tmp == '-1')
                       $title = "";
               $pane = "\n<div class='pane'><dl class='sort'>";
               $pane .= $object->getBar();
               $pane .= "\t<dd><div class='$div'>";
               $pane .= $object->output();
               $pane .= "\n\t</div></dd>\n</dl></div>";

               return $pane;
       }



-- 
An optimist believes we live in the best of all possible worlds,
A pessimist fears this is true.

Note: If you don't send this letter to 8 billion people within the
next 3 minutes Richard Speck will come out of his grave and kill you
during the next full moon. I know this because he did it to a friend
of mine!

--- End Message ---
--- Begin Message --- It seems like the error message only occurs if i run the script in CLI interface. There is no error msg/popup or whatever, if the script is running in Apache.

Mario Trojan schrieb:
Hi,

i have a problem regarding some COM objects, especially with unitializing. It is possible to create a new COM object without problems, but at the end of each script a message is shown by the Microsoft Visual C++ Runtime Library:

"This application has requested the runtime to terminate it in a unusual way. Please contact the application's support team for more information".

I think that this message is thrown if one of the used COM objects wasn't uninitialized properly. Many COM objects have a method that needs to be called for uninitialization (e.g. Quit()), but some objects don't. And as soon as i try to work with one of these objects, the error message mentioned above is shown.

Is there any way to uninitialize the COM-object anyway, or at least to suppress that error message so that the script may end properly (otherwise a keypress is needed to end the script)?

This problem occurs with PHP versions between 5.2.1 and 5.2.6, i didn't test it with other versions yet.

Best Regards,
Mario Trojan

--- End Message ---
--- Begin Message --- I hope someone can help. I have been using the PHP XML-RPC extensions with great success on Linux. I recently decided to make my live a bit easier on the move by installing all necessary components on my Windows machine (I know...) On Linux the PHP script below works fine but on Windows the call to this script returns the verbatim PHP script (and not the executed code...). This is running on Apache 2.2.9 with PHP 5.2.6.

I must be doing something wrong in the Apache or PHP setup but I can't find it and would appreciate your help. Thanks in advance.

Brain

<?php

                function MyFunction ($method_name, $args, $user_data) {
                        $ReplyArray['OK']       = (string) "YES";
                        return $ReplyArray;
                }
                
                $XMLOptions = array(    'output_type' => 'xml',
                                                                'verbosity' => 
'pretty',
                                                                'version' => 
'auto',
                                                                'debug' => 2);
                
                $XMLServer = xmlrpc_server_create();

                xmlrpc_server_register_method($XMLServer, 'local.testxml',      
                'MyFunction');
                
                if ($response = xmlrpc_server_call_method($XMLServer, 
$HTTP_RAW_POST_DATA, null, $XMLOptions))
                {
                        header("Content-Type: text/xml");
                        header("Content-Encoding: identity");
                        echo $response;
                }

?>




--- End Message ---
--- Begin Message ---
Hey Friends,

This is my first post on this forum. It is not exactly a PHP based issue but
still if someone can help me out .. it will be great...

I am developing a shell-script to automate my daily work. At one stage I
want my shell-script to execute a "batch" file on Windows.

Please let me know what all options are available to me like "telnet" etc.

I was wondering if it can be done through "ftp" or "smbclient" ?

Can it be done by making the shell-script calling a php script that will
execute the batch file on the remote machine (perhaps by using one of the
vast abundant functions it is having)? Would someone like to throw some
light on it?

Cheers,
Parag Kalra

--- End Message ---

Reply via email to