PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old June 5th, 2002, 08:09 PM
recumbent615 recumbent615 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 recumbent615 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to recumbent615
Include_path - Can this be changed Dynamicly

I have looked in a number of places and still can not find a way, I'm hoping to have someone smarter than I shed some light on this problem.

Reply With Quote
  #2  
Old June 5th, 2002, 08:14 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to notepad
RE: Include_path - Can this be changed Dynamicly

dynamically.. like this?
php Code:
Original - php Code
  1.  
  2. if($this == TRUE)
  3. {
  4.     include(my page)
  5. }
  6. elseif($this == FALSE)
  7. {
  8.     include(my other page)
  9. }

u could make that dynamic umm.. maybe. can you elaborate?

Reply With Quote
  #3  
Old June 5th, 2002, 08:57 PM
recumbent615 recumbent615 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 recumbent615 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to recumbent615
RE: Include_path - Can this be changed Dynamicly

No actualy I want to change the value stored in include_path so I can simplify the porting effort for my web sites.

Reply With Quote
  #4  
Old June 5th, 2002, 08:58 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to notepad
RE: Include_path - Can this be changed Dynamicly

so..

include("$someValue");
..code to change $someValue

am i way off? i can just shut up.

Reply With Quote
  #5  
Old June 5th, 2002, 09:01 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
RE: Include_path - Can this be changed Dynamicly

Yeah, you should be able to change that with ini_set...try this at top of your scripts:

ini_set('include_path','whatever you want to change it to');


Reply With Quote
  #6  
Old June 5th, 2002, 09:05 PM
recumbent615 recumbent615 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 recumbent615 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to recumbent615
RE: Include_path - Can this be changed Dynamicly

Yes, I'm afraid that I'm not communicating this very well. In the PHP.INI file there is a value called include_path and it is set to some value that in most cases includes '.' so the scripts can file local include files. In my case I would like to dynamicly change the value of that. so I can avoid errors like the one below. I could change every one of the include statements to be a full path but... I'd rather not go way if I can change this script to script.

Kevin

Warning: Failed opening 'foo.php' for inclusion (include_path='.:/php/includes:/usr/share/php:/usr/share/pear') in ....

Reply With Quote
  #7  
Old June 5th, 2002, 10:08 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
RE: Include_path - Can this be changed Dynamicly

The ini_set lets you change it on a script per script basis.....

Reply With Quote
  #8  
Old June 6th, 2002, 01:02 AM
Smiley Smiley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Australia
Posts: 30 Smiley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Include_path - Can this be changed Dynamicly

The alternative is to provide the full or relative path to the file. Then php wont even use the include_path setting.

The other thing you need to be aware of when using the ini_set fix is to make sure that it is called once somewhere before you include the file. This goes for every script you are running.

Reply With Quote
  #9  
Old June 6th, 2002, 02:58 AM
recumbent615 recumbent615 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 recumbent615 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to recumbent615
RE: Include_path - Can this be changed Dynamicly

Thankyou ... ini_set is exactly what I need. That will make my task much easier!!!

Kevin B

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Include_path - Can this be changed Dynamicly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek