Matthew Snow

Ranch Hand
+ Follow
since May 02, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Matthew Snow

Ok, I figured it out. It had to do with my CAS config.php settings. At the bottom is the following piece of code



This effectively is what was causing a session cookie to be generated for each page based off of the page's name. Replacing basename($_SERVER['SCRIPT_NAME']) with 'mySite' has solved the issue.
10 years ago
PHP
I've followed Jasig's PHP CAS documentation and have successfully implemented their sample code found here (https://github.com/Jasig/phpCAS/blob/master/docs/examples/example_simple.php). This works well for a single page site, but I'm at a loss for how implement this for multiple pages. For example, how do I check if the user is authenticated on subsequent pages after successfully logging in? I thought I would just need to add this code to each of them but what I've found is that though it doesn't redirect me to our CAS signon page again, it does however generate a new unique session cookie for that subsequent page. Essentially, a unique session cookie is generated for each of the pages on my site. If it then try to log out (phpCAS::logout;) from one of these pages, only that page's unique session cookie is invalidated leaving the others active. Essentially I would need to call logout on every page.
10 years ago
PHP
Just as a wrap up if anyone else new to PHP is trying to use a minimalist database with their PHP script, the following code works after enabling the php_sqlite3.dll extension in the php.ini file for Windows users. When run, this code will create a file test.db in the same directory where it is run.

10 years ago
PHP
Thanks for the advice. From what I'm reading online it seems like that's going to be my bread and butter for PHP development, though for this instance I'll probably go with SQLite.
10 years ago
PHP
I see. The reason I'm wanting to do this is I'm dealing with large amounts of data from a web service and so have sacrificed memory for speed and of course I'm running into heap size issues just using arrays. Rather than just increasing PHP's heap size, I thought I'd use the on-demand'ness of a database to dump the data in bulk from the web service so I could query it as needed much faster. I was hoping to go with a "lite as can be" local file system database like HSQLDB which wouldn't require web server or a bunch of libraries to setup. Is there something akin to this in PHP, or should I be approaching the problem in another way?
10 years ago
PHP
I am able to do this in Java with HSQLDB's jdbc driver as follows:



This would reference a db.script file located on the file system at C:\Test\ which contained the schema for all the tables being used as well as their data. Is it also possible to reference a HSQLDB script file within the same working directory as your PHP code using oci, odbc, pdo or something else?
10 years ago
PHP
Thanks for the reply. Below is my /etc/init.d/tomcat script. This script is invoking CATALINA_HOME/bin/catalina.sh. I did not enable the tomcat user in rc.conf, file does not exist on CentOS 6.5, or at least I can't find it. The chkconfig commands I used were "chkconfig --add /etc/init.d/tomcat" and "chkconfig --level 234 /etc/init.d/tomcat on".

10 years ago
I've setup tomcat on a CentOS 6.5 and chown'ed the directory as tomcat:tomcat (a valid user on the server). I've placed my startup script in /etc/init.d/tomcat (chmod 755) and I've registered it with chkconfig at level 234, though a --list shows level 5 is also on. We've also disabled SELinux, but tomcat still will only come up when the user account root is logged into. The only thing I can think of is that I did all of this as the root user, not as the tomcat user using sudo. Would that be the cause of my problem, or am I missing something else.
10 years ago
I'm running Xampp 1.8.3 for windows (my machine is x64) which comes with PHP 5.5.3 included with cURL enabled by default. I've installed a fresh new copy and am trying to test a connection to mozilla.org over ssl with cURL using a .pem file I extracted from the site's certificate using FireFox 24. But I'm getting the error "unable to get local issuer certificate". Here is my code:



Here is the contents of the pem file:
11 years ago
PHP
I've tried Apache's VFS (commons-vfs), but it relies on Jsch as a dependency, and so does not support ECDSA.
11 years ago
I need to connect and upload to a remote sftp server using a ecdsa-sha2-nistp256 key. Unfortunately, it seems Jsch doesn't support ECDSA yet. Are there any other libraries that I could use that support SSH 2? Thanks.
11 years ago
Solved it, putting the @XmlValue element in the parent class has solved this instance as well and any other empty name element occurrences as well. Here is what the two classes look like:



Thanks g tsuji, that does work. For anyone wondering, codehaus has a nice maven jaxb plugin for generating code from an xml schema (http://www.altuure.com/2008/01/22/jaxb-quickstart-via-maven2/).

Unfortunately, my Pet bean extends another class and JAXB does not allow the use of @XmlValue on a class that derives another class. I guess I'm just going to have to rethink my code structure on this one.
Thanks for the help, but I've got another. Back to the Pet XML, here's what I got: