Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Daniel Kolbo
Martin Scotta wrote: Where is $vars? there is no $vars in your code... You can extract all the global space in the CScope method, it's quite simple, but less performant. class CScope { public $vars = 'class scope\n'; function cinclude($filename) {

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Daniel Kolbo
Hello, I've cleaned up my question a bit. I want the included file which is called within a method of a class to have the same scope as the instantiation of the class's object. That is, i want a class to include a file in the calling object's scope. How would one do this? 'test.php' ?php

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Shawn McKenzie
Daniel Kolbo wrote: Hello, I've cleaned up my question a bit. I want the included file which is called within a method of a class to have the same scope as the instantiation of the class's object. That is, i want a class to include a file in the calling object's scope. How would one do

Re: [PHP] include file in a class with global/parent scope?

2009-06-16 Thread Shawn McKenzie
Shawn McKenzie wrote: Daniel Kolbo wrote: Hello, I've cleaned up my question a bit. I want the included file which is called within a method of a class to have the same scope as the instantiation of the class's object. That is, i want a class to include a file in the calling object's

[PHP] include file in a class with global/parent scope?

2009-06-14 Thread Daniel Kolbo
Hello, I understand the why $vars is not in the global scope, but i was wondering if there was a way from within the class file to include a file in the parent's scope? i tried ::include('vars.php'), parent::include('vars.php'), but this breaks syntax... Please consider the following three