├── .gitignore
├── .idea
├── .gitignore
├── files_external_ipfs.iml
├── misc.xml
├── modules.xml
├── php.xml
├── phpunit.xml
└── vcs.xml
├── .travis.yml
├── CHANGELOG.md
├── COPYING
├── Makefile
├── README.md
├── appinfo
├── app.php
└── info.xml
├── composer.json
├── composer.lock
├── docs
├── Publishing.md
├── README.md
├── Storage.md
├── Testing.md
└── img
│ ├── Screen01.png
│ └── Screen02.png
├── img
└── app.svg
├── lib
├── AppInfo
│ └── Application.php
├── Backend
│ └── IPFS.php
└── Storage
│ ├── Adapter.php
│ ├── IPFS.php
│ └── MultipartData.php
├── phpunit.integration.xml
├── phpunit.xml
└── tests
├── Integration
└── AppTest.php
├── Unit
└── Controller
│ └── PageControllerTest.php
└── bootstrap.php
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor
2 | build
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/.idea/files_external_ipfs.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/php.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/.idea/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | dist: trusty
3 | language: php
4 | php:
5 | - 5.6
6 | - 7
7 | - 7.1
8 | env:
9 | global:
10 | - CORE_BRANCH=stable15
11 | matrix:
12 | - DB=pgsql
13 |
14 | matrix:
15 | allow_failures:
16 | - env: DB=pgsql CORE_BRANCH=master
17 | include:
18 | - php: 5.6
19 | env: DB=sqlite
20 | - php: 5.6
21 | env: DB=mysql
22 | - php: 5.6
23 | env: DB=pgsql CORE_BRANCH=master
24 | fast_finish: true
25 |
26 |
27 | before_install:
28 | # enable a display for running JavaScript tests
29 | - export DISPLAY=:99.0
30 | - sh -e /etc/init.d/xvfb start
31 | - nvm install 8
32 | - npm install -g npm@latest
33 | - make
34 | - make appstore
35 | # install core
36 | - cd ../
37 | - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH nextcloud
38 | - mv "$TRAVIS_BUILD_DIR" nextcloud/apps/filesipfs
39 |
40 | before_script:
41 | - if [[ "$DB" == 'pgsql' ]]; then createuser -U travis -s oc_autotest; fi
42 | - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
43 | - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
44 | - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
45 | - cd nextcloud
46 | - mkdir data
47 | - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
48 | - ./occ app:enable filesipfs
49 | - php -S localhost:8080 &
50 | - cd apps/filesipfs
51 |
52 | script:
53 | - make test
54 |
55 | after_failure:
56 | - cat ../../data/nextcloud.log
57 |
58 | addons:
59 | firefox: 'latest'
60 | mariadb: '10.1'
61 |
62 | services:
63 | - postgresql
64 | - mariadb
65 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## V0.2.0
4 | - metadata support
5 |
6 | ## V0.1.0
7 | - read functionality
8 | - partial write functionality
9 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published by
637 | the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # This file is licensed under the Affero General Public License version 3 or
2 | # later. See the COPYING file.
3 | # @author Bernhard Posselt
4 | # @copyright Bernhard Posselt 2016
5 |
6 | # Generic Makefile for building and packaging a Nextcloud app which uses npm and
7 | # Composer.
8 | #
9 | # Dependencies:
10 | # * make
11 | # * which
12 | # * curl: used if phpunit and composer are not installed to fetch them from the web
13 | # * tar: for building the archive
14 | # * npm: for building and testing everything JS
15 | #
16 | # If no composer.json is in the app root directory, the Composer step
17 | # will be skipped. The same goes for the package.json which can be located in
18 | # the app root or the js/ directory.
19 | #
20 | # The npm command by launches the npm build script:
21 | #
22 | # npm run build
23 | #
24 | # The npm test command launches the npm test script:
25 | #
26 | # npm run test
27 | #
28 | # The idea behind this is to be completely testing and build tool agnostic. All
29 | # build tools and additional package managers should be installed locally in
30 | # your project, since this won't pollute people's global namespace.
31 | #
32 | # The following npm scripts in your package.json install and update the bower
33 | # and npm dependencies and use gulp as build system (notice how everything is
34 | # run from the node_modules folder):
35 | #
36 | # "scripts": {
37 | # "test": "node node_modules/gulp-cli/bin/gulp.js karma",
38 | # "prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
39 | # "build": "node node_modules/gulp-cli/bin/gulp.js"
40 | # },
41 |
42 | app_name=$(notdir $(CURDIR))
43 | build_tools_directory=$(CURDIR)/build/tools
44 | source_build_directory=$(CURDIR)/build/artifacts/source
45 | source_package_name=$(source_build_directory)/$(app_name)
46 | appstore_build_directory=$(CURDIR)/build/artifacts/appstore
47 | appstore_package_name=$(appstore_build_directory)/$(app_name)
48 | npm=$(shell which npm 2> /dev/null)
49 | composer=$(shell which composer 2> /dev/null)
50 |
51 | all: build
52 |
53 | # Fetches the PHP and JS dependencies and compiles the JS. If no composer.json
54 | # is present, the composer step is skipped, if no package.json or js/package.json
55 | # is present, the npm step is skipped
56 | .PHONY: build
57 | build:
58 | ifneq (,$(wildcard $(CURDIR)/composer.json))
59 | make composer
60 | endif
61 | ifneq (,$(wildcard $(CURDIR)/package.json))
62 | make npm
63 | endif
64 | ifneq (,$(wildcard $(CURDIR)/js/package.json))
65 | make npm
66 | endif
67 |
68 | # Installs and updates the composer dependencies. If composer is not installed
69 | # a copy is fetched from the web
70 | .PHONY: composer
71 | composer:
72 | ifeq (, $(composer))
73 | @echo "No composer command available, downloading a copy from the web"
74 | mkdir -p $(build_tools_directory)
75 | curl -sS https://getcomposer.org/installer | php
76 | mv composer.phar $(build_tools_directory)
77 | php $(build_tools_directory)/composer.phar install --prefer-dist
78 | else
79 | composer install --prefer-dist
80 | endif
81 |
82 | # Installs npm dependencies
83 | .PHONY: npm
84 | npm:
85 | ifeq (,$(wildcard $(CURDIR)/package.json))
86 | cd js && $(npm) run build
87 | else
88 | npm run build
89 | endif
90 |
91 | # Removes the appstore build
92 | .PHONY: clean
93 | clean:
94 | rm -rf ./build
95 |
96 | # Same as clean but also removes dependencies installed by composer, bower and
97 | # npm
98 | .PHONY: distclean
99 | distclean: clean
100 | rm -rf vendor
101 | rm -rf node_modules
102 | rm -rf js/vendor
103 | rm -rf js/node_modules
104 |
105 | # Builds the source and appstore package
106 | .PHONY: dist
107 | dist:
108 | make source
109 | make appstore
110 |
111 | # Builds the source package
112 | .PHONY: source
113 | source:
114 | rm -rf $(source_build_directory)
115 | mkdir -p $(source_build_directory)
116 | tar cvzf $(source_package_name).tar.gz ../$(app_name) \
117 | --exclude-vcs \
118 | --exclude="../$(app_name)/build" \
119 | --exclude="../$(app_name)/js/node_modules" \
120 | --exclude="../$(app_name)/node_modules" \
121 | --exclude="../$(app_name)/*.log" \
122 | --exclude="../$(app_name)/js/*.log" \
123 |
124 | # Builds the source package for the app store, ignores php and js tests
125 | .PHONY: appstore
126 | appstore:
127 | rm -rf $(appstore_build_directory)
128 | mkdir -p $(appstore_build_directory)
129 | tar cvzf $(appstore_package_name).tar.gz ../$(app_name) \
130 | --exclude-vcs \
131 | --exclude="../$(app_name)/build" \
132 | --exclude="../$(app_name)/tests" \
133 | --exclude="../$(app_name)/Makefile" \
134 | --exclude="../$(app_name)/*.log" \
135 | --exclude="../$(app_name)/phpunit*xml" \
136 | --exclude="../$(app_name)/composer.*" \
137 | --exclude="../$(app_name)/js/node_modules" \
138 | --exclude="../$(app_name)/js/tests" \
139 | --exclude="../$(app_name)/js/test" \
140 | --exclude="../$(app_name)/js/*.log" \
141 | --exclude="../$(app_name)/js/package.json" \
142 | --exclude="../$(app_name)/js/bower.json" \
143 | --exclude="../$(app_name)/js/karma.*" \
144 | --exclude="../$(app_name)/js/protractor.*" \
145 | --exclude="../$(app_name)/package.json" \
146 | --exclude="../$(app_name)/bower.json" \
147 | --exclude="../$(app_name)/karma.*" \
148 | --exclude="../$(app_name)/protractor\.*" \
149 | --exclude="../$(app_name)/.*" \
150 | --exclude="../$(app_name)/js/.*" \
151 |
152 | .PHONY: test
153 | test: composer
154 | $(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.xml
155 | $(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml
156 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IPFS for Nextcloud
2 |
3 | This app allows you to use IPFS as an external storage for Nextcloud.
4 |
5 | 
6 |
7 | _Place this app in **nextcloud/apps/**_
8 |
9 | ## Documentation
10 | - **[Getting Started](docs/README.md)**
11 | - [Changelog](CHANGELOG.md)
12 |
13 | ## Notes
14 | - unless you create a private IPFS swarm all files will be public *[How to](https://github.com/ahester57/ipfs-private-swarm)*
15 | - `js-ipfs` <= `v0.40` and `go-ipfs` will not have write support
16 |
--------------------------------------------------------------------------------
/appinfo/app.php:
--------------------------------------------------------------------------------
1 | query(Application::class);
8 | }
9 |
--------------------------------------------------------------------------------
/appinfo/info.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | files_external_ipfs
4 | IPFS for Nextcloud
5 | IPFS Backend for file storage
6 |
7 | IPFS Backend for file storage
8 |
9 |
10 | 0.2.0
11 | agpl
12 | Files_External_IPFS
13 | Ѵ∑1L
14 |
15 |
16 |
17 |
18 | files
19 | integration
20 |
21 | https://github.com/justicenode/files_external_ipfs/issues
22 | https://github.com/justicenode/files_external_ipfs
23 | https://github.com/justicenode/files_external_ipfs.git
24 | https://raw.githubusercontent.com/justicenode/files_external_ipfs/master/docs/img/Screen01.png
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "IPFS for Nextcloud",
3 | "description": "IPFS Backend for file storage",
4 | "type": "project",
5 | "license": "AGPL",
6 | "authors": [
7 | {
8 | "name": "V31L"
9 | }
10 | ],
11 | "require": {
12 | "ext-curl": "*"
13 | },
14 | "require-dev": {
15 | "phpunit/phpunit": "^5.7"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 | "This file is @generated automatically"
6 | ],
7 | "content-hash": "b838f9bee48e9fb86054a1bc19552b00",
8 | "packages": [],
9 | "packages-dev": [
10 | {
11 | "name": "doctrine/instantiator",
12 | "version": "1.3.0",
13 | "source": {
14 | "type": "git",
15 | "url": "https://github.com/doctrine/instantiator.git",
16 | "reference": "ae466f726242e637cebdd526a7d991b9433bacf1"
17 | },
18 | "dist": {
19 | "type": "zip",
20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1",
21 | "reference": "ae466f726242e637cebdd526a7d991b9433bacf1",
22 | "shasum": ""
23 | },
24 | "require": {
25 | "php": "^7.1"
26 | },
27 | "require-dev": {
28 | "doctrine/coding-standard": "^6.0",
29 | "ext-pdo": "*",
30 | "ext-phar": "*",
31 | "phpbench/phpbench": "^0.13",
32 | "phpstan/phpstan-phpunit": "^0.11",
33 | "phpstan/phpstan-shim": "^0.11",
34 | "phpunit/phpunit": "^7.0"
35 | },
36 | "type": "library",
37 | "extra": {
38 | "branch-alias": {
39 | "dev-master": "1.2.x-dev"
40 | }
41 | },
42 | "autoload": {
43 | "psr-4": {
44 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
45 | }
46 | },
47 | "notification-url": "https://packagist.org/downloads/",
48 | "license": [
49 | "MIT"
50 | ],
51 | "authors": [
52 | {
53 | "name": "Marco Pivetta",
54 | "email": "ocramius@gmail.com",
55 | "homepage": "http://ocramius.github.com/"
56 | }
57 | ],
58 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
59 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
60 | "keywords": [
61 | "constructor",
62 | "instantiate"
63 | ],
64 | "time": "2019-10-21T16:45:58+00:00"
65 | },
66 | {
67 | "name": "myclabs/deep-copy",
68 | "version": "1.9.5",
69 | "source": {
70 | "type": "git",
71 | "url": "https://github.com/myclabs/DeepCopy.git",
72 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef"
73 | },
74 | "dist": {
75 | "type": "zip",
76 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef",
77 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef",
78 | "shasum": ""
79 | },
80 | "require": {
81 | "php": "^7.1"
82 | },
83 | "replace": {
84 | "myclabs/deep-copy": "self.version"
85 | },
86 | "require-dev": {
87 | "doctrine/collections": "^1.0",
88 | "doctrine/common": "^2.6",
89 | "phpunit/phpunit": "^7.1"
90 | },
91 | "type": "library",
92 | "autoload": {
93 | "psr-4": {
94 | "DeepCopy\\": "src/DeepCopy/"
95 | },
96 | "files": [
97 | "src/DeepCopy/deep_copy.php"
98 | ]
99 | },
100 | "notification-url": "https://packagist.org/downloads/",
101 | "license": [
102 | "MIT"
103 | ],
104 | "description": "Create deep copies (clones) of your objects",
105 | "keywords": [
106 | "clone",
107 | "copy",
108 | "duplicate",
109 | "object",
110 | "object graph"
111 | ],
112 | "time": "2020-01-17T21:11:47+00:00"
113 | },
114 | {
115 | "name": "phpdocumentor/reflection-common",
116 | "version": "2.1.0",
117 | "source": {
118 | "type": "git",
119 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
120 | "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b"
121 | },
122 | "dist": {
123 | "type": "zip",
124 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
125 | "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
126 | "shasum": ""
127 | },
128 | "require": {
129 | "php": ">=7.1"
130 | },
131 | "type": "library",
132 | "extra": {
133 | "branch-alias": {
134 | "dev-master": "2.x-dev"
135 | }
136 | },
137 | "autoload": {
138 | "psr-4": {
139 | "phpDocumentor\\Reflection\\": "src/"
140 | }
141 | },
142 | "notification-url": "https://packagist.org/downloads/",
143 | "license": [
144 | "MIT"
145 | ],
146 | "authors": [
147 | {
148 | "name": "Jaap van Otterdijk",
149 | "email": "opensource@ijaap.nl"
150 | }
151 | ],
152 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
153 | "homepage": "http://www.phpdoc.org",
154 | "keywords": [
155 | "FQSEN",
156 | "phpDocumentor",
157 | "phpdoc",
158 | "reflection",
159 | "static analysis"
160 | ],
161 | "time": "2020-04-27T09:25:28+00:00"
162 | },
163 | {
164 | "name": "phpdocumentor/reflection-docblock",
165 | "version": "5.1.0",
166 | "source": {
167 | "type": "git",
168 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
169 | "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
170 | },
171 | "dist": {
172 | "type": "zip",
173 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
174 | "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
175 | "shasum": ""
176 | },
177 | "require": {
178 | "ext-filter": "^7.1",
179 | "php": "^7.2",
180 | "phpdocumentor/reflection-common": "^2.0",
181 | "phpdocumentor/type-resolver": "^1.0",
182 | "webmozart/assert": "^1"
183 | },
184 | "require-dev": {
185 | "doctrine/instantiator": "^1",
186 | "mockery/mockery": "^1"
187 | },
188 | "type": "library",
189 | "extra": {
190 | "branch-alias": {
191 | "dev-master": "5.x-dev"
192 | }
193 | },
194 | "autoload": {
195 | "psr-4": {
196 | "phpDocumentor\\Reflection\\": "src"
197 | }
198 | },
199 | "notification-url": "https://packagist.org/downloads/",
200 | "license": [
201 | "MIT"
202 | ],
203 | "authors": [
204 | {
205 | "name": "Mike van Riel",
206 | "email": "me@mikevanriel.com"
207 | },
208 | {
209 | "name": "Jaap van Otterdijk",
210 | "email": "account@ijaap.nl"
211 | }
212 | ],
213 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
214 | "time": "2020-02-22T12:28:44+00:00"
215 | },
216 | {
217 | "name": "phpdocumentor/type-resolver",
218 | "version": "1.1.0",
219 | "source": {
220 | "type": "git",
221 | "url": "https://github.com/phpDocumentor/TypeResolver.git",
222 | "reference": "7462d5f123dfc080dfdf26897032a6513644fc95"
223 | },
224 | "dist": {
225 | "type": "zip",
226 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95",
227 | "reference": "7462d5f123dfc080dfdf26897032a6513644fc95",
228 | "shasum": ""
229 | },
230 | "require": {
231 | "php": "^7.2",
232 | "phpdocumentor/reflection-common": "^2.0"
233 | },
234 | "require-dev": {
235 | "ext-tokenizer": "^7.2",
236 | "mockery/mockery": "~1"
237 | },
238 | "type": "library",
239 | "extra": {
240 | "branch-alias": {
241 | "dev-master": "1.x-dev"
242 | }
243 | },
244 | "autoload": {
245 | "psr-4": {
246 | "phpDocumentor\\Reflection\\": "src"
247 | }
248 | },
249 | "notification-url": "https://packagist.org/downloads/",
250 | "license": [
251 | "MIT"
252 | ],
253 | "authors": [
254 | {
255 | "name": "Mike van Riel",
256 | "email": "me@mikevanriel.com"
257 | }
258 | ],
259 | "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
260 | "time": "2020-02-18T18:59:58+00:00"
261 | },
262 | {
263 | "name": "phpspec/prophecy",
264 | "version": "v1.10.3",
265 | "source": {
266 | "type": "git",
267 | "url": "https://github.com/phpspec/prophecy.git",
268 | "reference": "451c3cd1418cf640de218914901e51b064abb093"
269 | },
270 | "dist": {
271 | "type": "zip",
272 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
273 | "reference": "451c3cd1418cf640de218914901e51b064abb093",
274 | "shasum": ""
275 | },
276 | "require": {
277 | "doctrine/instantiator": "^1.0.2",
278 | "php": "^5.3|^7.0",
279 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
280 | "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
281 | "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
282 | },
283 | "require-dev": {
284 | "phpspec/phpspec": "^2.5 || ^3.2",
285 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
286 | },
287 | "type": "library",
288 | "extra": {
289 | "branch-alias": {
290 | "dev-master": "1.10.x-dev"
291 | }
292 | },
293 | "autoload": {
294 | "psr-4": {
295 | "Prophecy\\": "src/Prophecy"
296 | }
297 | },
298 | "notification-url": "https://packagist.org/downloads/",
299 | "license": [
300 | "MIT"
301 | ],
302 | "authors": [
303 | {
304 | "name": "Konstantin Kudryashov",
305 | "email": "ever.zet@gmail.com",
306 | "homepage": "http://everzet.com"
307 | },
308 | {
309 | "name": "Marcello Duarte",
310 | "email": "marcello.duarte@gmail.com"
311 | }
312 | ],
313 | "description": "Highly opinionated mocking framework for PHP 5.3+",
314 | "homepage": "https://github.com/phpspec/prophecy",
315 | "keywords": [
316 | "Double",
317 | "Dummy",
318 | "fake",
319 | "mock",
320 | "spy",
321 | "stub"
322 | ],
323 | "time": "2020-03-05T15:02:03+00:00"
324 | },
325 | {
326 | "name": "phpunit/php-code-coverage",
327 | "version": "4.0.8",
328 | "source": {
329 | "type": "git",
330 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
331 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
332 | },
333 | "dist": {
334 | "type": "zip",
335 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
336 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
337 | "shasum": ""
338 | },
339 | "require": {
340 | "ext-dom": "*",
341 | "ext-xmlwriter": "*",
342 | "php": "^5.6 || ^7.0",
343 | "phpunit/php-file-iterator": "^1.3",
344 | "phpunit/php-text-template": "^1.2",
345 | "phpunit/php-token-stream": "^1.4.2 || ^2.0",
346 | "sebastian/code-unit-reverse-lookup": "^1.0",
347 | "sebastian/environment": "^1.3.2 || ^2.0",
348 | "sebastian/version": "^1.0 || ^2.0"
349 | },
350 | "require-dev": {
351 | "ext-xdebug": "^2.1.4",
352 | "phpunit/phpunit": "^5.7"
353 | },
354 | "suggest": {
355 | "ext-xdebug": "^2.5.1"
356 | },
357 | "type": "library",
358 | "extra": {
359 | "branch-alias": {
360 | "dev-master": "4.0.x-dev"
361 | }
362 | },
363 | "autoload": {
364 | "classmap": [
365 | "src/"
366 | ]
367 | },
368 | "notification-url": "https://packagist.org/downloads/",
369 | "license": [
370 | "BSD-3-Clause"
371 | ],
372 | "authors": [
373 | {
374 | "name": "Sebastian Bergmann",
375 | "email": "sb@sebastian-bergmann.de",
376 | "role": "lead"
377 | }
378 | ],
379 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
380 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
381 | "keywords": [
382 | "coverage",
383 | "testing",
384 | "xunit"
385 | ],
386 | "time": "2017-04-02T07:44:40+00:00"
387 | },
388 | {
389 | "name": "phpunit/php-file-iterator",
390 | "version": "1.4.5",
391 | "source": {
392 | "type": "git",
393 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
394 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
395 | },
396 | "dist": {
397 | "type": "zip",
398 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
399 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
400 | "shasum": ""
401 | },
402 | "require": {
403 | "php": ">=5.3.3"
404 | },
405 | "type": "library",
406 | "extra": {
407 | "branch-alias": {
408 | "dev-master": "1.4.x-dev"
409 | }
410 | },
411 | "autoload": {
412 | "classmap": [
413 | "src/"
414 | ]
415 | },
416 | "notification-url": "https://packagist.org/downloads/",
417 | "license": [
418 | "BSD-3-Clause"
419 | ],
420 | "authors": [
421 | {
422 | "name": "Sebastian Bergmann",
423 | "email": "sb@sebastian-bergmann.de",
424 | "role": "lead"
425 | }
426 | ],
427 | "description": "FilterIterator implementation that filters files based on a list of suffixes.",
428 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
429 | "keywords": [
430 | "filesystem",
431 | "iterator"
432 | ],
433 | "time": "2017-11-27T13:52:08+00:00"
434 | },
435 | {
436 | "name": "phpunit/php-text-template",
437 | "version": "1.2.1",
438 | "source": {
439 | "type": "git",
440 | "url": "https://github.com/sebastianbergmann/php-text-template.git",
441 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
442 | },
443 | "dist": {
444 | "type": "zip",
445 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
446 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
447 | "shasum": ""
448 | },
449 | "require": {
450 | "php": ">=5.3.3"
451 | },
452 | "type": "library",
453 | "autoload": {
454 | "classmap": [
455 | "src/"
456 | ]
457 | },
458 | "notification-url": "https://packagist.org/downloads/",
459 | "license": [
460 | "BSD-3-Clause"
461 | ],
462 | "authors": [
463 | {
464 | "name": "Sebastian Bergmann",
465 | "email": "sebastian@phpunit.de",
466 | "role": "lead"
467 | }
468 | ],
469 | "description": "Simple template engine.",
470 | "homepage": "https://github.com/sebastianbergmann/php-text-template/",
471 | "keywords": [
472 | "template"
473 | ],
474 | "time": "2015-06-21T13:50:34+00:00"
475 | },
476 | {
477 | "name": "phpunit/php-timer",
478 | "version": "1.0.9",
479 | "source": {
480 | "type": "git",
481 | "url": "https://github.com/sebastianbergmann/php-timer.git",
482 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
483 | },
484 | "dist": {
485 | "type": "zip",
486 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
487 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
488 | "shasum": ""
489 | },
490 | "require": {
491 | "php": "^5.3.3 || ^7.0"
492 | },
493 | "require-dev": {
494 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
495 | },
496 | "type": "library",
497 | "extra": {
498 | "branch-alias": {
499 | "dev-master": "1.0-dev"
500 | }
501 | },
502 | "autoload": {
503 | "classmap": [
504 | "src/"
505 | ]
506 | },
507 | "notification-url": "https://packagist.org/downloads/",
508 | "license": [
509 | "BSD-3-Clause"
510 | ],
511 | "authors": [
512 | {
513 | "name": "Sebastian Bergmann",
514 | "email": "sb@sebastian-bergmann.de",
515 | "role": "lead"
516 | }
517 | ],
518 | "description": "Utility class for timing",
519 | "homepage": "https://github.com/sebastianbergmann/php-timer/",
520 | "keywords": [
521 | "timer"
522 | ],
523 | "time": "2017-02-26T11:10:40+00:00"
524 | },
525 | {
526 | "name": "phpunit/php-token-stream",
527 | "version": "2.0.2",
528 | "source": {
529 | "type": "git",
530 | "url": "https://github.com/sebastianbergmann/php-token-stream.git",
531 | "reference": "791198a2c6254db10131eecfe8c06670700904db"
532 | },
533 | "dist": {
534 | "type": "zip",
535 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
536 | "reference": "791198a2c6254db10131eecfe8c06670700904db",
537 | "shasum": ""
538 | },
539 | "require": {
540 | "ext-tokenizer": "*",
541 | "php": "^7.0"
542 | },
543 | "require-dev": {
544 | "phpunit/phpunit": "^6.2.4"
545 | },
546 | "type": "library",
547 | "extra": {
548 | "branch-alias": {
549 | "dev-master": "2.0-dev"
550 | }
551 | },
552 | "autoload": {
553 | "classmap": [
554 | "src/"
555 | ]
556 | },
557 | "notification-url": "https://packagist.org/downloads/",
558 | "license": [
559 | "BSD-3-Clause"
560 | ],
561 | "authors": [
562 | {
563 | "name": "Sebastian Bergmann",
564 | "email": "sebastian@phpunit.de"
565 | }
566 | ],
567 | "description": "Wrapper around PHP's tokenizer extension.",
568 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
569 | "keywords": [
570 | "tokenizer"
571 | ],
572 | "time": "2017-11-27T05:48:46+00:00"
573 | },
574 | {
575 | "name": "phpunit/phpunit",
576 | "version": "5.7.27",
577 | "source": {
578 | "type": "git",
579 | "url": "https://github.com/sebastianbergmann/phpunit.git",
580 | "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
581 | },
582 | "dist": {
583 | "type": "zip",
584 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
585 | "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
586 | "shasum": ""
587 | },
588 | "require": {
589 | "ext-dom": "*",
590 | "ext-json": "*",
591 | "ext-libxml": "*",
592 | "ext-mbstring": "*",
593 | "ext-xml": "*",
594 | "myclabs/deep-copy": "~1.3",
595 | "php": "^5.6 || ^7.0",
596 | "phpspec/prophecy": "^1.6.2",
597 | "phpunit/php-code-coverage": "^4.0.4",
598 | "phpunit/php-file-iterator": "~1.4",
599 | "phpunit/php-text-template": "~1.2",
600 | "phpunit/php-timer": "^1.0.6",
601 | "phpunit/phpunit-mock-objects": "^3.2",
602 | "sebastian/comparator": "^1.2.4",
603 | "sebastian/diff": "^1.4.3",
604 | "sebastian/environment": "^1.3.4 || ^2.0",
605 | "sebastian/exporter": "~2.0",
606 | "sebastian/global-state": "^1.1",
607 | "sebastian/object-enumerator": "~2.0",
608 | "sebastian/resource-operations": "~1.0",
609 | "sebastian/version": "^1.0.6|^2.0.1",
610 | "symfony/yaml": "~2.1|~3.0|~4.0"
611 | },
612 | "conflict": {
613 | "phpdocumentor/reflection-docblock": "3.0.2"
614 | },
615 | "require-dev": {
616 | "ext-pdo": "*"
617 | },
618 | "suggest": {
619 | "ext-xdebug": "*",
620 | "phpunit/php-invoker": "~1.1"
621 | },
622 | "bin": [
623 | "phpunit"
624 | ],
625 | "type": "library",
626 | "extra": {
627 | "branch-alias": {
628 | "dev-master": "5.7.x-dev"
629 | }
630 | },
631 | "autoload": {
632 | "classmap": [
633 | "src/"
634 | ]
635 | },
636 | "notification-url": "https://packagist.org/downloads/",
637 | "license": [
638 | "BSD-3-Clause"
639 | ],
640 | "authors": [
641 | {
642 | "name": "Sebastian Bergmann",
643 | "email": "sebastian@phpunit.de",
644 | "role": "lead"
645 | }
646 | ],
647 | "description": "The PHP Unit Testing framework.",
648 | "homepage": "https://phpunit.de/",
649 | "keywords": [
650 | "phpunit",
651 | "testing",
652 | "xunit"
653 | ],
654 | "time": "2018-02-01T05:50:59+00:00"
655 | },
656 | {
657 | "name": "phpunit/phpunit-mock-objects",
658 | "version": "3.4.4",
659 | "source": {
660 | "type": "git",
661 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
662 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
663 | },
664 | "dist": {
665 | "type": "zip",
666 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
667 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
668 | "shasum": ""
669 | },
670 | "require": {
671 | "doctrine/instantiator": "^1.0.2",
672 | "php": "^5.6 || ^7.0",
673 | "phpunit/php-text-template": "^1.2",
674 | "sebastian/exporter": "^1.2 || ^2.0"
675 | },
676 | "conflict": {
677 | "phpunit/phpunit": "<5.4.0"
678 | },
679 | "require-dev": {
680 | "phpunit/phpunit": "^5.4"
681 | },
682 | "suggest": {
683 | "ext-soap": "*"
684 | },
685 | "type": "library",
686 | "extra": {
687 | "branch-alias": {
688 | "dev-master": "3.2.x-dev"
689 | }
690 | },
691 | "autoload": {
692 | "classmap": [
693 | "src/"
694 | ]
695 | },
696 | "notification-url": "https://packagist.org/downloads/",
697 | "license": [
698 | "BSD-3-Clause"
699 | ],
700 | "authors": [
701 | {
702 | "name": "Sebastian Bergmann",
703 | "email": "sb@sebastian-bergmann.de",
704 | "role": "lead"
705 | }
706 | ],
707 | "description": "Mock Object library for PHPUnit",
708 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
709 | "keywords": [
710 | "mock",
711 | "xunit"
712 | ],
713 | "abandoned": true,
714 | "time": "2017-06-30T09:13:00+00:00"
715 | },
716 | {
717 | "name": "sebastian/code-unit-reverse-lookup",
718 | "version": "1.0.1",
719 | "source": {
720 | "type": "git",
721 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
722 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
723 | },
724 | "dist": {
725 | "type": "zip",
726 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
727 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
728 | "shasum": ""
729 | },
730 | "require": {
731 | "php": "^5.6 || ^7.0"
732 | },
733 | "require-dev": {
734 | "phpunit/phpunit": "^5.7 || ^6.0"
735 | },
736 | "type": "library",
737 | "extra": {
738 | "branch-alias": {
739 | "dev-master": "1.0.x-dev"
740 | }
741 | },
742 | "autoload": {
743 | "classmap": [
744 | "src/"
745 | ]
746 | },
747 | "notification-url": "https://packagist.org/downloads/",
748 | "license": [
749 | "BSD-3-Clause"
750 | ],
751 | "authors": [
752 | {
753 | "name": "Sebastian Bergmann",
754 | "email": "sebastian@phpunit.de"
755 | }
756 | ],
757 | "description": "Looks up which function or method a line of code belongs to",
758 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
759 | "time": "2017-03-04T06:30:41+00:00"
760 | },
761 | {
762 | "name": "sebastian/comparator",
763 | "version": "1.2.4",
764 | "source": {
765 | "type": "git",
766 | "url": "https://github.com/sebastianbergmann/comparator.git",
767 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
768 | },
769 | "dist": {
770 | "type": "zip",
771 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
772 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
773 | "shasum": ""
774 | },
775 | "require": {
776 | "php": ">=5.3.3",
777 | "sebastian/diff": "~1.2",
778 | "sebastian/exporter": "~1.2 || ~2.0"
779 | },
780 | "require-dev": {
781 | "phpunit/phpunit": "~4.4"
782 | },
783 | "type": "library",
784 | "extra": {
785 | "branch-alias": {
786 | "dev-master": "1.2.x-dev"
787 | }
788 | },
789 | "autoload": {
790 | "classmap": [
791 | "src/"
792 | ]
793 | },
794 | "notification-url": "https://packagist.org/downloads/",
795 | "license": [
796 | "BSD-3-Clause"
797 | ],
798 | "authors": [
799 | {
800 | "name": "Jeff Welch",
801 | "email": "whatthejeff@gmail.com"
802 | },
803 | {
804 | "name": "Volker Dusch",
805 | "email": "github@wallbash.com"
806 | },
807 | {
808 | "name": "Bernhard Schussek",
809 | "email": "bschussek@2bepublished.at"
810 | },
811 | {
812 | "name": "Sebastian Bergmann",
813 | "email": "sebastian@phpunit.de"
814 | }
815 | ],
816 | "description": "Provides the functionality to compare PHP values for equality",
817 | "homepage": "http://www.github.com/sebastianbergmann/comparator",
818 | "keywords": [
819 | "comparator",
820 | "compare",
821 | "equality"
822 | ],
823 | "time": "2017-01-29T09:50:25+00:00"
824 | },
825 | {
826 | "name": "sebastian/diff",
827 | "version": "1.4.3",
828 | "source": {
829 | "type": "git",
830 | "url": "https://github.com/sebastianbergmann/diff.git",
831 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
832 | },
833 | "dist": {
834 | "type": "zip",
835 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
836 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
837 | "shasum": ""
838 | },
839 | "require": {
840 | "php": "^5.3.3 || ^7.0"
841 | },
842 | "require-dev": {
843 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
844 | },
845 | "type": "library",
846 | "extra": {
847 | "branch-alias": {
848 | "dev-master": "1.4-dev"
849 | }
850 | },
851 | "autoload": {
852 | "classmap": [
853 | "src/"
854 | ]
855 | },
856 | "notification-url": "https://packagist.org/downloads/",
857 | "license": [
858 | "BSD-3-Clause"
859 | ],
860 | "authors": [
861 | {
862 | "name": "Kore Nordmann",
863 | "email": "mail@kore-nordmann.de"
864 | },
865 | {
866 | "name": "Sebastian Bergmann",
867 | "email": "sebastian@phpunit.de"
868 | }
869 | ],
870 | "description": "Diff implementation",
871 | "homepage": "https://github.com/sebastianbergmann/diff",
872 | "keywords": [
873 | "diff"
874 | ],
875 | "time": "2017-05-22T07:24:03+00:00"
876 | },
877 | {
878 | "name": "sebastian/environment",
879 | "version": "2.0.0",
880 | "source": {
881 | "type": "git",
882 | "url": "https://github.com/sebastianbergmann/environment.git",
883 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
884 | },
885 | "dist": {
886 | "type": "zip",
887 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
888 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
889 | "shasum": ""
890 | },
891 | "require": {
892 | "php": "^5.6 || ^7.0"
893 | },
894 | "require-dev": {
895 | "phpunit/phpunit": "^5.0"
896 | },
897 | "type": "library",
898 | "extra": {
899 | "branch-alias": {
900 | "dev-master": "2.0.x-dev"
901 | }
902 | },
903 | "autoload": {
904 | "classmap": [
905 | "src/"
906 | ]
907 | },
908 | "notification-url": "https://packagist.org/downloads/",
909 | "license": [
910 | "BSD-3-Clause"
911 | ],
912 | "authors": [
913 | {
914 | "name": "Sebastian Bergmann",
915 | "email": "sebastian@phpunit.de"
916 | }
917 | ],
918 | "description": "Provides functionality to handle HHVM/PHP environments",
919 | "homepage": "http://www.github.com/sebastianbergmann/environment",
920 | "keywords": [
921 | "Xdebug",
922 | "environment",
923 | "hhvm"
924 | ],
925 | "time": "2016-11-26T07:53:53+00:00"
926 | },
927 | {
928 | "name": "sebastian/exporter",
929 | "version": "2.0.0",
930 | "source": {
931 | "type": "git",
932 | "url": "https://github.com/sebastianbergmann/exporter.git",
933 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
934 | },
935 | "dist": {
936 | "type": "zip",
937 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
938 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
939 | "shasum": ""
940 | },
941 | "require": {
942 | "php": ">=5.3.3",
943 | "sebastian/recursion-context": "~2.0"
944 | },
945 | "require-dev": {
946 | "ext-mbstring": "*",
947 | "phpunit/phpunit": "~4.4"
948 | },
949 | "type": "library",
950 | "extra": {
951 | "branch-alias": {
952 | "dev-master": "2.0.x-dev"
953 | }
954 | },
955 | "autoload": {
956 | "classmap": [
957 | "src/"
958 | ]
959 | },
960 | "notification-url": "https://packagist.org/downloads/",
961 | "license": [
962 | "BSD-3-Clause"
963 | ],
964 | "authors": [
965 | {
966 | "name": "Jeff Welch",
967 | "email": "whatthejeff@gmail.com"
968 | },
969 | {
970 | "name": "Volker Dusch",
971 | "email": "github@wallbash.com"
972 | },
973 | {
974 | "name": "Bernhard Schussek",
975 | "email": "bschussek@2bepublished.at"
976 | },
977 | {
978 | "name": "Sebastian Bergmann",
979 | "email": "sebastian@phpunit.de"
980 | },
981 | {
982 | "name": "Adam Harvey",
983 | "email": "aharvey@php.net"
984 | }
985 | ],
986 | "description": "Provides the functionality to export PHP variables for visualization",
987 | "homepage": "http://www.github.com/sebastianbergmann/exporter",
988 | "keywords": [
989 | "export",
990 | "exporter"
991 | ],
992 | "time": "2016-11-19T08:54:04+00:00"
993 | },
994 | {
995 | "name": "sebastian/global-state",
996 | "version": "1.1.1",
997 | "source": {
998 | "type": "git",
999 | "url": "https://github.com/sebastianbergmann/global-state.git",
1000 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
1001 | },
1002 | "dist": {
1003 | "type": "zip",
1004 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
1005 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
1006 | "shasum": ""
1007 | },
1008 | "require": {
1009 | "php": ">=5.3.3"
1010 | },
1011 | "require-dev": {
1012 | "phpunit/phpunit": "~4.2"
1013 | },
1014 | "suggest": {
1015 | "ext-uopz": "*"
1016 | },
1017 | "type": "library",
1018 | "extra": {
1019 | "branch-alias": {
1020 | "dev-master": "1.0-dev"
1021 | }
1022 | },
1023 | "autoload": {
1024 | "classmap": [
1025 | "src/"
1026 | ]
1027 | },
1028 | "notification-url": "https://packagist.org/downloads/",
1029 | "license": [
1030 | "BSD-3-Clause"
1031 | ],
1032 | "authors": [
1033 | {
1034 | "name": "Sebastian Bergmann",
1035 | "email": "sebastian@phpunit.de"
1036 | }
1037 | ],
1038 | "description": "Snapshotting of global state",
1039 | "homepage": "http://www.github.com/sebastianbergmann/global-state",
1040 | "keywords": [
1041 | "global state"
1042 | ],
1043 | "time": "2015-10-12T03:26:01+00:00"
1044 | },
1045 | {
1046 | "name": "sebastian/object-enumerator",
1047 | "version": "2.0.1",
1048 | "source": {
1049 | "type": "git",
1050 | "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1051 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
1052 | },
1053 | "dist": {
1054 | "type": "zip",
1055 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
1056 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
1057 | "shasum": ""
1058 | },
1059 | "require": {
1060 | "php": ">=5.6",
1061 | "sebastian/recursion-context": "~2.0"
1062 | },
1063 | "require-dev": {
1064 | "phpunit/phpunit": "~5"
1065 | },
1066 | "type": "library",
1067 | "extra": {
1068 | "branch-alias": {
1069 | "dev-master": "2.0.x-dev"
1070 | }
1071 | },
1072 | "autoload": {
1073 | "classmap": [
1074 | "src/"
1075 | ]
1076 | },
1077 | "notification-url": "https://packagist.org/downloads/",
1078 | "license": [
1079 | "BSD-3-Clause"
1080 | ],
1081 | "authors": [
1082 | {
1083 | "name": "Sebastian Bergmann",
1084 | "email": "sebastian@phpunit.de"
1085 | }
1086 | ],
1087 | "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1088 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1089 | "time": "2017-02-18T15:18:39+00:00"
1090 | },
1091 | {
1092 | "name": "sebastian/recursion-context",
1093 | "version": "2.0.0",
1094 | "source": {
1095 | "type": "git",
1096 | "url": "https://github.com/sebastianbergmann/recursion-context.git",
1097 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
1098 | },
1099 | "dist": {
1100 | "type": "zip",
1101 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1102 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1103 | "shasum": ""
1104 | },
1105 | "require": {
1106 | "php": ">=5.3.3"
1107 | },
1108 | "require-dev": {
1109 | "phpunit/phpunit": "~4.4"
1110 | },
1111 | "type": "library",
1112 | "extra": {
1113 | "branch-alias": {
1114 | "dev-master": "2.0.x-dev"
1115 | }
1116 | },
1117 | "autoload": {
1118 | "classmap": [
1119 | "src/"
1120 | ]
1121 | },
1122 | "notification-url": "https://packagist.org/downloads/",
1123 | "license": [
1124 | "BSD-3-Clause"
1125 | ],
1126 | "authors": [
1127 | {
1128 | "name": "Jeff Welch",
1129 | "email": "whatthejeff@gmail.com"
1130 | },
1131 | {
1132 | "name": "Sebastian Bergmann",
1133 | "email": "sebastian@phpunit.de"
1134 | },
1135 | {
1136 | "name": "Adam Harvey",
1137 | "email": "aharvey@php.net"
1138 | }
1139 | ],
1140 | "description": "Provides functionality to recursively process PHP variables",
1141 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1142 | "time": "2016-11-19T07:33:16+00:00"
1143 | },
1144 | {
1145 | "name": "sebastian/resource-operations",
1146 | "version": "1.0.0",
1147 | "source": {
1148 | "type": "git",
1149 | "url": "https://github.com/sebastianbergmann/resource-operations.git",
1150 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
1151 | },
1152 | "dist": {
1153 | "type": "zip",
1154 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1155 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1156 | "shasum": ""
1157 | },
1158 | "require": {
1159 | "php": ">=5.6.0"
1160 | },
1161 | "type": "library",
1162 | "extra": {
1163 | "branch-alias": {
1164 | "dev-master": "1.0.x-dev"
1165 | }
1166 | },
1167 | "autoload": {
1168 | "classmap": [
1169 | "src/"
1170 | ]
1171 | },
1172 | "notification-url": "https://packagist.org/downloads/",
1173 | "license": [
1174 | "BSD-3-Clause"
1175 | ],
1176 | "authors": [
1177 | {
1178 | "name": "Sebastian Bergmann",
1179 | "email": "sebastian@phpunit.de"
1180 | }
1181 | ],
1182 | "description": "Provides a list of PHP built-in functions that operate on resources",
1183 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1184 | "time": "2015-07-28T20:34:47+00:00"
1185 | },
1186 | {
1187 | "name": "sebastian/version",
1188 | "version": "2.0.1",
1189 | "source": {
1190 | "type": "git",
1191 | "url": "https://github.com/sebastianbergmann/version.git",
1192 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
1193 | },
1194 | "dist": {
1195 | "type": "zip",
1196 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
1197 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
1198 | "shasum": ""
1199 | },
1200 | "require": {
1201 | "php": ">=5.6"
1202 | },
1203 | "type": "library",
1204 | "extra": {
1205 | "branch-alias": {
1206 | "dev-master": "2.0.x-dev"
1207 | }
1208 | },
1209 | "autoload": {
1210 | "classmap": [
1211 | "src/"
1212 | ]
1213 | },
1214 | "notification-url": "https://packagist.org/downloads/",
1215 | "license": [
1216 | "BSD-3-Clause"
1217 | ],
1218 | "authors": [
1219 | {
1220 | "name": "Sebastian Bergmann",
1221 | "email": "sebastian@phpunit.de",
1222 | "role": "lead"
1223 | }
1224 | ],
1225 | "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1226 | "homepage": "https://github.com/sebastianbergmann/version",
1227 | "time": "2016-10-03T07:35:21+00:00"
1228 | },
1229 | {
1230 | "name": "symfony/polyfill-ctype",
1231 | "version": "v1.15.0",
1232 | "source": {
1233 | "type": "git",
1234 | "url": "https://github.com/symfony/polyfill-ctype.git",
1235 | "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14"
1236 | },
1237 | "dist": {
1238 | "type": "zip",
1239 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
1240 | "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
1241 | "shasum": ""
1242 | },
1243 | "require": {
1244 | "php": ">=5.3.3"
1245 | },
1246 | "suggest": {
1247 | "ext-ctype": "For best performance"
1248 | },
1249 | "type": "library",
1250 | "extra": {
1251 | "branch-alias": {
1252 | "dev-master": "1.15-dev"
1253 | }
1254 | },
1255 | "autoload": {
1256 | "psr-4": {
1257 | "Symfony\\Polyfill\\Ctype\\": ""
1258 | },
1259 | "files": [
1260 | "bootstrap.php"
1261 | ]
1262 | },
1263 | "notification-url": "https://packagist.org/downloads/",
1264 | "license": [
1265 | "MIT"
1266 | ],
1267 | "authors": [
1268 | {
1269 | "name": "Gert de Pagter",
1270 | "email": "BackEndTea@gmail.com"
1271 | },
1272 | {
1273 | "name": "Symfony Community",
1274 | "homepage": "https://symfony.com/contributors"
1275 | }
1276 | ],
1277 | "description": "Symfony polyfill for ctype functions",
1278 | "homepage": "https://symfony.com",
1279 | "keywords": [
1280 | "compatibility",
1281 | "ctype",
1282 | "polyfill",
1283 | "portable"
1284 | ],
1285 | "time": "2020-02-27T09:26:54+00:00"
1286 | },
1287 | {
1288 | "name": "symfony/yaml",
1289 | "version": "v4.4.8",
1290 | "source": {
1291 | "type": "git",
1292 | "url": "https://github.com/symfony/yaml.git",
1293 | "reference": "b385dce1c0e9f839b384af90188638819433e252"
1294 | },
1295 | "dist": {
1296 | "type": "zip",
1297 | "url": "https://api.github.com/repos/symfony/yaml/zipball/b385dce1c0e9f839b384af90188638819433e252",
1298 | "reference": "b385dce1c0e9f839b384af90188638819433e252",
1299 | "shasum": ""
1300 | },
1301 | "require": {
1302 | "php": "^7.1.3",
1303 | "symfony/polyfill-ctype": "~1.8"
1304 | },
1305 | "conflict": {
1306 | "symfony/console": "<3.4"
1307 | },
1308 | "require-dev": {
1309 | "symfony/console": "^3.4|^4.0|^5.0"
1310 | },
1311 | "suggest": {
1312 | "symfony/console": "For validating YAML files using the lint command"
1313 | },
1314 | "type": "library",
1315 | "extra": {
1316 | "branch-alias": {
1317 | "dev-master": "4.4-dev"
1318 | }
1319 | },
1320 | "autoload": {
1321 | "psr-4": {
1322 | "Symfony\\Component\\Yaml\\": ""
1323 | },
1324 | "exclude-from-classmap": [
1325 | "/Tests/"
1326 | ]
1327 | },
1328 | "notification-url": "https://packagist.org/downloads/",
1329 | "license": [
1330 | "MIT"
1331 | ],
1332 | "authors": [
1333 | {
1334 | "name": "Fabien Potencier",
1335 | "email": "fabien@symfony.com"
1336 | },
1337 | {
1338 | "name": "Symfony Community",
1339 | "homepage": "https://symfony.com/contributors"
1340 | }
1341 | ],
1342 | "description": "Symfony Yaml Component",
1343 | "homepage": "https://symfony.com",
1344 | "time": "2020-04-28T17:55:16+00:00"
1345 | },
1346 | {
1347 | "name": "webmozart/assert",
1348 | "version": "1.8.0",
1349 | "source": {
1350 | "type": "git",
1351 | "url": "https://github.com/webmozart/assert.git",
1352 | "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
1353 | },
1354 | "dist": {
1355 | "type": "zip",
1356 | "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
1357 | "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
1358 | "shasum": ""
1359 | },
1360 | "require": {
1361 | "php": "^5.3.3 || ^7.0",
1362 | "symfony/polyfill-ctype": "^1.8"
1363 | },
1364 | "conflict": {
1365 | "vimeo/psalm": "<3.9.1"
1366 | },
1367 | "require-dev": {
1368 | "phpunit/phpunit": "^4.8.36 || ^7.5.13"
1369 | },
1370 | "type": "library",
1371 | "autoload": {
1372 | "psr-4": {
1373 | "Webmozart\\Assert\\": "src/"
1374 | }
1375 | },
1376 | "notification-url": "https://packagist.org/downloads/",
1377 | "license": [
1378 | "MIT"
1379 | ],
1380 | "authors": [
1381 | {
1382 | "name": "Bernhard Schussek",
1383 | "email": "bschussek@gmail.com"
1384 | }
1385 | ],
1386 | "description": "Assertions to validate method input/output with nice error messages.",
1387 | "keywords": [
1388 | "assert",
1389 | "check",
1390 | "validate"
1391 | ],
1392 | "time": "2020-04-18T12:12:48+00:00"
1393 | }
1394 | ],
1395 | "aliases": [],
1396 | "minimum-stability": "stable",
1397 | "stability-flags": [],
1398 | "prefer-stable": false,
1399 | "prefer-lowest": false,
1400 | "platform": {
1401 | "ext-curl": "*"
1402 | },
1403 | "platform-dev": []
1404 | }
1405 |
--------------------------------------------------------------------------------
/docs/Publishing.md:
--------------------------------------------------------------------------------
1 | # Publishing
2 |
3 | ## Building the app
4 |
5 | The app can be built by using the provided Makefile by running:
6 |
7 | make
8 |
9 | This requires the following things to be present:
10 | * make
11 | * which
12 | * tar: for building the archive
13 | * curl: used if phpunit and composer are not installed to fetch them from the web
14 | * npm: for building and testing everything JS, only required if a package.json is placed inside the **js/** folder
15 |
16 | The make command will install or update Composer dependencies if a composer.json is present and also **npm run build** if a package.json is present in the **js/** folder. The npm **build** script should use local paths for build systems and package managers, so people that simply want to build the app won't need to install npm libraries globally, e.g.:
17 |
18 | **package.json**:
19 | ```json
20 | "scripts": {
21 | "test": "node node_modules/gulp-cli/bin/gulp.js karma",
22 | "prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update",
23 | "build": "node node_modules/gulp-cli/bin/gulp.js"
24 | }
25 | ```
26 |
27 |
28 | ## Publish to App Store
29 |
30 | First get an account for the [App Store](http://apps.nextcloud.com/) then run:
31 |
32 | make && make appstore
33 |
34 | The archive is located in build/artifacts/appstore and can then be uploaded to the App Store.
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Documentation
2 | - [Testing](Testing.md) *How to properly do tests (__TODO__)*
3 | - [Storage](Storage.md) *Where are your files stored on IPFS*
4 |
5 | ## Installation
6 | ### Prerequesites
7 | - [Nextcloud](https://nextcloud.com/) *duh?*
8 | - a working [IPFS Node](https://ipfs.io/#install) (js-ipfs >= 0.41 | go-ipfs >= *? Not yet available*)
9 |
10 | Then clone this repo to the `apps` folder of your Nextcloud instance. And enable it in your nextcloud.
11 |
12 | ## Usage
13 | 
14 | 
15 | If the IPFS node is running locally the `IPFS API` should be `http://127.0.0.1:5001/api/v0`.
16 | `Subfolder` is the root path on the node, where all documents will be stored.
17 | If left empty it will just use the root storage of the IPFS node. *See also: [Storage](Storage.md)*
--------------------------------------------------------------------------------
/docs/Storage.md:
--------------------------------------------------------------------------------
1 | # Storage
2 | this file is about where your stored files will appear on your ipfs node
3 |
4 | ## How to find your files on IPFS
5 | If you want to get the files in your connected directory. Type the followqing to get a list of all files & directories.
6 | Where `{directory}` is the directory you entered in the `Subfolder` in the settings.
7 |
8 | `ipfs files ls /{directory}`
9 |
10 | To get the hash of a file you can use
11 |
12 | `ipfs files stat /{directory}/{filename}`
--------------------------------------------------------------------------------
/docs/Testing.md:
--------------------------------------------------------------------------------
1 | # Testing
2 |
3 | ## Running tests
4 | You can use the provided Makefile to run all tests by using:
5 |
6 | make test
7 |
8 | This will run the PHP unit and integration tests and if a package.json is present in the **js/** folder will execute **npm run test**
9 |
10 | Of course you can also install [PHPUnit](http://phpunit.de/getting-started.html) and use the configurations directly:
11 |
12 | phpunit -c phpunit.xml
13 |
14 | or:
15 |
16 | phpunit -c phpunit.integration.xml
17 |
18 | for integration tests
--------------------------------------------------------------------------------
/docs/img/Screen01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justicenode/files_external_ipfs/f3619c401368a1053936bfeef316c5c5371b82dd/docs/img/Screen01.png
--------------------------------------------------------------------------------
/docs/img/Screen02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/justicenode/files_external_ipfs/f3619c401368a1053936bfeef316c5c5371b82dd/docs/img/Screen02.png
--------------------------------------------------------------------------------
/img/app.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/AppInfo/Application.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | class Application extends App implements IBackendProvider {
17 |
18 | public function __construct(array $urlParams = []) {
19 | parent::__construct('files_external_ipfs', $urlParams);
20 | $this->register();
21 | }
22 |
23 | public function register() {
24 | $container = $this->getContainer();
25 |
26 | /** @var BackendService $backendService */
27 | $backendService = $container->query(BackendService::class);
28 | $backendService->registerBackendProvider($this);
29 | }
30 |
31 |
32 | /**
33 | * @{inheritdoc}
34 | */
35 | public function getBackends() {
36 | $container = $this->getContainer();
37 |
38 | return [
39 | $container->query(IPFS::class)
40 | ];
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/lib/Backend/IPFS.php:
--------------------------------------------------------------------------------
1 |
16 | */
17 | class IPFS extends Backend {
18 | use LegacyDependencyCheckPolyfill;
19 |
20 | public function __construct(IL10N $l, Password $legacyAuth) {
21 | $this->setIdentifier('ipfs_filesystem')
22 | ->setStorageClass(\OCA\Files_External_IPFS\Storage\IPFS::class)
23 | ->setText($l->t('IPFS'))
24 | ->addParameters([
25 | (new DefinitionParameter('host', $l->t('IPFS API'))),
26 | (new DefinitionParameter('root', $l->t('Subfolder')))
27 | ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
28 | ]);
29 | //->addAuthScheme(AuthMechanism::SCHEME_PASSWORD);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/Storage/Adapter.php:
--------------------------------------------------------------------------------
1 |
12 | */
13 | class Adapter extends AbstractAdapter {
14 | private $host;
15 |
16 | /**
17 | * @var array
18 | */
19 | private $permissions = [
20 | 'file' => [
21 | 'public' => 0644,
22 | 'private' => 0600,
23 | ],
24 | 'dir' => [
25 | 'public' => 0755,
26 | 'private' => 0700,
27 | ],
28 | ];
29 |
30 | public function __construct(string $host, string $root) {
31 | $this->host = $host;
32 |
33 | // Ensure the existence of the root directory
34 | $root = ltrim($root, '/');
35 | if (!$this->has($root)) {
36 | if (!$this->mkdir($root))
37 | throw new \Exception('root directory didn\'t exist and couldn\'t be created');
38 | }
39 | }
40 |
41 | /**
42 | * Used to call a IPFS api
43 | *
44 | * @param string $url url of api to call
45 | * @param array $params url parameters
46 | * @param array $data POST data
47 | * @return bool|string false or the body of the response
48 | */
49 | private function callAPI(string $url, array $params = [], MultipartData $data = null) {
50 | $curl = curl_init();
51 |
52 | curl_setopt($curl, CURLOPT_POST, 1);
53 |
54 | if (!empty($data)) $data->apply($curl);
55 |
56 | if (!empty($params)) $url = sprintf("%s?%s", $url, http_build_query($params));
57 |
58 | curl_setopt($curl, CURLOPT_URL, "{$this->host}{$url}");
59 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
60 |
61 | $result = curl_exec($curl);
62 | curl_close($curl);
63 |
64 | return $result;
65 | }
66 |
67 | /**
68 | * Creates a new directory on the IPFS node
69 | *
70 | * @param string $dirname location of new directory
71 | * @return bool success status
72 | */
73 | private function mkdir(string $dirname) {
74 | $response = $this->callAPI('/files/mkdir', ['arg' => "/$dirname", 'parent' => true]);
75 | return $response == ''; // return true if the directory was created, false if not
76 | }
77 |
78 | /**
79 | * Normalizes file info so that Flysystem/Nextcloud knows whats up
80 | *
81 | * @param array $entry entry from IPFS api
82 | * @param bool|string $root (optional) root if its for a directory
83 | * @return array normalized file data
84 | */
85 | private function normalizeFile(array $entry, $root = false) {
86 | return [
87 | 'type' => $root ? ($entry['Type'] == 0 ? 'dir' : 'file') : ($entry['Type'] == 'file' ? 'file' : 'dir'),
88 | 'path' => $root ? ltrim("{$root}/{$entry['Name']}", '/') : $entry['Name'],
89 | 'timestamp' => isset($entry['Mtime']) ? $entry['Mtime'] : time(),
90 | 'size' => $entry['Size'],
91 | 'visibility' => isset($entry['Mode']) && substr($entry['Mode'], 2) != '00' ? 'public' : 'private',
92 | ];
93 | }
94 |
95 | /**
96 | * Uploads a file to IPFS
97 | *
98 | * @param string $path the destination path of the file
99 | * @param string $contents the file contents to be uploaded
100 | * @param Config $config
101 | * @param bool $append if true it appends the content instead of replacing it
102 | * @return array|bool metadata of false if the operation failed
103 | */
104 | private function upload(string $path, string $contents, Config $config ,$append = false) {
105 | $args = ['arg' => "/{$path}", 'create' => 'true'];
106 |
107 | if ($append) {
108 | $meta = $this->getMetadata($path);
109 | $args['offset'] = $meta['size'];
110 | } else $args['truncate'] = 'true';
111 |
112 | $mode = in_array($config->get('visibility'), ['public', 'private']) ? $this->permissions['file'][$config->get('visibility')] : $this->permissions['file']['public'];
113 |
114 | $response = $this->callAPI('/files/write', $args, new MultipartData($contents, $path, $mode));
115 |
116 | if ($response != '') return false; // On error return false
117 |
118 | return $this->getMetadata($path);
119 | }
120 |
121 | /**
122 | * downloads a file via the IPFS API
123 | *
124 | * @param string $path path of the file
125 | * @return bool|string returns contents of files or false if it failed
126 | */
127 | private function download(string $path) {
128 | return $this->callAPI('/files/read', ['arg' => "/$path"]);
129 | }
130 |
131 | /**
132 | * {@inheritdoc}
133 | */
134 | public function has($path) {
135 | return $this->getMetadata($path) === false ? false : true;
136 | }
137 |
138 | /**
139 | * {@inheritdoc}
140 | */
141 | public function read($path) {
142 | $response = $this->download($path);
143 | return ['type' => 'file', 'path' => $path, 'contents' => $response]; //TODO: handle "file not found"
144 | }
145 |
146 | /**
147 | * {@inheritdoc}
148 | */
149 | public function readStream($path) {
150 | $response = $this->download($path);
151 | return ['type' => 'file', 'path' => $path, 'stream' => $response]; //TODO: handle "file not found"
152 | }
153 |
154 | /**
155 | * {@inheritdoc}
156 | */
157 | public function listContents($directory = '', $recursive = false) {
158 | $result = [];
159 | $response = json_decode($this->callAPI('/files/ls', ['arg' => "/$directory"]), true);
160 | foreach ($response['Entries'] as $e) $result[] = $this->normalizeFile($e, $directory);
161 | return $result;
162 | }
163 |
164 | /**
165 | * {@inheritdoc}
166 | */
167 | public function getMetadata($path) {
168 | $response = json_decode($this->callAPI('/files/stat', ['arg' => "/$path"]), true);
169 | if (isset($response['Message'])) return false;
170 | $response['Name'] = $path;
171 | return $this->normalizeFile($response);
172 | }
173 |
174 | /**
175 | * {@inheritdoc}
176 | */
177 | public function getSize($path) {
178 | return $this->getMetadata($path);
179 | }
180 |
181 | public function getMimetype($path) {
182 | //TODO
183 | }
184 |
185 | /**
186 | * {@inheritdoc}
187 | */
188 | public function getTimestamp($path) {
189 | return $this->getMetadata($path);
190 | }
191 |
192 | public function getVisibility($path) {
193 | return $this->getMetadata($path);
194 | }
195 |
196 | /**
197 | * {@inheritdoc}
198 | */
199 | public function write($path, $contents, Config $config) {
200 | return $this->upload($path, $contents, $config);
201 | }
202 |
203 | /**
204 | * {@inheritdoc}
205 | */
206 | public function writeStream($path, $resource, Config $config) {
207 | return $this->upload($path, stream_get_contents($resource), $config);
208 | }
209 |
210 | /**
211 | * {@inheritdoc}
212 | */
213 | public function update($path, $contents, Config $config) {
214 | return $this->upload($path, $contents, $config, true);
215 | }
216 |
217 | /**
218 | * {@inheritdoc}
219 | */
220 | public function updateStream($path, $resource, Config $config) {
221 | return $this->upload($path, stream_get_contents($resource), $config, true);
222 | }
223 |
224 | /**
225 | * {@inheritdoc}
226 | */
227 | public function rename($path, $newpath) {
228 | $args = '?arg=' . urlencode("/{$path}") . '&arg=' . urlencode("/{$newpath}");
229 | $response = $this->callAPI('/files/mv' . $args);
230 | return $response == '';
231 | }
232 |
233 | /**
234 | * {@inheritdoc}
235 | */
236 | public function copy($path, $newpath) {
237 | $args = '?arg=' . urlencode("/{$path}") . '&arg=' . urlencode("/{$newpath}");
238 | $response = $this->callAPI('/files/cp' . $args);
239 | return $response == '';
240 | }
241 |
242 | /**
243 | * {@inheritdoc}
244 | */
245 | public function delete($path) {
246 | $response = $this->callAPI('/files/rm', ['arg' => "/$path"]);
247 | return $response == '';
248 | }
249 |
250 | /**
251 | * {@inheritdoc}
252 | */
253 | public function deleteDir($dirname) {
254 | return $this->delete($dirname);
255 | }
256 |
257 | /**
258 | * {@inheritdoc}
259 | */
260 | public function createDir($dirname, Config $config) {
261 | return $this->mkdir($dirname);
262 | }
263 |
264 | public function setVisibility($path, $visibility) {
265 | $mode = $this->permissions[$this->getMetadata($path)['type']][$visibility];
266 | $this->callAPI('/files/chmod', ['arg' => $path, 'mode' => sprintf('%o', $mode)]);
267 | }
268 | }
--------------------------------------------------------------------------------
/lib/Storage/IPFS.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class IPFS extends Flysystem {
15 | use CopyDirectory;
16 |
17 | private $adapter, $api;
18 | protected $root;
19 |
20 | public function __construct($params) {
21 | if (isset($params['host'])) {
22 | $this->root = isset($params['root']) ? "/{$params['root']}" : '/';
23 | $this->api = $params['host'];
24 |
25 | $this->adapter = new Adapter($this->api, $this->root);
26 | $this->buildFlySystem($this->adapter);
27 | } else {
28 | throw new \Exception('Creating \OCA\Files_External_IPFS\IPFS storage failed');
29 | }
30 | }
31 |
32 | public function __destruct() {
33 | }
34 |
35 | /**
36 | * Check for dependencies (as of now none)
37 | *
38 | * @return array|bool array of missing dependencies or true
39 | */
40 | public static function checkDependencies() {
41 | $deps = [];
42 | return count($deps) == 0 ? true : $deps;
43 | }
44 |
45 | public function getId() {
46 | return "IPFS::{$this->api}#{$this->root}";
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/Storage/MultipartData.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class MultipartData {
11 | private $content, $path, $mode, $mtime, $mime, $delimiter, $data, $fields;
12 |
13 | public function __construct($content, string $path, int $mode, int $mtime = null, string $mime = 'application/octet-stream') {
14 | $this->content = $content;
15 | $this->mode = sprintf('0%o', $mode);
16 | $this->mtime = empty($mtime) ? time() : $mtime;
17 | $this->path = $path;
18 | $this->mime = $mime;
19 | $this->delimiter = '-------------' . uniqid();
20 | }
21 |
22 | /**
23 | * @param array $fields
24 | */
25 | public function setFields(array $fields) {
26 | $this->fields = $fields;
27 | }
28 |
29 | /**
30 | * @param $curl
31 | */
32 | public function apply($curl) {
33 | $this->data = '';
34 |
35 | // populate normal fields
36 | foreach ($this->fields as $name => $content) {
37 | $this->data .= "--{$this->delimiter}\r\n";
38 | $this->data .= "Content-Disposition: form-data; name=\"{$name}\"\r\n{$content}\r\n\r\n";
39 | }
40 |
41 | // populate file field
42 | $this->data .= "--" . $this->delimiter . "\r\n";
43 | $this->data .= "Content-Disposition: form-data; name=\"file\"; filename=\"{$this->path}\"\r\n";
44 | $this->data .= "Content-Type: {$this->mime}\r\n";
45 | $this->data .= "mode: {$this->mode}\r\n";
46 | $this->data .= "mtime: {$this->mtime}\r\n";
47 | $this->data .= $this->content . "\r\n";
48 |
49 | // last delimiter
50 | $this->data .= "--" . $this->delimiter . "--\r\n";
51 |
52 | // Add data to curl request
53 | curl_setopt($curl, CURLOPT_HTTPHEADER, [
54 | "Content-Type: multipart/form-data; boundary={$this->delimiter}",
55 | 'Content-Length: ' . strlen($this->data)
56 | ]);
57 | curl_setopt($curl, CURLOPT_POSTFIELDS, $this->data);
58 | }
59 | }
--------------------------------------------------------------------------------
/phpunit.integration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ./tests/Integration
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ./tests/Unit
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/Integration/AppTest.php:
--------------------------------------------------------------------------------
1 | container = $app->getContainer();
22 | }
23 |
24 | public function testAppInstalled() {
25 | $appManager = $this->container->query('OCP\App\IAppManager');
26 | $this->assertTrue($appManager->isInstalled('files_external_ipfs'));
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/tests/Unit/Controller/PageControllerTest.php:
--------------------------------------------------------------------------------
1 | getMockBuilder('OCP\IRequest')->getMock();
18 |
19 | $this->controller = new PageController(
20 | 'filesipfs', $request, $this->userId
21 | );
22 | }
23 |
24 | public function testIndex() {
25 | $result = $this->controller->index();
26 |
27 | $this->assertEquals('index', $result->getTemplateName());
28 | $this->assertTrue($result instanceof TemplateResponse);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/tests/bootstrap.php:
--------------------------------------------------------------------------------
1 | addValidRoot(OC::$SERVERROOT . '/tests');
11 |
12 | // Fix for "Autoload path not allowed: .../filesipfs/tests/testcase.php"
13 | \OC_App::loadApp('files_external_ipfs');
14 |
15 | if(!class_exists('PHPUnit_Framework_TestCase')) {
16 | require_once('PHPUnit/Autoload.php');
17 | }
18 |
19 | OC_Hook::clear();
20 |
--------------------------------------------------------------------------------