Categories > TinyButStrong general >

Allowed memory size exhausted when trying to extend clsTinyButStrong class

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Michaelsen
Date: 2011-07-25
Time: 02:32

Allowed memory size exhausted when trying to extend clsTinyButStrong class


Mr. Skrol29,

Sir, I was messing around with clsTbsPlugInHtml class, and I notice if I was to extend it such as:

clsTbsPlugInHtml extends clsTinyButStrong

It throws an error such as "Allowed memory size of (bigint) bytes exhausted", without any processing, just loading the classes.

The idea was that I could have just one library to be loaded in CodeIgniter, such as $this->load->library('clsTinyButStrong');, if I remove the extends method, it works fine.

It can't be file size, I was using HTMLPurifier some days ago and it has 16k lines, the main class only.

If you have any information on this I would appreciate.

Regards,

- Michaelsen
By: Skrol29
Date: 2011-07-25
Time: 15:56

Re: Allowed memory size exhausted when trying to extend clsTinyButStrong class

TBS can load one or several plug-ins at a time.
Thus a TBS plug-in cannot be an extension of the TBS class.

When you try to do it, you probably have an infinite referencing loop between TBS and the plug-in.

If you need only one load in CodeIgniter, then you may have only one PHP script that include all TBS+plus-ins libraries.
By: Michaelsen
Date: 2011-07-25
Time: 20:43

Re: Allowed memory size exhausted when trying to extend clsTinyButStrong class

Ok, thank you for the reply and the information.

One annoying thing with codeigniter is that if I do $this->load->library('clsTinyButStrong'); it literally only loads the class mentioned, even if you have all the other tbs classes and plugins inside.

So at first I did $this->load->library('clsTinyButStrong'); $this->load->library('clsTbsLocator'); and the other one, in 3 different files, later on I added extends to the other 2 classes with clsTinyButStrong, so I could do only $this->load->library('clsTinyButStrong');, after that I did some basic helpers, tbs_loader, tbs_block_array, tbs_block_query, tbs_render, etc. Of course I can also include the file and use as usual, but thats too easy.

I noticed in codeigniter 2 I can eliminate the view part and deal directly from the controller to the tbs side.