Is there a way to tell PHP, "Spend 5 seconds trying to reach the
database, if you can't reach it, then load the file from the cached
flat file."
I suspect the answer is no. I'm tempted to rewrite all my code in
Java, just so I can have threads. And private methods. And private
class properties. And real encapsulation. And interfaces. And abstract
classes. And the ability to do anything. 5 1775
>Is there a way to tell PHP, "Spend 5 seconds trying to reach the database, if you can't reach it, then load the file from the cached flat file."
mysql.connect_timeout can be set to make a connection time out if
it's taking too long. Unfortunately it seems to be settable only
on a system-wide basis.
PHP does not cache flat files unless you tell it to do so and how
to do so. However you managed that, you could tell PHP to do it
if the connection attempt timed out.
Gordon L. Burditt
"lawrence" <lk******@geocities.com> wrote in message
news:da**************************@posting.google.c om... Is there a way to tell PHP, "Spend 5 seconds trying to reach the database, if you can't reach it, then load the file from the cached flat file."
I suspect the answer is no. I'm tempted to rewrite all my code in Java, just so I can have threads. And private methods. And private class properties. And real encapsulation. And interfaces. And abstract classes. And the ability to do anything.
Use ticks (or Java) http://uk2.php.net/manual/en/functio...k-function.php
"CJ Llewellyn" <sa****@tmslifeline.com> wrote in message news:<ca**********@slavica.ukpost.com>... "lawrence" <lk******@geocities.com> wrote in message news:da**************************@posting.google.c om... Is there a way to tell PHP, "Spend 5 seconds trying to reach the database, if you can't reach it, then load the file from the cached flat file."
I suspect the answer is no. I'm tempted to rewrite all my code in Java, just so I can have threads. And private methods. And private class properties. And real encapsulation. And interfaces. And abstract classes. And the ability to do anything.
Use ticks (or Java)
http://uk2.php.net/manual/en/functio...k-function.php
That's a good function that I didn't know about. It looks just like
timer() in javascript. Still, it is not threads, as near as I
understand it. What would I call to stop a database call and switch
directions isn't clear to me. Perhaps a function that tests the if the
database connection was already made, and if not, then get the flat
file? go***********@burditt.org (Gordon Burditt) wrote in message news:<ca********@library2.airnews.net>... Is there a way to tell PHP, "Spend 5 seconds trying to reach the database, if you can't reach it, then load the file from the cached flat file."
mysql.connect_timeout can be set to make a connection time out if it's taking too long. Unfortunately it seems to be settable only on a system-wide basis.
PHP does not cache flat files unless you tell it to do so and how to do so. However you managed that, you could tell PHP to do it if the connection attempt timed out.
I'll give that a try, thanks.
"lawrence" <lk******@geocities.com> wrote in message
news:da**************************@posting.google.c om... "CJ Llewellyn" <sa****@tmslifeline.com> wrote in message
news:<ca**********@slavica.ukpost.com>... "lawrence" <lk******@geocities.com> wrote in message news:da**************************@posting.google.c om... Is there a way to tell PHP, "Spend 5 seconds trying to reach the database, if you can't reach it, then load the file from the cached flat file."
I suspect the answer is no. I'm tempted to rewrite all my code in Java, just so I can have threads. And private methods. And private class properties. And real encapsulation. And interfaces. And abstract classes. And the ability to do anything.
Use ticks (or Java)
http://uk2.php.net/manual/en/functio...k-function.php
That's a good function that I didn't know about. It looks just like timer() in javascript. Still, it is not threads, as near as I understand it. What would I call to stop a database call and switch directions isn't clear to me. Perhaps a function that tests the if the database connection was already made, and if not, then get the flat file?
It's not threading, the best I could describe it would be the same as adding
a call back function to the main php interpreter execution loop.
Your function should check to call to see if it had been called before, if
not attempt a sql connection. If it has, check to see if the connection is
timed out then cancel the tick function and exit the waiting loop. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jane Doe |
last post by:
Hi,
Besides Pivot (I'd rather wait for the final release), EasyCMS (the
navigation bar is static), and CMSimple (all documents saved in a
single HTML, so not good for lengthy articles)... do you...
|
by: siliconmike |
last post by:
How do I synchronize MySQL table data of my home PC with latest data
from a remote server ?
My home PC is on a very slow internet connection, so implementing
replication will cause long time...
|
by: Paul M. |
last post by:
Hi,
Are there any examples of building a simple local database with
C# Express 2005?
TIA
|
by: vunet.us |
last post by:
Hi,
I would like to use flat file data storage instead of database. Since I
am new to it, I am wondering:
What text file extension is a safe one to store my data online and how
cost- and...
|
by: jacques.steward |
last post by:
I have an application that kicks off a long process on the database
server with a separate thread and then forwards the user to another
page which monitors the progress of this process by reading a...
|
by: ircmaxell |
last post by:
Ok, I have a program that reads the contents of a file (1 line, 5 '|'
seperated items). Every so often (between twice a day, and 200 times a
day), it rewrites the contents of that file. I also do...
|
by: Fordraiders |
last post by:
vb.net 2003
Office 2003
What I have:
C:\TestData\Input.txt
Text File Pipe Delimited : 4 columns Of data
example:
00001|NO BRAND NAME ASSIGNED|6DU27|M3-.5 X 6 FLAT HD SOCKET CAP SCREW,...
|
by: felciano |
last post by:
Hello --
Is there a convention, library or Pythonic idiom for performing
lightweight relational operations on flatfiles? I frequently find
myself writing code to do simple SQL-like operations...
|
by: Flugeldorph |
last post by:
I am new to Visual Basic, my preferred languages is C or C++. I am trying to load a local database with data that I am reading from a delimited flat file. I have created the database tables and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |