RE: [PHP] Rusu Ionut, PHP Question

2009-03-26 Thread kyle.smith
Have you bolded sections of the email or are there really asterisk
characters in those strings?

Assuming it's bolding being converted to text, why shouldn't this work?
It's definitely not the best approach, for example if you instanciate
the "index" class twice, you'll re-include the code *again*.  A better
approach is require_once(), or placing all the includes at the top of
your scripts.

Hope this helps,
Kyle 

-Original Message-
From: Ionut Rusu [mailto:johnr...@gmail.com] 
Sent: Thursday, March 26, 2009 10:35 AM
To: php-general@lists.php.net
Subject: [PHP] Rusu Ionut, PHP Question

Hello my name is Rusu Ionut,  i'm from Romania and i was wondering if
you have the time to to explain to mea little situation that i
encountered.
So i have a class:  *index *and inside this class i have declared a
public array containing some classes, inside the constructor of the
class i extract the array variables and call the include function to
"include" the array variable which is the reference of an php class
file.
My Question to you is : how is this possible
The php doesnt outputs any errors, and i was wondering if this style of
codying is making the server to work slower



here is my code.



class index
{
public $fisiere=array
  (
  "*main_classes/db/functii.class.php*",
  "*main_classes/db/mysql.class.php*",
 
"*main_classes/sp/setari_pagina.class.php*",
  "*main_classes/admin/admin.class.php*",
  "*main_classes/captcha/captcha.class.php*"
  );

/*-*/

public function __construct()
{
$eroare="";
foreach($this->fisiere as $key=>$value)
{
if(!file_exists(url_dinamice.$value))
{
*echo "**error!";*
}
else
{
  *  include url_dinamice.$value;*
}
}
   }
}
$indexObj=new index();

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Rusu Ionut, PHP Question

2009-03-26 Thread Ionut Rusu
Hello my name is Rusu Ionut,  i'm from Romania and i was wondering if you
have the time to to explain to mea little situation that i encountered.
So i have a class:  *index *and inside this class i have declared a public
array containing some classes, inside the constructor of the class i extract
the array variables and call the include function to "include" the array
variable which is the reference of an php class file.
My Question to you is : how is this possible
The php doesnt outputs any errors, and i was wondering if this style of
codying is making the server to work slower



here is my code.



class index
{
public $fisiere=array
  (
  "*main_classes/db/functii.class.php*",
  "*main_classes/db/mysql.class.php*",
  "*main_classes/sp/setari_pagina.class.php*",
  "*main_classes/admin/admin.class.php*",
  "*main_classes/captcha/captcha.class.php*"
  );

/*-*/

public function __construct()
{
$eroare="";
foreach($this->fisiere as $key=>$value)
{
if(!file_exists(url_dinamice.$value))
{
*echo "**error!";*
}
else
{
  *  include url_dinamice.$value;*
}
}
   }
}
$indexObj=new index();