Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert all private variables in EPub.php to protected variables #1

Open
bibstha opened this issue Dec 28, 2011 · 5 comments
Open

Convert all private variables in EPub.php to protected variables #1

bibstha opened this issue Dec 28, 2011 · 5 comments

Comments

@bibstha
Copy link

bibstha commented Dec 28, 2011

I needed to inherit EPub class to my custom classes, where I wanted to override addChapter with my own version. But since most of the variables are private, I think it would be a good idea to convert them to protected?

Right now, I cannot for instance in my inherited class access $this->isFinalized because that only belongs to EPub class.

@Grandt
Copy link
Owner

Grandt commented Dec 28, 2011

You are right,
I assume protected means that only inherited classes can access them?

The reason I did set them private were that some were reporting problems after accessing variables out of order, for instance messing with the zip file, adding files after it were finalized.

I have to assume any inherited classes at least are well behaved :)

Change the variables to protected, and let me know which other changes you make/need, and I'll update the repository, probably tomorrow.

@bibstha
Copy link
Author

bibstha commented Dec 28, 2011

You could also put a setter in EPub.php class
public function setDocRoot($docRoot)
{
$this->docRoot = $docRoot;
}

I need to at times set the docRoot manually. This should be sufficient
for now. Are u working on the newer version of the EPub class?

@Grandt
Copy link
Owner

Grandt commented Dec 28, 2011

I have a new one in the works where there are getters and setters for just about all variables in it. It is far from finished, RL became ... interesting times before I managed to get the time for it.

One of the main differences are that I'll be adding classes for the ePub XML structures for ease of maintenance, and multi level indexes. If you want me to, I can see if I can give you access to that, it's in a private repository here on this site.

@bibstha
Copy link
Author

bibstha commented Dec 29, 2011

Hi IMO, it would be nice to separate all the unused classes into separate branches?
Currently the main tree only uses EPub class, the other smaller classes seem to be there without any proper usage instruction.
And yes, Would love to peek into the newer classes.

@Grandt
Copy link
Owner

Grandt commented Dec 29, 2011

The current "helpers" are just that, and are used by the EPub class. The exception is the splitter, which can be used separately as well, though no documentation is available for that. Yet.

The splitter is a bit of an interesting class, one which may need a bit of clean up though.
It's function is to cut an xhtml file into sections, by size or for instance chapter headings, while retaining the formatting after the cuts. If a cut point is for instance deeply nested inside a set of tags, those levels are recreated at the beginning of the next file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants