In TypoScript exists the possibility to get the environment variable HTTP_COOKIE_VARS (which is deprecated):
10 = TEXT
10.data = global : HTTP_COOKIE_VARS | some_cookie
I got this from the documentation.
But on my server (PHP 5.3) this variable is empty! I suppose this is because this environment variable is deprecated. Now I am running out of options, without using an extension, user function or user condition.
Maybe you have an idea! Thanks in advance.
this should do the job (at least with TYPO3 4.5 and PHP 5.3.8):
10 = TEXT
10.data = global:_COOKIE|some_cookie
10.wrap = <h2>Cookie: |</h2>
Unfortunately, there is no built-in functionality for the $_COOKIE variable.
You can however write a hook which implements the tslib_content_getDataHook interface and register it via
$TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'][] = 'path/to/your/class.user_cookiehook.php';
[request.getCookieParams()['some_cookie'] == 'some_value']
Your Code
[end]
Related
USING OpenEdge.Net.HTTP.*.
USING OpenEdge.Net.URI.
USING Progress.Json.ObjectModel.JsonObject.
DEFINE VARIABLE oClient AS IHTTPClient NO-UNDO.
i am getting an error
Multiple markers at this line - Could not understand line 8. (196) -
Invalid datatype specified: IHTTPClient. Specify a datatype such as
'character' or the name of a class. (5638)"
The REST client isn't really provided out of the box so you need to make sure you have it in your PROPATH.
Depending on your enviroment you might need to change it in a ini-file via PROTOOLS or programatically:
PROPATH = PROPATH + ",C:\Progressx86\OpenEdge\gui\netlib\OpenEdge.Net.pl".
Make sure to change the actual PATH to something that matches your installation. Also the "gui" part should be changed to tty if you're running a character client.
Helpful knowledgebase entry
I have a VC++ project which uses Lua 5.2 for scripting.
I am trying to implement MySQL compatibility into this project.
I do not own this project, so I would prefer to change as little source code as possible, if any at all.
I have downloaded and unzipped the files from this extension into the same base directory as the executable... and in my Main.lua file, I have added the line require('DBI') as stated to do so on this wiki page.
But when I run the application and execute the script, I get:
LUA Fail:
C:\Path\To\bin\DBI.lua:3: attempt to call global 'module' (a nil value)
After some light reading, I found out that the module function was depreciated in Lua 5.2...
But this extension, as well as other MySQL extensions, require the use of the module function.
So what is a workaround for this issue?
You may need to compile your Lua instance with LUA_COMPAT_MODULE; according to the source code: "LUA_COMPAT_MODULE controls compatibility with previous module functions 'module' (Lua) and 'luaL_register' (C)".
This won't be enough though as the module itself is written with Lua 5.1 API in mind. You can either try to find its Lua 5.2 version or use something like Peter Cawley's TwoFace that "allows a Lua 5.2 program to load most 5.1 C libraries without the need for any recompilation".
I used this as a quick and dirty way to get most of my scripting setup working with 5.2.
I didn't use module myself but have the likes of luasocket, copas etc in my stack.
I doubt this helps in your specific case but may be of some use more generally.
Essentially I replicated the C version of module in lua using the debug library to set the function environment. Not pretty but hey.
if not module then
function module(modname,...)
local function findtable(tbl,fname)
for key in string.gmatch(fname,"([%w_]+)") do
if key and key~="" then
local val = rawget(tbl,key)
if not val then
local field = {}
tbl[key]=field
tbl = field
elseif type(val)~="table" then
return nil
else
tbl = val
end
end
end
return tbl
end
assert(type(modname)=="string")
local value,modul = package.loaded[modname]
if type(value)~="table" then
modul = findtable(_G,modname)
assert(modul,"name conflict for module '"..modname.."'" )
package.loaded[modname] = modul
else
modul = value
end
local name = modul._NAME
if not name then
modul._M = modul
modul._NAME = modname
modul._PACKAGE = string.match(modname,"([%w%._]*)%.[%w_]*$")
end
local func = debug.getinfo(2,"f").func
debug.setupvalue(func,1,modul)
for _,f in ipairs{...} do f(modul) end
end
function package.seeall(modul)
setmetatable(modul,{__index=_G})
end
end
I am using wamp 2.0 and trying to install XDebug extension for php. I have followed all steps written here http://wiki.netbeans.org/HowToConfigureXDebug#How_to_configure_xdebug_with_WAMP
but still its not working.
Any suggestion how to fix this?
please follow the instructions at http://xdebug.org/find-binary.php
cheers,
Derick
If you're just debugging a local session using wampserver 3.0.6 and php 7.0.10 using xdebug, there's almost no need to edit your php.ini manually (more on that later).
You may activate xdebug.remote_enable from the tray icon menu. Having done so should yield something like the following output in php.ini (it's at the absolute end of the file):
; XDEBUG Extension
[xdebug]
zend_extension ="C:/wamp64/bin/php/php7.0.10/zend_ext/php_xdebug-2.4.1-7.0-vc14-x86_64.dll"
xdebug.remote_enable = On
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="C:/wamp64/tmp"
xdebug.show_local_vars=0
From there, the only thing you need to specifically add yourself (at least when using the php-debug extension in VS Code) to php.ini is:
xdebug.remote_autostart = 1
Don't forget to restart wampserver after that. If you need to connect remotely to another host, you would probably need som variation of (replace 127.0.0.1 with remote IP):
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
But that is pretty much outside the scope of my answer since that opens up a whole new can of worms IMHO
Follow instructions on http://xdebug.org/find-binary.php as Derick mentioned, but when configuring xdebug on Wampserver 3.0.0 I also had to add the following code to my php.ini.
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir = C:\wamp\tmp
for php 7 the configuration variables were renamed my final working configuration ended up like this:
xdebug.mode = develop,debug,profile
xdebug.start_with_request=yes
xdebug.output_dir =c:/wamp64/tmp
xdebug.show_local_vars = 1
xdebug.log=c:/wamp64/logs/xdebug.log
xdebug.log_level = 10
xdebug.client_host=localhost
xdebug.client_port=9000
I have a query l.q. l is var scoped:
var l = {};
If I dump l:
writeDump(var:l, abort:true);
I get
You can see that q (l.q) shows [undefined struct element]. However if I do:
writeDump(var:isQuery(l.q), abort:true);
I get yes as the output? Dumping l.q.recordCount returns 1.
If I dump l.q I get an error: Error Type java.lang.ArrayIndexOutOfBoundsException : [N/A].
This is causing me quite a headache as on my website I get variables randomly disappearing like this all the time.
Any ideas of what could be going on here? CF9.0.1 Ent running on Windows Server 2005.
It looks like whatever is populating your l.q variable is not working correctly. How is l.q being populated?
If you're using l = {} as a "local" scope replacement - don't ColdFusion 9 already has a local scope inside of functions and you can dump it.
Are these dumps in the same place? Remember that if you execute a query that does not return anything (such as an update or delete) but use the name parameter, that variable will be set to undefined. It sounds like this could be happening here.
I'm trying to set the text of a textfield using the Carbon API like this:
ControlID editId = {'EDIT', 3};
ControlRef ctrl;
GetControlByID(GetWindowRef(), &editId, &ctrl);
CFStringRef title = CFSTR("Test");
OSErr er = SetControlData(ctrl, kControlEntireControl, kControlEditTextTextTag, CFStringGetLength(title), title);
CFRelease(title);
I'm using the C++ code template of XCode, so GetWindowRef() is a call to the predefined TWindow class. The OSErr return value gives me noErr, but my textfield only contains garbage.
It doesn't matter if I set the attribute of my textfield to Unicode or not.
Any ideas what is wrong here?
What does the GetControlID(...) return? Is it noErr?
As a ControlRef is also a HIViewRef, you can also use the function:
HIViewSetText to set the text. This is documented to work with functions that accept kControlEditTextCFStringTag.
By the way, the line you wrote:
CFRelease(title);
Will cause problems. One should only release objects that have been made using functions that have Create or Copy in the API name. You'll want to read: "Introduction to Memory Management Programming Guide for Core Foundation" -- search in the Xcode documentation.
Finally this did the trick:
SetControlData(ctrl, kControlEditTextPart, kControlStaticTextCFStringTag, sizeof(title), &title);
Since this seems to be very old API, a better way seems to be:
HIViewSetText(ctrl, title);
Thx to Lyndsey for the hints.