Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional PHP6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional PHP6
This is the forum to discuss the Wrox book Professional PHP6 by Edward Lecky-Thompson, Steven Nowicki; ISBN: 9780470395097
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional PHP6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 2nd, 2011, 09:49 AM
Authorized User
Points: 152, Level: 3
Points: 152, Level: 3 Points: 152, Level: 3 Points: 152, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2010
Location: Bra - Italy
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default Ch. 09 - class.Config.php

Hello,

i don't found the file "class.Config.php" in the wrox zip code (ch09).. i try make one by my self but i'm not sure work well.. return me some errors... anyone can help me please?

i try this code:
class.Config.php
Code:
<?php

class Config {

const LOGGER_LEVEL = 75;
const DEBUG_LEVEL = 100;
const LOGGER_FILE = 'C:/root/chp09/prova.log';

	public static function getConfig() {
		return SELF::LOGGER_LEVEL;
		return SELF::LOGGER_FILE;
	}

	public static function addConfig($constLog, $value) {
		if($constLog == 'LOGGER_LEVEL') {
			SELF::LOGGER_LEVEL = $value
		} elseif ($constLog == 'DEBUG_LEVEL') {
			SELF::DEBUG_LEVEL = $value
		} else {
			SELF::LOGGER_FILE = $value;
			echo 'save value final path.';
		}
}
?>
but retun to me this error.. and after fix this, return others..
Code:
Parse error: syntax error, unexpected '=' in C:\Inetpub\wwwroot\php\M1\ch09\class.Config.php on line 16
Reply With Quote
  #2 (permalink)  
Old April 1st, 2011, 12:16 AM
Registered User
 
Join Date: Mar 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Post change some hope can help you

<?php
class Config
{
const LOGGER_LEVEL = 75;
const DEBUG_LEVEL = 100;
const LOGGER_FILE = 'C:/root/chp09/prova.log';

public static function getConfig() {
return SELF::LOGGER_LEVEL;
return SELF::LOGGER_FILE;
}

public static function addConfig($constLog, $value) {
if($constLog == 'LOGGER_LEVEL') {
//change this add ;
$this->LOGGER_LEVEL = $value;
}
else if ($constLog == 'DEBUG_LEVEL') {
//change this add ;
$this->DEBUG_LEVEL = $value;
}
else {
//change this add ;
$this->LOGGER_FILE = $value;
echo 'save value final path.';
}
}
} // add this } to end
?>
Reply With Quote
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting Corobot-type (Ch. 6 example) Config.xml Changed GeorgeMo BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 0 February 10th, 2011 03:55 PM
Can't Get Ch 3 Example to Create ServiceB.Config.xml GeorgeMo BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 4 December 13th, 2010 01:12 AM
Ch 9-Sending Email-Encrytping web.config btcomp BOOK: Beginning ASP.NET 4 : in C# and VB 3 August 28th, 2010 04:37 PM
Ch 09 router app error pwhited39 BOOK: Beginning Ruby on Rails 0 January 24th, 2009 07:32 PM
CH 09 AjaxMail SQL coders4hire BOOK: Professional Ajax ISBN: 978-0-471-77778-6 2 June 22nd, 2006 08:03 PM



All times are GMT -4. The time now is 02:09 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.