wez             Wed Jul 28 08:32:49 2004 EDT

  Modified files:              
    /php-src/sapi/activescript  README classfactory.cpp scriptengine.cpp 
  Log:
  - Rename ProgID from ActivePHP (tm) to PHPScript (bah)
  - Convert line-endings for error messages to CRLF
  - Misc other tweaks
  
  
  
http://cvs.php.net/diff.php/php-src/sapi/activescript/README?r1=1.5&r2=1.6&ty=u
Index: php-src/sapi/activescript/README
diff -u php-src/sapi/activescript/README:1.5 php-src/sapi/activescript/README:1.6
--- php-src/sapi/activescript/README:1.5        Tue Jul 27 18:36:56 2004
+++ php-src/sapi/activescript/README    Wed Jul 28 08:32:49 2004
@@ -23,7 +23,7 @@
 Configuration.
 ==============
 
-ActivePHP will not use the default php.ini file.
+PHPScript will not use the default php.ini file.
 Instead, it will look only in the same directory as the .exe that caused it to
 load.
 
@@ -38,22 +38,22 @@
   Create a .wsf file like this:
 
   <job id="test">
-    <script language="ActivePHP5">
+    <script language="PHPScript">
          $WScript->Echo("Hello");
        </script>
   </job>
 
 o. ASP and ASP.NET
 
-  <[EMAIL PROTECTED] %>
+  <[EMAIL PROTECTED] %>
   <% $Response->Write("Hello"); %>
 
 o. Windows Script Components / Behaviours
 
-  Use language="ActivePHP5" on your <script> tags
+  Use language="PHPScript" on your <script> tags
 
 o. MS Scriptlet control
 
-  Set the language property to "ActivePHP5"
+  Set the language property to "PHPScript"
 
 
http://cvs.php.net/diff.php/php-src/sapi/activescript/classfactory.cpp?r1=1.11&r2=1.12&ty=u
Index: php-src/sapi/activescript/classfactory.cpp
diff -u php-src/sapi/activescript/classfactory.cpp:1.11 
php-src/sapi/activescript/classfactory.cpp:1.12
--- php-src/sapi/activescript/classfactory.cpp:1.11     Mon Jul 26 23:57:31 2004
+++ php-src/sapi/activescript/classfactory.cpp  Wed Jul 28 08:32:49 2004
@@ -15,7 +15,7 @@
    | Authors: Wez Furlong <[EMAIL PROTECTED]>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: classfactory.cpp,v 1.11 2004/07/27 03:57:31 wez Exp $ */
+/* $Id: classfactory.cpp,v 1.12 2004/07/28 12:32:49 wez Exp $ */
 
 /* IClassFactory Implementation, and DllXXX function implementation */
 
@@ -150,10 +150,10 @@
        { HKEY_CLASSES_ROOT,    "CLSID\\[CLSID]\\InprocServer32",       NULL,          
                 "[MODULENAME]" },
        { HKEY_CLASSES_ROOT,    "CLSID\\[CLSID]\\InprocServer32",       
"ThreadingModel",       "[THREADING]" },
        { HKEY_CLASSES_ROOT,    "CLSID\\[CLSID]\\OLEScript",            NULL,          
                 NULL },
-       { HKEY_CLASSES_ROOT,    "CLSID\\[CLSID]\\ProgID",                       NULL,  
                         "ActivePHP5" },
-       { HKEY_CLASSES_ROOT,    "ActivePHP5",                                          
 NULL,                           "ActivePHP5" },
-       { HKEY_CLASSES_ROOT,    "ActivePHP5\\CLSID",                            NULL,  
                         "[CLSID]"},
-       { HKEY_CLASSES_ROOT,    "ActivePHP5\\OLEScript",                        NULL,  
                         NULL},
+       { HKEY_CLASSES_ROOT,    "CLSID\\[CLSID]\\ProgID",                       NULL,  
                         "PHPScript" },
+       { HKEY_CLASSES_ROOT,    "PHPScript",                                           
 NULL,                           "PHPScript" },
+       { HKEY_CLASSES_ROOT,    "PHPScript\\CLSID",                             NULL,  
                         "[CLSID]"},
+       { HKEY_CLASSES_ROOT,    "PHPScript\\OLEScript",                 NULL,          
                 NULL},
        
        { 0, NULL, NULL, NULL }
 };
http://cvs.php.net/diff.php/php-src/sapi/activescript/scriptengine.cpp?r1=1.14&r2=1.15&ty=u
Index: php-src/sapi/activescript/scriptengine.cpp
diff -u php-src/sapi/activescript/scriptengine.cpp:1.14 
php-src/sapi/activescript/scriptengine.cpp:1.15
--- php-src/sapi/activescript/scriptengine.cpp:1.14     Tue Jul 27 18:36:56 2004
+++ php-src/sapi/activescript/scriptengine.cpp  Wed Jul 28 08:32:49 2004
@@ -15,7 +15,7 @@
    | Authors: Wez Furlong <[EMAIL PROTECTED]>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: scriptengine.cpp,v 1.14 2004/07/27 22:36:56 wez Exp $ */
+/* $Id: scriptengine.cpp,v 1.15 2004/07/28 12:32:49 wez Exp $ */
 
 /* Implementation Notes:
  *
@@ -419,7 +419,7 @@
        int i;
        for (i = 0; i < m_ids; i++) {
                if (!strcasecmp(m_names[i], aname.ansi_string())) {
-                       trace("already had this ID\n");
+                       trace("already had ID %d for %s\n", i, m_names[i]);
                        return i;
                }
        }
@@ -764,7 +764,7 @@
                pv.value.str.val = frag->code;
                pv.value.str.len = frag->codelen;
 
-               frag->opcodes = compile_string(&pv, "fragment (JIT)" TSRMLS_CC);
+               frag->opcodes = compile_string(&pv, "fragment" TSRMLS_CC);
 
                if (!frag->opcodes) {
                        trace("*** JIT compilation of cloned opcodes failed??");
@@ -1223,7 +1223,6 @@
 
        if (pass) {
                m_basethread = tsrm_thread_id();
-               HRESULT ret = GIT_put(pass, IID_IActiveScriptSite, &m_asscookie);
        }
        
        if (m_pass) {
@@ -1245,6 +1244,7 @@
                trace("----> %s", php_win_err(ret));
                
                if (SUCCEEDED(ret)) {
+                       GIT_put(m_pass, IID_IActiveScriptSite, &m_asscookie);
                        SetScriptState(SCRIPTSTATE_INITIALIZED);
                }
        }
@@ -1374,7 +1374,7 @@
        TWideString name(pstrName);
        trace("AddNamedItem: %s (%08x) m_pass=%08x\n", name.ansi_string(), dwFlags, 
m_pass);
        
-       res = m_pass->GetItemInfo(pstrName, SCRIPTINFO_IUNKNOWN, &punk, &ti);
+       ASS_CALL(res, GetItemInfo, (pstrName, SCRIPTINFO_IUNKNOWN, &punk, &ti));
 
        if (SUCCEEDED(res)) {
                IDispatch *disp = NULL;
@@ -1960,11 +1960,35 @@
        
        TActiveScriptError(const char *filename, const uint lineno, const char 
*message)
        {
+               char *extra_buf, *dest;
+               int msglen = strlen(message);
+
+               extra_buf = (char*)emalloc(2 * msglen + 1);
+
+               /* convert line endings so multi-line output looks reasonable in a GUI 
*/
+               dest = extra_buf;
+               while (*message) {
+                       if (*message == '\n') {
+                               *dest++ = '\r';
+                               *dest++ = '\n';
+                               message++;
+                       } else if (*message == '\r' && message[1] == '\n') {
+                               *dest++ = '\r';
+                               *dest++ = '\n';
+                               message+=2;
+                       } else {
+                               *dest++ = *message++;
+                       }
+               }
+               *dest = '\0';
+               
                m_refcount = 0; /* start with zero refcount because this object is 
passed
                                                 * directly to the script site; it 
will call addref */
                m_filename = TWideString::bstr_from_ansi((char*)filename);
-               m_message = TWideString::bstr_from_ansi((char*)message);
+               m_message = TWideString::bstr_from_ansi(extra_buf);
                m_lineno = lineno;
+
+               efree(extra_buf);
        }
 
        ~TActiveScriptError()

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to