|
From: <no...@se...> - 2007-02-21 08:41:10
|
Hi Dan et al, the problem is the current directory structure. The source code is in the src/ directory and all source code references are made with a base directory './src' in mind. The problem is now, that if you run OpenDocumentPHP as a library you will have your own program as code base and the OpenDocumentPHP stuff in your classpath. So you have the separate your own source code from the OpenDocumentPHP source code. For instance, you will include the PEAR stuff always with something like 'require_once "Phing/PhingFile.php";' or 'require_once "PHPUnit/PHPUnit_TestSuite.php";'. If you take a look at the published files on sourceforge.net you will find two packages. One is call OpenDocumentPHP-0.5.1-src.zip, which is a more or less a snapshot of the subvision repository at a certain time. But there is also a file named OpenDocumentPHP-0.5.1.zip, which is what we call the 'production code'. It is only the library (and the api documentation done by PhpDocumentor) and that is what people need, if they only what to use our code. If you take a look at that part of the code you will see, that there is a directory OpenDocumentPHP which includes all our production code and that all the line like "require_once 'meta/DublinCoreFragment.php';" are substituted by something like "require_once 'OpenDocumentPHP/meta/DublinCoreFragement.php';". The new directroy structure will end this messy situation, by putting all the code in src/OpenDocumentPHP/ which should go as OpenDocumentPHP/ in the library and all other code (like the samples, tools etc) in the src/samples/, src/tools/ ... directories. So if you develop an example for OpenDocumentPHP you should use the production or new directory structure to include the classes, thinking that OpenDocumentPHP was lnked by the user in there classpath. May be I should write a simple sample first. ;-) So, Dan, your are complete right, when you want to use > require_once('OpenDocumentPHP/OpenDocument.php'); and > require_once('OpenDocumentPHP/meta/DublinCoreFragment.php'); because you added OpenDocumentPHP first, even when there is (currently) no such suffix in the require_once statements in the source code. > I should say, before we get too far into this, that I will take any and all criticism of my coding style or logic. I have programmed for a long time but have little formal training in matters such as version release and team programming. I am always open to suggestions and refinements to better improve my skills and our project and will not take what you say personally. (obviously you mentioned refactoring as a project-wide series of a constant refinements). As you can (not ?) see, I love such things as "Agile Development" or "XP". The problem is, that I spend most of the time in coding then follow the rules of XP or AD, shame on me! But if you use a project not only to finish something, but to learn more and get benefit not you by getting it done but also by see how your own vision changes ... well too much dreaming I think... > To wrap up, my sourceforge username is dlongest (should be easy to remember :-) I hope to have something (useable is the wrong word) demonstrative by the end of the week to be examined, prodded, and inspected as my first project submission. I am using xampp to run Apache and PHP locally for my test client. That would be nice. > Are we running production code with superglobals turned on or off? No superglobals please. Always thing of a hyper secure system, that allows nearly nothing! ;) Yours, Norman PS: Dan, you have now SVN access, too. |