diff --git a/tests/document/add.php b/tests/document/add.php new file mode 100644 index 0000000..6a725d1 --- /dev/null +++ b/tests/document/add.php @@ -0,0 +1,51 @@ + new KTFSFileLike($sFilename), +)); + +if (PEAR::isError($oDocument)) { + print "FAILURE\n"; + var_dump($oDocument); + exit(0); +} +*/ + +if (!file_exists($sFilename)) { + copy($sLocalname, $sFilename); +} + +$oDocument =& KTDocumentUtil::add($oFolder, "newtest2.txt", $oUser, array()); +if (PEAR::isError($oDocument)) { + print "FAILURE\n"; + var_dump($oDocument); +} + +/* + +$res = KTDocumentUtil::storeContents($oDocument, new KTFSFileLike($sFilename)); +var_dump($res); + +if (file_exists($sFilename)) { + unlink($sFilename); +} + +$oDocument->setStatusID(LIVE); +$oDocument->update(); +*/ + +?> diff --git a/tests/document/addInOneGo.php b/tests/document/addInOneGo.php new file mode 100644 index 0000000..42b14ee --- /dev/null +++ b/tests/document/addInOneGo.php @@ -0,0 +1,31 @@ + new KTFSFileLike($sFilename), + 'metadata' => array(), +)); + +if (PEAR::isError($oDocument)) { + print "FAILURE\n"; + var_dump($oDocument); + exit(0); +} +DBUtil::commit(); + +print "SUCCESS\n"; + +?> diff --git a/tests/document/dataset1/critique-of-pure-reason.txt b/tests/document/dataset1/critique-of-pure-reason.txt new file mode 100644 index 0000000..08a9463 --- /dev/null +++ b/tests/document/dataset1/critique-of-pure-reason.txt @@ -0,0 +1,220 @@ +THE CRITIQUE OF PURE REASON + +by Immanuel Kant + +translated by J. M. D. Meiklejohn + + + +PREFACE TO THE FIRST EDITION, 1781 + +Human reason, in one sphere of its cognition, is called upon to +consider questions, which it cannot decline, as they are presented +by its own nature, but which it cannot answer, as they transcend every +faculty of the mind. + +It falls into this difficulty without any fault of its own. It +begins with principles, which cannot be dispensed with in the field +of experience, and the truth and sufficiency of which are, at the same +time, insured by experience. With these principles it rises, in +obedience to the laws of its own nature, to ever higher and more +remote conditions. But it quickly discovers that, in this way, its +labours must remain ever incomplete, because new questions never cease +to present themselves; and thus it finds itself compelled to have +recourse to principles which transcend the region of experience, while +they are regarded by common sense without distrust. It thus falls into +confusion and contradictions, from which it conjectures the presence +of latent errors, which, however, it is unable to discover, because +the principles it employs, transcending the limits of experience, +cannot be tested by that criterion. The arena of these endless +contests is called Metaphysic. + +Time was, when she was the queen of all the sciences; and, if we +take the will for the deed, she certainly deserves, so far as +regards the high importance of her object-matter, this title of +honour. Now, it is the fashion of the time to heap contempt and +scorn upon her; and the matron mourns, forlorn and forsaken, like +Hecuba: + + Modo maxima rerum, + Tot generis, natisque potens... + Nunc trahor exul, inops. + -- Ovid, Metamorphoses. xiii + +At first, her government, under the administration of the +dogmatists, was an absolute despotism. But, as the legislative +continued to show traces of the ancient barbaric rule, her empire +gradually broke up, and intestine wars introduced the reign of +anarchy; while the sceptics, like nomadic tribes, who hate a permanent +habitation and settled mode of living, attacked from time to time +those who had organized themselves into civil communities. But their +number was, very happily, small; and thus they could not entirely +put a stop to the exertions of those who persisted in raising new +edifices, although on no settled or uniform plan. In recent times +the hope dawned upon us of seeing those disputes settled, and the +legitimacy of her claims established by a kind of physiology of the +human understanding--that of the celebrated Locke. But it was found +that--although it was affirmed that this so-called queen could not +refer her descent to any higher source than that of common experience, +a circumstance which necessarily brought suspicion on her claims--as +this genealogy was incorrect, she persisted in the advancement of +her claims to sovereignty. Thus metaphysics necessarily fell back into +the antiquated and rotten constitution of dogmatism, and again +became obnoxious to the contempt from which efforts had been made to +save it. At present, as all methods, according to the general +persuasion, have been tried in vain, there reigns nought but weariness +and complete indifferentism--the mother of chaos and night in the +scientific world, but at the same time the source of, or at least +the prelude to, the re-creation and reinstallation of a science, +when it has fallen into confusion, obscurity, and disuse from ill +directed effort. + +For it is in reality vain to profess indifference in regard to +such inquiries, the object of which cannot be indifferent to humanity. +Besides, these pretended indifferentists, however much they may try +to disguise themselves by the assumption of a popular style and by +changes on the language of the schools, unavoidably fall into +metaphysical declarations and propositions, which they profess to +regard with so much contempt. At the same time, this indifference, +which has arisen in the world of science, and which relates to that +kind of knowledge which we should wish to see destroyed the last, is +a phenomenon that well deserves our attention and reflection. It is +plainly not the effect of the levity, but of the matured judgement* +of the age, which refuses to be any longer entertained with illusory +knowledge, It is, in fact, a call to reason, again to undertake the +most laborious of all tasks--that of self-examination, and to +establish a tribunal, which may secure it in its well-grounded claims, +while it pronounces against all baseless assumptions and +pretensions, not in an arbitrary manner, but according to its own +eternal and unchangeable laws. This tribunal is nothing less than +the critical investigation of pure reason. + +[*Footnote: We very often hear complaints of the shallowness of the +present age, and of the decay of profound science. But I do not think +that those which rest upon a secure foundation, such as mathematics, +physical science, etc., in the least deserve this reproach, but that +they rather maintain their ancient fame, and in the latter case, +indeed, far surpass it. The same would be the case with the other +kinds of cognition, if their principles were but firmly established. +In the absence of this security, indifference, doubt, and finally, +severe criticism are rather signs of a profound habit of thought. +Our age is the age of criticism, to which everything must be +subjected. The sacredness of religion, and the authority of +legislation, are by many regarded as grounds of exemption from the +examination of this tribunal. But, if they on they are exempted, +they become the subjects of just suspicion, and cannot lay claim to +sincere respect, which reason accords only to that which has stood +the test of a free and public examination.] + +I do not mean by this a criticism of books and systems, but a +critical inquiry into the faculty of reason, with reference to the +cognitions to which it strives to attain without the aid of +experience; in other words, the solution of the question regarding +the possibility or impossibility of metaphysics, and the determination +of the origin, as well as of the extent and limits of this science. +All this must be done on the basis of principles. + +This path--the only one now remaining--has been entered upon by +me; and I flatter myself that I have, in this way, discovered the +cause of--and consequently the mode of removing--all the errors +which have hitherto set reason at variance with itself, in the +sphere of non-empirical thought. I have not returned an evasive answer +to the questions of reason, by alleging the inability and limitation +of the faculties of the mind; I have, on the contrary, examined them +completely in the light of principles, and, after having discovered +the cause of the doubts and contradictions into which reason fell, +have solved them to its perfect satisfaction. It is true, these +questions have not been solved as dogmatism, in its vain fancies and +desires, had expected; for it can only be satisfied by the exercise +of magical arts, and of these I have no knowledge. But neither do these +come within the compass of our mental powers; and it was the duty of +philosophy to destroy the illusions which had their origin in +misconceptions, whatever darling hopes and valued expectations may +be ruined by its explanations. My chief aim in this work has been +thoroughness; and I make bold to say that there is not a single +metaphysical problem that does not find its solution, or at least +the key to its solution, here. Pure reason is a perfect unity; and +therefore, if the principle presented by it prove to be insufficient +for the solution of even a single one of those questions to which +the very nature of reason gives birth, we must reject it, as we could +not be perfectly certain of its sufficiency in the case of the others. + +While I say this, I think I see upon the countenance of the reader +signs of dissatisfaction mingled with contempt, when he hears +declarations which sound so boastful and extravagant; and yet they +are beyond comparison more moderate than those advanced by the commonest +author of the commonest philosophical programme, in which the +dogmatist professes to demonstrate the simple nature of the soul, or +the necessity of a primal being. Such a dogmatist promises to extend +human knowledge beyond the limits of possible experience; while I +humbly confess that this is completely beyond my power. Instead of +any such attempt, I confine myself to the examination of reason alone +and its pure thought; and I do not need to seek far for the +sum-total of its cognition, because it has its seat in my own mind. +Besides, common logic presents me with a complete and systematic +catalogue of all the simple operations of reason; and it is my task +to answer the question how far reason can go, without the material +presented and the aid furnished by experience. + +So much for the completeness and thoroughness necessary in the +execution of the present task. The aims set before us are not +arbitrarily proposed, but are imposed upon us by the nature of +cognition itself. + +The above remarks relate to the matter of our critical inquiry. As +regards the form, there are two indispensable conditions, which any +one who undertakes so difficult a task as that of a critique of pure +reason, is bound to fulfil. These conditions are certitude and +clearness. + +As regards certitude, I have fully convinced myself that, in this +sphere of thought, opinion is perfectly inadmissible, and that +everything which bears the least semblance of an hypothesis must be +excluded, as of no value in such discussions. For it is a necessary +condition of every cognition that is to be established upon a priori +grounds that it shall be held to be absolutely necessary; much more +is this the case with an attempt to determine all pure a priori +cognition, and to furnish the standard--and consequently an example-- +of all apodeictic (philosophical) certitude. Whether I have +succeeded in what I professed to do, it is for the reader to +determine; it is the author's business merely to adduce grounds and +reasons, without determining what influence these ought to have on +the mind of his judges. But, lest anything he may have said may become +the innocent cause of doubt in their minds, or tend to weaken the effect +which his arguments might otherwise produce--he may be allowed to +point out those passages which may occasion mistrust or difficulty, +although these do not concern the main purpose of the present work. +He does this solely with the view of removing from the mind of the +reader any doubts which might affect his judgement of the work as a +whole, and in regard to its ultimate aim. + +I know no investigations more necessary for a full insight into +the nature of the faculty which we call understanding, and at the same +time for the determination of the rules and limits of its use, than +those undertaken in the second chapter of the "Transcendental +Analytic," under the title of "Deduction of the Pure Conceptions of +the Understanding"; and they have also cost me by far the greatest +labour--labour which, I hope, will not remain uncompensated. The +view there taken, which goes somewhat deeply into the subject, has +two sides, The one relates to the objects of the pure understanding, +and is intended to demonstrate and to render comprehensible the +objective validity of its a priori conceptions; and it forms for +this reason an essential part of the Critique. The other considers +the pure understanding itself, its possibility and its powers of +cognition--that is, from a subjective point of view; and, although +this exposition is of great importance, it does not belong essentially +to the main purpose of the work, because the grand question is what +and how much can reason and understanding, apart from experience, +cognize, and not, how is the faculty of thought itself possible? As +the latter is an, inquiry into the cause of a given effect, and has +thus in it some semblance of an hypothesis (although, as I shall +show on another occasion, this is really not the fact), it would +seem that, in the present instance, I had allowed myself to enounce +a mere opinion, and that the reader must therefore be at liberty to +hold a different opinion. But I beg to remind him that, if my +subjective deduction does not produce in his mind the conviction of +its certitude at which I aimed, the objective deduction, with which +alone the present work is properly concerned, is in every respect +satisfactory. + + diff --git a/tests/document/saveMetadata.php b/tests/document/saveMetadata.php new file mode 100644 index 0000000..bc94850 --- /dev/null +++ b/tests/document/saveMetadata.php @@ -0,0 +1,26 @@ +update(); + +if (file_exists($sFilename)) { + unlink($sFilename); +} + +?> diff --git a/tests/document/storeContents.php b/tests/document/storeContents.php new file mode 100644 index 0000000..f2ff884 --- /dev/null +++ b/tests/document/storeContents.php @@ -0,0 +1,30 @@ +update(); + +if (file_exists($sFilename)) { + unlink($sFilename); +} + +?>