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.
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
- <%@language=ActivePHP5 %>
+ <%@language=PHPScript %>
<% $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"
{ 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 }
};
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;
}
}
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??");
if (pass) {
m_basethread = tsrm_thread_id();
- HRESULT ret = GIT_put(pass, IID_IActiveScriptSite, &m_asscookie);
}
if (m_pass) {
trace("----> %s", php_win_err(ret));
if (SUCCEEDED(ret)) {
+ GIT_put(m_pass, IID_IActiveScriptSite, &m_asscookie);
SetScriptState(SCRIPTSTATE_INITIALIZED);
}
}
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;
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()