Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional PHP6
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2011, 10:49 AM
Authorized User
 
Join Date: Jun 2010
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
 
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
?>





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 04: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 02: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 08:32 PM
CH 09 AjaxMail SQL coders4hire BOOK: Professional Ajax ISBN: 978-0-471-77778-6 2 June 22nd, 2006 08:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.