Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7159882
ct_file.inc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ct_file.inc
View Options
<
?
php
##
##
Copyright
(
c
)
1999
Oliver
Teuber
<
oliver
@
teuber
.
com
>
##
##
PHPLIB
Data
Storage
Container
using
Files
##
##
Code
inspired
by
ct_dbm
.
inc
class
CT_File
{
##
##
Define
these
parameters
by
overwriting
or
by
##
deriving
your
own
class
from
it
(
recommened
)
##
var
$
file_path
=
""
;
##
Path
where
to
store
the
session
files
##
writable
by
the
web
server
UID
##
end
of
configuration
function
ac_start
()
{
#
Not
needed
in
this
instance
}
function
ac_get_lock
()
{
#
Not
needed
in
this
instance
}
function
ac_release_lock
()
{
#
Not
needed
in
this
instance
}
function
ac_newid
(
$
str
,
$
name
)
{
return
$
str
;
}
function
ac_store
(
$
id
,
$
name
,
$
str
)
{
$
f
=
fopen
(
$
this
-
>
file_path
.
"$id$name"
,
'
w
+
'
);
if
(
$
f
<
0
)
{
return
false
;
}
fputs
(
$
f
,
urlencode
(
$
str
));
fclose
(
$
f
);
return
true
;
}
function
ac_delete
(
$
id
,
$
name
)
{
unlink
(
$
this
-
>
file_path
.
"$id$name"
);
}
function
ac_gc
(
$
gc_time
,
$
name
)
{
}
function
ac_halt
(
$
s
)
{
echo
"<b>$s</b>"
;
exit
;
}
function
ac_get_value
(
$
id
,
$
name
)
{
if
(
file_exists
(
$
this
-
>
file_path
.
"$id$name"
))
{
$
f
=
fopen
(
$
this
-
>
file_path
.
"$id$name"
,
'
r
'
);
if
(
$
f
<
0
)
return
''
;
$
s
=
fgets
(
$
f
,
10240
);
fclose
(
$
f
);
return
urldecode
(
$
s
);
}
else
return
''
;
}
}
?
>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 23, 2:18 PM (23 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3409233
Default Alt Text
ct_file.inc (1 KB)
Attached To
Mode
rCDRT CDRTool
Attached
Detach File
Event Timeline
Log In to Comment