Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





How To Include PEAR In Php.ini?


I don't want to provide absolute path to PEAR files. How to include in php.ini?




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Pear Include
i looked for a seperate PEAR board but didnt see any so not sure if im posting this in the right place: I've installed pear onto my windows (not my choice), installed all the packages that I need etc, the problem is that i dont have access to change the include_path so in every script I need to include something like this Code:

View Replies !   View Related
Pear Include Path
Is there a way to find the path to pear libraries (such as DB.php) if you do not have shell access? I have access to some space on an ISP's server and I want to use PEAR, but I don't know where to find the files. Any way to tell from phpinfo().

View Replies !   View Related
Pear Package Sub-include
I was trying the pear package on my local winmachine and noticed that one of the includes has a backslash

<?php
include('Mail.php');
include('Mailmime.php');

is this a path backslash? i.e. if I access pair on my linux server, do I have to put a forward slash in between Mail and mime? such as Mail/ mime.php Or does the slash have another meaning? I haven't found a lot of pear documentation and the one I am reading has that slash, which I'm not sure is for any host or just for win.

View Replies !   View Related
Include PEAR DB Framework Using PHP 5.0.4 On Windows 2000
Get the following errors when trying to include PEAR DB framework using
PHP 5.0.4 on Windows 2000 with Apache 2.

Warning: main(PEAR-1.3.3/DB/DB.php) [function.main]: failed to open
stream: No such file or directory in E:Program FilesApache
GroupApache2htdocsservusincludesinclude.php on line 19

Fatal error: main() [function.require]: Failed opening required
'PEAR-1.3.3/DB/DB.php' (include_path='.includes;.') in E:Program
FilesApache GroupApache2htdocsservusincludesinclude.php on line 19

The include_path config variable looks like this:
include_path = ".includes;."

PHP is installed in
e:php-5.0.4
and the PEAR Class defs are in
e:php-5.0.4includesPEAR-1.3.3DBDB.php

The includes that fail are:
include_once("PEAR-1.3.3/DB/DB.php");

These worked with 4.4.0, but fail with 5.0.4 ...

View Replies !   View Related
PEAR::SOAP Installed, But Script Execution Just Stops On Include
i have PEAR::SOAP installed correctly (beta, all dependent packages are
installed). When i try out the following simple Script

<?php
print "Include is ... ";
include_once("SOAP/Server.php");
print " ok!";
?>

the Server only outputs "Include is...". The PEAR-Packages are
includable, i checked all server settings, nothing is wrong with the
apache/php config, so it must be another problem which i can't figure
out. The Server does not report any errors at all when executing the
test-script above. I have the same problem on my local machine (XAMPP
installation, using PHP4), so i think it's a problem with PEAR::SOAP
and not a server config.

Running on a linux machine with Apache 2 and PHP 4.3.8.

Installed packages:
===================
Package Version State
Archive_Tar 1.3.1 stable
Console_Getopt 1.2 stable
DB 1.7.6 stable
Date 1.4.5 stable
File 1.2.2 stable
HTTP_Request 1.3.0 stable
Log 1.9.0 stable
Mail 1.1.9 stable
Mail_Mime 1.3.1 stable
Net_DIME 0.3 beta
Net_Socket 1.0.6 stable
Net_URL 1.0.14 stable
PEAR 1.3.5 stable
SOAP 0.9.1 beta
XML_RPC 1.4.4 stable

View Replies !   View Related
PEAR Newbie Trying To User PEAR DB And Falling At The First Hurdle
I've just installed PEAR on my local machine and all is well, updated
the include_path to point to my PEAR dir. So, when I just try to make
a simple connection like so the script just seems to stop but no error
messsages. I do get error messages normally (ie. when I can a method
from an object that doesnt actually exist) as I have set...

View Replies !   View Related
Pear Shaped PEAR
I read about PEAR in here a few days ago and thought I would give it a try
but I have got myself in a mess with the installation. I have found some
guides but they seem to move swiftly on from installation and get down to
using it.

I am using PHP 5.2.3 which came with NuSPhere PhED and is installed under...

View Replies !   View Related
Go-pear.bat:okay - Pear.bat Error - 5.2.4
first attempt at PEAR installation: PHP 5.2.4 - WinXP Sp2 - Apache 2.2

the Initial instruction, post-installation [local, vs system-wide] tells me (not verbatim) "...old version found... remember to use ./php/pear.bat instead...."

hence, the following command. note the feedback. Code:

View Replies !   View Related
Search Script - Warning: Include(usr/local/lib/php/index.php) [function.include]: Failed To Open Stream:
A while ago I installed a script. It all worked just fine untill my host upgraded the servers. Since that moment I have an error message when I try to do a search.
This is the error:

Warning: include(usr/local/lib/php/index.php) [function.include]: failed to open stream: No such file or directory in /var/www/g28894/planthunteronline.com/HTML/directory/links.php on line 13

Warning: include() [function.include]: Failed opening 'usr/local/lib/php/index.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/g28894/planthunteronline.com/HTML/directory/links.php on line 13

Below I have added a part the script that may cause the problem (the complete script is to large to post). Please keep in mind that I am not a php programmer and I don't understand anything about it. I am just looking for a part of code that can solve the problem. Code:

View Replies !   View Related
Include(menu.inc) [function.include]: Failed To Open Stream:
I have been working on a website for a few days and after uploading it to a temporary host because I hadn't had any errors testing it by myself i got this error Warning: include(menu.inc) [function.include]: failed to open stream: Too many open files in /home/zendurl/public_html/d/diagrams/Search3.php on line 28.

View Replies !   View Related
Include Or Virtual Include: Neither Work For Subfolders
my includes files are all in my /ssi directory. I have many subfolders that call those includes files. Let's say I have a file like this:

/news/world/asia/thailand/index.php

In order to (relatively) call a file in the /ssi directory I have to use the following code:

<?php
include ("../../../../ssi/html-lang.htm");
?>

This is ridiculous. Everytime I make a new subfolder I don't want to have to add "../" to it. I heard about "virtual" includes but I'm not sure the syntax I'm using is correct (all I do is put 'virtual' after 'include'). Is there something I'm missing? Do I have to change the .htacess file? Help me please I'm going crazy. I don't want to resort to absolute referencing...

View Replies !   View Related
Can I Use Include() To Include A Webpage In An Email Message ?
can I use include() to include a webpage in an email message ? below is correct ?
"email-manual.php" will content graphics with code [form confirmation fields] like:

$Country = $_POST['Country'];
echo "Country=" . $Country;

Code:

View Replies !   View Related
Include (Change Include File Within The Page)
I am working on a website that requires the use of include files, i have the include html files ready and can properly show them in the page but I am looking for a way to have a menu on the page where the user can choose which file he would like to read,

I dont want to have multiple pages I would like to just have the actual php include code change when the user picks the file he would like to read. Anyone know of a way to do this?

View Replies !   View Related
Use The Include Statement And Include A File
When I use the include statement and include a file, it prints on the web page - these are functions that I call deeper into my web page. there must be a setting that is causing the functions to be displayed on the web page?

View Replies !   View Related
Using Include() To Include A Remote Function
This is an issue that's been bothering me for a while. When I use include() or require() to include a page that contains a function, the function will not operate.

However, if I take that function and put it directly into the page, it works.

This seems to hold true for any function that I attempt to insert/define using include(), even when I make sure that all required variables are defined on the page beforehand.

Does anyone know why this would happen or how to work around it?

View Replies !   View Related
Include One Big Include File With All Functions
What is better, to include one big include file with all functions in it or
is it better to include several include files with each function in a
separate include file?

View Replies !   View Related
Include A Scalar In My Include Argument?
I set a pretty global variable ($base) that defines the site root. Very useful with my includes. My only problem is using this URL prefix in include() arguments. Example:

<?php
$base = '/mybaseurl/';
include($base . 'includes/header.php');
?>

I've tried smushing $base in there in many different ways, and I ALWAYS get errors. How can I fit $base into this sort of statement?

View Replies !   View Related
Error Says Can't See Include File, Yet Executes Some Code On Include File
I am using an include_once() command to include a file that sits a
level above the file view.php. when the code is run, I have an error
as follows:

Warning: include_once(../common.php) [function.include-once]: failed
to open stream: No such file or directory in C:Program Files..
view.php on line 2

Warning: include_once() [function.include]: Failed opening '../
common.php' for inclusion (include_path='.;C:Program Filesxamppphp
pear') in C:Program Files...view.php on line 2

The include command is simply: include_once(../common.php) - the '../'
before the 'common.php' to indicate a level above the current file
level. Is this right? I could not find a resource to confirm this.

The strange thing is that while the error seems to imply that the
calling file, view.php cannot 'see' the common.php file, other
functions called from the 'common.php' file executes correctly and on
the same calling file/page (view.php).

Appears to the a double take - quite confusing -

View Replies !   View Related
How Does The "./" Part Of The Include Affect The Ability To Include?
I'm working with a script written by someone else, in which all of their includes are written as: include("./file.php");

I'm currently trying to include these files into other files, and am getting "failed to open required file" errors. I do NOT want to go through and modify all these files to remove the "./" part of the includes (which I understand means the current root directory, yes?).

I've tried setting the include path using set_include_path, but it's still saying it can't find the files. If I'm setting the full directory path with set_include_path, how does the "./" part of the include affect the ability to include? Any help or suggestions?

View Replies !   View Related
From SSI Include To PHP3 Include
Im trying to convert my pages to php and have a problem, how do I change from SSI include (.shtml) to PHP include (.php3) so that I still can have the last line in my script,
(?start=11&end=15 after the .php3)

I have tried this: <?php include ("ssi-top10-15.shtml?start=11&end=15") ?>

and it didnt work, I used to have it like this:

<!--#include virtual="ssi-top15-25.shtml?start=16&end=30" -->

This works, but it leaves out the scipt part: <?php include ("ssi-top10-15.shtml") ?>

View Replies !   View Related
Include Data In An 'include'
i am storing a pathe to a counter file in my db in my current 'footer.php' file i have an include tag that tells where the counter.php file is:

<?php include_once("/home/.sites/123/site19/web/siteStats/counter.php");?>

this hard coded detail works perfecty

now i am storing this counter.php server path in the site db and i need to pull this data into the include_once to be path detail above

this tag shows the raw data on footer
<?php $db->sp("counter_path")?>

how do i get this "counter_path" data into the 'include' tag?

View Replies !   View Related
Can't Include 'http...foo.php', But Can Include 'http...foo.txt'
This seems weird, but when I use the following code,

include 'http://www.foo.com/includes.php'

includedfunction();

I am told that it is a call to an undefined function, but
'includedfunction' is on the server.

the following includes work fine, and the run the called function with
no trouble:

include 'http://www.foo.com/includes.phtml'
include 'http://www.foo.com/includes.txt'

all three include.php,.phtml & .txt are on the server and are exactly
identical. I am running php version 4.1.1.

View Replies !   View Related
To PEAR Or NOT To Pear?
This is just a discussion type post, I'm interesed to know your opinion and experiance with Pear Libraries, I have used some Pear libraries a while back, but not enough to form an opinion wheather it is worth it or not. Some of the question I have is scalability and performance specs, and if I ever have to switch hosts do I need to make sure they have the same version or are they usualy backward compatible... so to Pear or Not to Pear that is the question?

View Replies !   View Related
PEAR DB Help
I am currently running Windows XP Pro with PHP 5.2 and MySQL 5.0 installed. My remote server is a UNIX system with PHP 5.1 installed and MySQL 5.0 installed. Here is the code I'm trying to run:

// Load up the PEAR DB class //
$this->mysql = DB::connect(sprintf("%s://%s:%s@%s/%s", TYPE, USERNAME, PASSWORD, HOST, DATABASE));
echo "hello";

On my computer it works perfectly fine, returns a db_mysql class and no errors. On my server it does nothing. I put echo "hello" there as a test, and when I run the script I don't even see "hello" get printed to the screen, for some reason it's just screwing the entire script up. I checked the USERNAME, PASSWORD, etc. values against the ones I have in CPANEL and they match. Does anyone know what might be causing this problem?

View Replies !   View Related
Help For Pear
where can i find some sample code for PEAR. i have pear manual but it
is not sufficient to get all details of how PEAR work.

View Replies !   View Related
What Is PEAR? What's It Do?
What is PEAR? What's it do? What's it useful for?

View Replies !   View Related
OOP And Pear::DB
I am currently working on a PHP application which I am using as a
personal learning environment for getting a better working
understanding about how to tackle application development in an OOP/MVC
pattern fashion.

I am using PEAR::DB to create database connection objects, and my major
question concerns where these objects should be created.

For example: Let's say I have a login application that that has a
controller-like script that looks something like this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// login.php
<?php
require_once('User.class.php');

$user = new $User;
$user->getAdminRights();
?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

....and a model-like User class that looks something like this: (The
important note is that I may need to load data multiple times from a
database.)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// User.class.php
<?php

class User
{
public $user_name;
public $user_id;
public $admin_rights = array();
protected $db_connection;

function __construct()
{
if (!this->db_connection){
require_once();
$this->db_connection = DB::connect(DB_DSN);
}

$sql = "SELECT USERNAME, USER_ID FROM SOME_TABLE...";
$result = $this->dbh->getAll($sql, array($this->request_id);
$this->user_name = $result['USERNAME'];
$this->user_id = $result['USER_ID'];
}

function getAdminRights()
{
$sql = "SELECT * FROM SOME_TABLE WHERE ADMIN_ID = ?";
$this->admin_rights = $this->dbh->getAll($sql,
array($this->user_id);
}

}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View Replies !   View Related
Pear
kann somebody tell me what i do wrong?

i write this little script:
<?php
include_once "DB.php";
// Example:

echo "Hi";
?>

then, i have the first page von "go-pear"

View Replies !   View Related
PEAR: Is It Really Necessary?
I've been using PHP for a while now but I haven't actually used PEAR. I
have just read half a chapter in a book, it sounds alright but haven't
actually used it. I was just wondering, is it really necessary to use
PEAR? I usually get things done using PHP/MySQL. I don't know if I'm
really missing out on something by not using PEAR. How highly is it
recommended? On most job ads, i don't even see them mentioning PEAR.
They mostly just say PHP/MySQL.. Why is that? Don't people like PEAR
much?

View Replies !   View Related
Php --without-pear
Lately I started to "bravely fight" with Postfix + Squirrelmail
everything works great (PHP also :))
but I want to have possibility to change passwords
(from MySql database) through the webside
SM has a plugin (change_sqlpass) - but it needs Pear DB installed

[root@kompik ~]# rpm -q php-pear
php-pear-1.4.9-1.2
[root@kompik ~]# rpm -q php-pear-DB
php-pear-DB-1.7.6-6.fc5

and as You see I installed it ...
but .....
PHP has no PEAR handling installed
i checked through phpinfo()
and there are Configure Commands and unfortunatelly
there is also '--without-pear'
I installed everything without to many combination
using rpm-s so now i don't really know howto
recompile php without this option ...
i prefer not to uninstall php and compile it
by myself because i would have to uninstall lots
of other stuff ..
Does anyone know any solution for my problem ?

View Replies !   View Related
To Pear DB Or Not To Pear DB?
i'm developing a small web app for a non-profit i'm affiliated with and i'm not sure if i want to use the pear DB abstraction layer or not. i've got a simple page currently developed w/o it, so all my database calls are using MySQL specific functions.
i know that using the pear DB is good if, say, we end up changing databases down the road, but i highly doubt we will.

i mean, MySQL isn't going anywhere, right? anyhow, i just simply don't like pear DB. maybe the fact that it took me a friggin hour to install it has something to do w/ that. also, i'm re-writing the simplest of code using DB functions and i'm having a hell of a time, probably b/c i have nothing but a cheesy pear manual to go by.

View Replies !   View Related
A DB.php PEAR
I am preparing a few PHP scripts conversion to registerglobals=Off And presently testing a new login script that requires PEAR I tested it on my local RH and it works fine in both configurations (with registerglobals On or Off) But on a production server that I do not manage it does not work.

And does not display anything (Blank screen)In order to narrow down the problems I used
<? Error_reporting (E_ALL) ;?> Which shows that my “require” for DB.PHP class does not find it. How can I find if PEAR is made available? And if it is. Is the directory that contains the PEAR files included in my include_path in my php.ini. And if so do I have to provide a path?

View Replies !   View Related
PEAR: Yes Or No
Some PEAR packages seam really cool but I worry about my code starting to be too *dependant* on PEAR if I start using it. You know, the way it handles errors, etc. What are your thoughts? Recommendations?

View Replies !   View Related
Using PEAR
im not getting into using pear but i have a problem, im not sure how it works exactly i have read the website but i contacted my shared server host they say:

Please note that the path to pear package on the server is:

/usr/local/lib/php/

but not sure how to incorporate that in scripts do i need to include a certain file?

View Replies !   View Related
PHP 5 And PEAR
I've been using PHP for a while now - and have recently been trying to set up PHP, MySQL and Apache on Windows (for a client). It seems like all the PEAR stuff under PHP 5 doesn't work out of the box. It took me a while to track down the go-pear.bat file in the root - what with all the other garbage in there. Shouldn't this file get at least a mention in:

install.txt and /PEAR/go-pear.php

The installation instructions in /PEAR/go-pear.php for Windows seem rather out of date - and sent me off in totally the wrong direction :-

(
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

View Replies !   View Related
All Pear
I'm using a prepare and execute sql statement. I'm curious if there is a getAll() function that can be used with the execute. Not sure if this would be advantageous if it existed, but I was thinking to try it if I could.

View Replies !   View Related
What Is PEAR?
What is the use of PEAR? How can I get it working with localhost IIS

I am using PHP Version 4.3.2
Server API CGI/FastCGI
I've a PEAR directory in c:/php4/includes/pear
whenever I enable it in php.ini, I get errors in my php applications e.g.,

Fatal error: main(): Failed opening required 'mainfile.php' (include_path='C:php4includespear') in C:Inetpubwwwroot
ukehtmlincludescounter.php on line 25

other examples of error:

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.;../phpwebsitelibpear') in C:InetpubwwwrootphpwebsitelibpearHTMLTemplateIT.php on line 22

Warning: main(): Failed opening '/path/to/xoops/directory/include/common.php' for inclusion (include_path='.;c:php4pear') in C:Inetpubwwwrootxoopshtmlmainfile.php on line 60

View Replies !   View Related
PEAR DB
is when no row is found:

$what = $db->getOne("SELECT field FROM table WHERE 1=2");
if($what=="") echo "emptystring";
if($what==false) echo "false";
if($what==NULL) echo "null";
echo $what;
echoes "emptystringfalsenull".
$id = $db->getOne("SELECT id FROM table WHERE condition='fulfilled');
// this one?
if($id=="") do_something();
// or this one?
if($id==false) do_something();
// or that one?
if($id != NULL) do_something();

else do_something_else($id).

View Replies !   View Related
PEAR Questions
Can someone explain to me exactly what PEAR is?

I've been looking around for different html modules/classes and it keeps coming up, but I can't find anything that actually explains what it's all about.

Also, is there a complete list of "PEAR" modules anywhere, organised in one place?

View Replies !   View Related
Pear Madness
I'm trying to install the HTTP_Request package but I get this error:

----------------------------
root@host [~]# pear install
http://pear.php.net/get/HTTP_Request-1.3.0.tgz
downloading HTTP_Request-1.3.0.tgz ...
Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes)
......done: 13,808 bytes
requires package `Net_Socket' >= 1.0.2
-----------------------------

So naturally I went to install Net_Socket 1.0.6:

-----------------------------
root@host [~]# pear install
http://pear.php.net/get/Net_Socket-1.0.6.tgz
downloading Net_Socket-1.0.6.tgz ...
Starting to download Net_Socket-1.0.6.tgz (4,623 bytes)
......done: 4,623 bytes
Net_Socket already installed
------------------------------

What's going on? Pear won't let me upgrade Net_Socket. Has anyone ever
ran into this problem before?

View Replies !   View Related
PEAR Doesn't Seem To Be Working
I installed PHP with PEAR support on my Windows computer. I tried the
snippet of the book "Learning PHP5":

<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
echo "test";
include 'DB.php'
$db = DB::connect('mysql://penguin:top^hat@db.example.com/restaurant');
if (DB::isError($db)) { die("Can't connect: " . $db->getMessage( )); }
?>

But it only prints "test", it should display an error message saying
it's not able to connect to the DB. Do you know why nothing happens?
Also, I think there should be a real "DB.php" file, correct? What
should I put into this file? Or is it only a line "as is", that doesn't
mean there needs a "DB.php" file?

View Replies !   View Related
PEAR/Info.php
I tried to use Example 49-1. Using PEAR_Info

This is not showing PEAR installation information on local/remote server.
What I see local, I've no file Info.php in package PEAR in PEAR directory.
I've installed PEAR, why this file is missing?

My Web host say, they've installed PEAR, and I can use PEAR.

View Replies !   View Related
Help On Pear Modules
First of all, I'm not a very seasoned programmer. It's just a hobby grown
out of control.

For a project I am working on I need to be able to send and receive e-mail.
I wrote some code for this myself, but that is just not quite good enough.
So I did a little research and found the Pear modules. I installed all the
Pear modules that I am supposed to need, but I don't understand the
documentation.

Could someone please explain to me how I am supposed to compose, send,
receive and identify the various parts of an incoming e-mail? I am, of
course, in full control of the mailsever.

View Replies !   View Related
Must I Still Use Addslashes With PEAR DB?
I now use the DB classes from PEAR with mysql. Do I still have to use
addslashes? I ask, because I get some very strange results, I get slashes in front of every " and they get saved in my database.

Now my hoster has turned magic_quotes_gpc on anyway. As a workaround:
On a PHP-environment where magic_quotes_gpc is turned on, can I do
stripslashes on every request-data without danger?

Or what is the recommended way to safely insert request-data into
mysql with PEAR?

View Replies !   View Related
Emails & PHP / PEAR ?
Ive found this nifty script that does what I want - in PEAR.. (to send emails)

However i'm getting an error.. - Can anyone advise a suitable course
of action to correct this :-

View Replies !   View Related
PEAR Server Down?
I am unable to reach PEAR server. Here is the error message:

# pear upgrade-all
XML_RPC_Client: Connection to RPC server pear.php.net:80 failed. Connection timed out

View Replies !   View Related
Pear XML Serializer
I'm trying to run a script that uses the XML Serializer package but I
get this error:

[Mon May 15 13:14:24 2006] [error] PHP Fatal error: Call to undefined
function: sethandlerobj() in /usr/local/lib/php/XML/Unserializer.php
on line 852

I reinstalled the package just to be sure but no luck. I didn't edit
the file so I don't know why this is happening. Anybody know what's up?

View Replies !   View Related
Mysql_num_fields To PEAR
Anyone know how to handle the while and for loops with PEAR in the code
below??

// ----------------------------------------------------------------

$result = mysql_query("SELECT bus_price FROM cf where name='$name'",
$connect);

while ($row = mysql_fetch_row($result)) {
for ($i = 0; $i < mysql_num_fields($result); $i++) {

/*
Hunt down instances of newline breaks and text spaces in blob field of
database and replace with HTML linebreak and HTML spaces...
*/

$replace = str_replace(" ", "&nbsp;", $row[$i]);
$replace = nl2br($replace);

echo
"<font face = "arial, helvetica, sans-serif" size ="2">
<b>Price:</b>
<br>" . $replace . " ";

}
}

// ----------------------------------------------------------------

View Replies !   View Related
Is PEAR DB Worth Using?
Is PEAR DB worth using?
Slower?
Other problems?
Or should a person just wrap db functions in a user-defined class?

View Replies !   View Related
Use The Pear Db Feature In Php
I am TRYING to use the Pear db feature in php to build a signon script. I am on PHP 4.2.1, APACHE 1.3.26 AND MYSQL On Win ME. While executing the db connect function( "require_once db.php" )it gives an error, "Undefined Class Name 'db' in SCRIPT blah blah. The script looks like this: Code:

View Replies !   View Related
PEAR DB 1.6.0 Has Been Released
[This has be cross-posted. Be careful when following up, please.]

Greetings:

Crack open the beer, PEAR DB 1.6.0 is here! (Hey, I'm a bit giddy
with excitement that my intense work during the past seven weeks
has come to fruition.)

For those unfamiliar with PEAR DB, it's a package of PHP classes
that provide an object oriented API with common methods of accessing
thirteen of PHP's database driver extensions:
dBase, FrontBase, InterBase, Informix, mSQL, MS SQL Server,
MySQL, Oracle, ODBC (tested with DB2 and Access), PostgreSQL,
SQLite and Sybase.

Key links for PEAR DB:

Download: http://pear.php.net/get/DB
Change Log: http://pear.php.net/package-changelog.php?package=DB
Manual: http://pear.php.net/manual/en/package.database.php
Home Page: http://pear.php.net/package/DB

Notable changes since 1.5.0RC2 include:

* New portability features, making it possible to write
applications which can be easily ported between DBMS's.

* Tons of bug fixes, making the package actually work for more
than just MySQL systems.

* Improved error reporting.

* Getting prepare/execute to work the same way for all DBMS's
and allow escaping of placeholder characters.

* Deploying tableInfo() in more drivers and officially moving
it from DB_result to DB_common. See the documentation for
proper usage.

* Making the test suite simpler to use and work on both
windows and *nix platforms.

* Various optimizations, several of which were uncovered
using Zend Studio's Code Analyzer.

* Countless documentation corrections.

* Full PHP 5 compatibility.

* Requiring PHP to be at version 4.2.0 or higher.

* Deprecating quote() and quoteString().

If you're one of the lucky few people using PHP's mysqli extension,
do note that the DB file/class has been renamed from mysql4 to mysqli,
but the online documentation won't reflect this modification until
they're rebuilt on Sunday. Similarly, there are a few other features
and documentation bugs that won't show up there until then either.

View Replies !   View Related
PEAR::Config
I'm writing a little app for my personal use and want to store the
configuration data in an xml file. I found PEAR::Config that lets
me read the config data into my app. But so far, I haven't figured
out how to get modifcations back to the xml file.

Here's what I've got so far. I ran across this basic code in an article
at DevShed.

<?php
require_once 'Config.php'

$conf = new Config;
$root =& $conf->parseConfig('/usr/local/apache/myapp.xml', 'XML');

if (PEAR::isError($root)) {
die('Error while reading configuration: ' . $root->getMessage());
}

$settings = $root->toArray();

printf('User settings<br>');
printf('=============<br>');
printf('dbhost: %s<br>',$settings['root']['connect']['dbhost']);
printf('dbuser: %s<br>',$settings['root']['connect']['dbuser']);
printf('dbpass: %s<br>',$settings['root']['connect']['dbpass']);
printf('dbname: %s<br>',$settings['root']['connect']['dbname']);

$conf->writeConfig('/usr/local/apache/myapp.xml', 'XML');
?>

What I want to able to do is modify the values in the settings array (not
the problem) and the write them back out to the xml file.

I understand that it takes all the data from the root level and assigns it
to an array called $settings. What I'm having trouble with is getting
$settings back to the file.

Has anyone else used PEAR::Config doing this sort of thing?

View Replies !   View Related

Copyright 2005-08 www.BigResource.com, All rights reserved