9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello there
so i have a txt file containing word like "one two three four plus four five six".
I want to save every word in the file into a variable, and then use that variable to generate real numbers and apply the arithmetic value on them.
example: the txt files becomes 123 + 456 and... (10 Replies)
Discussion started by: azaiiez
10 Replies
2. UNIX for Beginners Questions & Answers
Hej guys,
I am trying to read a csv file line by line, save it's fields as variables per line so I can use them as parameters and execute stuff.
I am new to shell scripting and was just strictly following a tutorial. Somehow my version seems to ignore the loop. Any help?
TY! :)
#!/bin/bash... (12 Replies)
Discussion started by: Splinter479
12 Replies
3. Shell Programming and Scripting
Hi Experts,
Problem statement :
We have an URL for which we need to read the data and get parsed inside the shell scripts.My Aix has very limited perl utility, i cant install any utility as well.
Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled it.... (12 Replies)
Discussion started by: scott_cog
12 Replies
4. UNIX for Dummies Questions & Answers
Hi Experts,
Problem statement :
We have an URL for which we need to read the data and get parsed inside the shell scripts.
My Aix has very limited perl utility, i cant install any utility as well.
Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled... (0 Replies)
Discussion started by: scott_cog
0 Replies
5. Shell Programming and Scripting
Hi,
I have on Designdocument in that information is stored with in tabular format.I need Perl/unix script to read and write the data
using perl script?
Regards,
Ravi (4 Replies)
Discussion started by: toravi.pentaho
4 Replies
6. SCO
Situation - i have an IDE hard drive from server apparently running SCO last used in 2003. No access to computer it was formerly in. I need to access the drive to pull off data files from a billing/scheduling program. I have no SCO machine or access to one atm. Have some limited Linux... (3 Replies)
Discussion started by: lordlars1
3 Replies
7. UNIX for Advanced & Expert Users
I have 3 columns in an excel sheet.
c1 c2 c3
EIP_ACCOUNT SMALL_TS_01 select A.* from acc;
All the above 3 col shoud be passed a variable in the unix code.
1.How to read an excel file
2.How to pass these data as variable to the unic script (1 Reply)
Discussion started by: Anne Grace
1 Replies
8. UNIX for Dummies Questions & Answers
Hello All:
We have acquired a business (UNIX system) and inherited data which is on SDLT tapes. We'd like to read this data and save it in Windows format, if possible.
Anyone in the know on how to do that, if feasible?
Please give your suggestions.
Regards (2 Replies)
Discussion started by: yourstruly
2 Replies
9. Shell Programming and Scripting
Hi
I am very new to NAWK programming so this question is probably going to sound really stupid:
I have a NAWK script which contains a DO loop. During each loop it runs a FORTRAN program which in turn generates two output files , each one containing 2 integer variables. I would appreciate it... (8 Replies)
Discussion started by: robbiegregg
8 Replies
SESSIONHANDLER(3) 1 SESSIONHANDLER(3)
The SessionHandler class
INTRODUCTION
SessionHandler is a special class that can be used to expose the current internal PHP session save handler by inheritance. There are seven
methods which wrap the seven internal session save handler callbacks ($open, $close, $read, $write, $destroy, $gc and $create_sid). By
default, this class will wrap whatever internal save handler is set as defined by the session.save_handler configuration directive which is
usually $files by default. Other internal session save handlers are provided by PHP extensions such as SQLite (as $sqlite), Memcache (as
$memcache), and Memcached (as $memcached).
When a plain instance of SessionHandler is set as the save handler using session_set_save_handler(3) it will wrap the current save han-
dlers. A class extending from SessionHandler allows you to override the methods or intercept or filter them by calls the parent class meth-
ods which ultimately wrap the interal PHP session handlers.
This allows you, for example, to intercept the $read and $write methods to encrypt/decrypt the session data and then pass the result to
and from the parent class. Alternatively one might chose to entirely override a method like the garbage collection callback $gc.
Because the SessionHandler wraps the current internal save handler methods, the above example of encryption can be applied to any internal
save handler without having to know the internals of the handlers.
To use this class, first set the save handler you wish to expose using session.save_handler and then pass an instance of SessionHandler or
one extending it to session_set_save_handler(3).
Please note the callback methods of this class are designed to be called internally by PHP and are not meant to be called from user-space
code. The return values are equally processed internally by PHP. For more information on the session workflow, please refer ses-
sion_set_save_handler(3).
CLASS SYNOPSIS
SessionHandler
SessionHandlerSessionHandlerInterface
Methods
o public bool SessionHandler::close (void )
o public string SessionHandler::create_sid (void )
o public bool SessionHandler::destroy (string $session_id)
o public bool SessionHandler::gc (int $maxlifetime)
o public bool SessionHandler::open (string $save_path, string $session_name)
o public string SessionHandler::read (string $session_id)
o public bool SessionHandler::write (string $session_id, string $session_data)
Warning
This class is designed to expose the current internal PHP session save handler, if you want to write your own custom save handlers,
please implement the SessionHandlerInterface interface instead of extending from SessionHandler.
CHANGELOG
+--------+--------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------------------------+
| 5.5.1 | |
| | |
| | Added SessionHandler.create_sid(3). |
| | |
+--------+--------------------------------------+
Example #1
Using SessionHandler to add encryption to internal PHP save handlers.
<?php
class EncryptedSessionHandler extends SessionHandler
{
private $key;
public function __construct($key)
{
$this->key = $key;
}
public function read($id)
{
$data = parent::read($id);
return mcrypt_decrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
}
public function write($id, $data)
{
$data = mcrypt_encrypt(MCRYPT_3DES, $this->key, $data, MCRYPT_MODE_ECB);
return parent::write($id, $data);
}
}
// we'll intercept the native 'files' handler, but will equally work
// with other internal native handlers like 'sqlite', 'memcache' or 'memcached'
// which are provided by PHP extensions.
ini_set('session.save_handler', 'files');
$handler = new EncryptedSessionHandler('mykey');
session_set_save_handler($handler, true);
session_start();
// proceed to set and retrieve values by key from $_SESSION
Note
Since this class' methods are designed to be called internally by PHP as part of the normal session workflow, child class calls to
parent methods (i.e. the actual internal native handlers) will return FALSE unless the session has actually been started (either
automatically, or by explicit session_start(3). This is important to consider when writing unit tests where the class methods might
be invoked manually.
PHP Documentation Group SESSIONHANDLER(3)