89 Commits

Author SHA1 Message Date
William MARTIN
d7857c5126 Rename the migration script 2011-06-10 09:25:17 +02:00
William MARTIN
06c57f7da6 Set the SQL type to VARCHAR(32)
Process the md5 of each file during the migrationUpdate all IDF_Upload object to process their md5 during the migration
2011-05-31 14:53:44 +02:00
William MARTIN
4d5418a601 Fix migration methods name 2011-05-31 14:01:39 +02:00
William MARTIN
95cc7f627f Process a md5 on the uploaded file, and display it in the per file view.
- The uploader can check that the uploaded file is correct
- The downloader can check his download too
2011-05-31 13:58:12 +02:00
William MARTIN
b9407f6aee Add some nobr, to keep the text formated when the message is long 2011-05-31 11:06:39 +02:00
Thomas Keller
d079838818 Improve a translation 2011-05-28 01:36:25 +02:00
Thomas Keller
81ce4688df Let the SVN command line client not store the login credentials we give him. 2011-05-28 01:05:10 +02:00
Thomas Keller
ee33cc1832 Address files by name rather than ID in the downloads section (issue 686) 2011-05-28 00:48:24 +02:00
Thomas Keller
82bb18fe10 Merge branch 'release-1.1' into develop 2011-05-26 10:51:16 +02:00
Thomas Keller
8987ca7db6 Timezone always comes last 2011-05-26 10:46:12 +02:00
Thomas Keller
8066fd8982 Start 1.1.3 development 2011-05-26 10:46:00 +02:00
William MARTIN
a96d8c05a7 Update the NEWS file and set the version number 2011-05-26 09:57:05 +02:00
William MARTIN
4238a5dd50 Update PO file from transifex 2011-05-26 09:56:25 +02:00
William MARTIN
94da55d15e Fix tags extraction from git repository (issue 675) 2011-05-26 09:56:04 +02:00
Thomas Keller
09979b8551 Rewrite log parsing in Mercurial and fix whitespace bugs on the way:
- tags and branches with spaces are now properly parsed (issue 663)
- use --style instead of --template option of hg to include much more
  output for the log command; use that to query the parent revisions of
  a revision (if any) and also to query the actual changes of a revision
- make the log parser much more robust towards changes in the "header"
  of the log output
2011-05-25 23:26:14 +02:00
Thomas Keller
5b82efa0be Fix a couple of issues with our key parsing / validating code.
- be explicit and expect only ssh-dss or ssh-rsa keys
- allow any character (even line breaks and whitespace) in the optional comment,
  but shrink all of them to simple spaces (fixes issue 679)
- test the newly uploaded key against existing keys only by the base key data,
  not the fully uploaded string (that might contain a changed comment line or
  the like) to avoid duplicates; also only check the keys of the user for
  duplicates, not all existing keys in the forge (if for whatever reason two
  user accounts share a key)
2011-05-25 02:13:50 +02:00
Thomas Keller
8502a36481 Mark two new strings in the latest updates view for translation;
prettify the RSS icon display somewhat.
2011-05-16 23:49:08 +02:00
Thomas Keller
be4774c95c Mark two strings for translation. 2011-05-06 14:04:08 +02:00
William MARTIN
bbf1a1882a Fix issue 671 : Update the SSH Key preg pattern 2011-05-04 11:24:05 +02:00
William MARTIN
9644784a79 Merge branch 'develop' of projects.ceondo.com:indefero into develop 2011-05-04 11:22:50 +02:00
William MARTIN
1940d5c0b5 Fix issue 671 : Update the SSH Key preg pattern 2011-05-04 11:22:24 +02:00
Thomas Keller
7c7e3cd1f1 Rework idf.php-dist a bit more:
- move "Binary section" into "Path section"
- make individual sections more prominent and therefor
  easier to grasp / scan for
- fix the language and expand the explanations for a
  couple of items
- remove the 'debug_scm' configuration variable
  (it is used nowhere in the source and just confuses people)
- update the copyright
2011-04-28 23:53:15 +02:00
William MARTIN
3e2f95a152 Break too long line
Add space between section
2011-04-28 15:43:09 +02:00
William MARTIN
92de88ba13 Rewrite of the idf.php-dist file
- Add example for each mail and cache backend
- Add major part of option use in each Scm backend with description
2011-04-28 15:12:00 +02:00
Thomas Keller
5322cdf609 Fix an URL in the RSS feed 2011-04-27 15:25:18 +02:00
William MARTIN
02d0f0923e Update the NEWS files 2011-04-27 15:09:04 +02:00
Thomas Keller
765a86ba90 Fix an URL in the RSS feed 2011-04-27 15:01:34 +02:00
William MARTIN
34309e34c3 Enhancement visibility of the RSS feed in the timeline view 2011-04-27 14:39:39 +02:00
Thomas Keller
2176d1cde2 Merge branch 'develop' of projects.ceondo.com:indefero into develop 2011-04-27 00:08:10 +02:00
Thomas Keller
45d53e8d21 Merge branch 'feature.better-home' into develop 2011-04-27 00:07:40 +02:00
Thomas Keller
b36b8e3afb Final adjustions to the project logo code
- remove the question mark from the default logo for simplification,
  add a soft drop shadow to make the logo more visible on not so light
  backgrounds
- display the project logo and the lock icon in the project list dropdown
- re-position the project title and display the lock icon (if needed)
  on top of the main logo
The code now works best with uploaded logos of 32x32px^2; smaller logos
will be downsampled and repositioned on a best breed basis.
2011-04-27 00:03:44 +02:00
Thomas Keller
801af66a4e Apparently header() does kind of work for php-cli, but of course breaks horribly.
Luckily Pluf has a little knob (IN_UNIT_TESTS) that can prevent this breakage.
2011-04-19 11:07:58 +02:00
Thomas Keller
df6ffdf420 Three more test cases for the mtn interface added
- add tests for getTree(), getChanges() and isCommitLarge()
- anonymize the test data somewhat
- return false instead of null for unknown revisions given to getChanges()
2011-04-15 00:54:11 +02:00
Thomas Keller
b3368071ac Continue with the mtn interface tests
- test getRepositorySize() with a test file
- implement tests for inTags(), inBranches(), getFile(),
  getCommit() and getExtraProperties()
- mark the static methods as untestable
2011-04-14 00:48:36 +02:00
Thomas Keller
67b80ee11c Continue with the mtn interface tests
- getPathInfo(), disambiguateRevision() and validateRevision() are done
- we no longer need to check / skip a format_version stanza for the extended
  manifest (there is no such stanza outputted)
2011-04-12 23:47:44 +02:00
William MARTIN
dc31155de1 Second pass of code review 2011-04-11 15:37:40 +02:00
Thomas Keller
0bae69908b Spelling 2011-04-07 22:40:32 +02:00
Thomas Keller
47a077bc82 Merge branch 'feature.better-home' of projects.ceondo.com:indefero into feature.better-home 2011-04-07 22:38:40 +02:00
William MARTIN
836ff71364 Update code to fix thomas review's 2011-04-06 15:33:26 +02:00
William MARTIN
0afa07b2bd Merge branch 'develop' of projects.ceondo.com:indefero into develop 2011-04-06 12:01:04 +02:00
William MARTIN
4ee3d471fe Update the form validation of IDF_Form_ReviewFileComment.
Now we can add a general comment without per file comment.
2011-04-06 12:00:55 +02:00
Thomas Keller
29c7fed81b Merge branch 'develop' of git://projects.ceondo.com/indefero into develop 2011-04-06 03:01:40 +02:00
Thomas Keller
fb62061e5a Started with a unit test for the monotone interface.
Main test infrastructure is there, still lots of functionality left
for testing. Fixed a possible bug in the SCM interface already:
Pluf_HTTP_Response_NotFound needs a request instance as ctor argument,
which we don't have at this point, therefor we just throw an exception.
2011-04-06 02:59:26 +02:00
William MARTIN
9b92b7139f Fix copyright 2011-04-05 13:20:55 +02:00
William MARTIN
5ea4b02205 Update copyrigt 2011-04-02 21:37:07 +02:00
Thomas Keller
12d3eef3d1 monotone actually requires interface_version 13.0 or higher because of the extended manifest usage 2011-04-02 15:40:18 +02:00
Thomas Keller
576c06ffaf Merge branch 'feature.better-home' of git://projects.ceondo.com/indefero into feature.better-home 2011-04-02 00:17:51 +02:00
William MARTIN
352dc3e179 Add IDF_Form_ProjectConf
Update template
2011-04-01 16:05:32 +02:00
William MARTIN
aa164936f4 Remove commented code 2011-04-01 14:19:07 +02:00
William MARTIN
9a93acd1a5 Update the admin template 2011-04-01 14:17:56 +02:00
William MARTIN
587aa11cda Update the index template 2011-04-01 14:14:30 +02:00
William MARTIN
d04ecd60c4 Add default logo for project without one 2011-04-01 14:13:42 +02:00
Thomas Keller
ecef510f78 Merge branch 'develop' of projects.ceondo.com:indefero into develop 2011-04-01 11:18:01 +02:00
Thomas Keller
4976c20935 Its validateRevision, not isValidRevision, here as well 2011-04-01 11:17:21 +02:00
Thomas Keller
5553c37ccd Merge branch 'release-1.1' into develop 2011-04-01 11:17:06 +02:00
Thomas Keller
346b2c6cf8 Call validateRevision(), not isValidRevision(), fixes issue 657 2011-04-01 11:15:13 +02:00
Thomas Keller
aa68fe3485 Note fix for issue 655. 2011-03-30 00:19:18 +02:00
Thomas Keller
e408fe8733 Make the function static again; this change silently slipped through. 2011-03-30 00:17:35 +02:00
Thomas Keller
836986462a Add Stewart to AUTHORS. 2011-03-30 00:13:50 +02:00
Stewart Platt
51c6cdb20d Only display those filter options for items the user actually has access to
(fixes issue 655)
2011-03-30 00:12:07 +02:00
Thomas Keller
766232f29b Add missing license header. 2011-03-30 00:00:22 +02:00
Thomas Keller
2ed021f30b Merge branch 'develop' of projects.ceondo.com:indefero into develop 2011-03-28 18:00:23 +02:00
Thomas Keller
899fe561df Merge branch 'release-1.1' into develop 2011-03-28 17:59:08 +02:00
Thomas Keller
67d8936083 Start 1.1.2 development 2011-03-28 17:57:15 +02:00
Thomas Keller
78f5cef5bd Enter a release date (i.e. release) 1.1.1 2011-03-28 17:52:53 +02:00
Fernando Sayago Gil
8928b1654c One new string translated. 2011-03-28 17:46:08 +02:00
William MARTIN
977fa0d1d4 Translate a new string. 2011-03-28 12:46:06 +02:00
Thomas Keller
1d89cec2cf Merge branch 'release-1.1' into develop 2011-03-28 01:26:20 +02:00
Thomas Keller
6c6b7d6bb2 Bump to 1.1.1 (not released yet, though) 2011-03-28 01:21:10 +02:00
Thomas Keller
f92e88e9b4 Note the recent fixes 2011-03-28 01:20:54 +02:00
Thomas Keller
6e58899fdf Add the new string to idf.pot and update the German translation
accordingly.
2011-03-28 01:15:22 +02:00
Thomas Keller
1513598420 Add a short sentence about password recovery on the registration page
(fixes issue 652)
2011-03-28 01:13:15 +02:00
Thomas Keller
9cfc060760 Improve a translation. 2011-03-28 00:56:44 +02:00
Patrick Georgi
a531e34ec2 Add IDF_EmailAddress to backup 2011-03-25 20:39:11 +01:00
Jean-Philippe Fleury
2cce23b5b4 Fix a typo in the French translation and add myself to AUTHORS. 2011-03-25 13:17:49 +01:00
Sindre Myren
e518bc9b68 Updated gitserve.py to work with python 3.x 2011-03-25 11:08:18 +01:00
Thomas Keller
8e02d05ba9 Notice the fix of issue 643 in NEWS 2011-03-25 00:53:12 +01:00
Thomas Keller
f131083315 Skip linking to a non-existing diff section for changed binary files
(fixes issue 643)
2011-03-25 00:45:06 +01:00
Thomas Keller
39ba5b37ef Ignore a couple of files for code coverage that should not be covered;
add a simle run-tests script that steals some code from photon to
return the code coverage at the end of the test execution
(we're only at about 8% - lots of work left...)
2011-03-25 00:29:50 +01:00
Thomas Keller
002fa05c7f Merge branch 'release-1.1' into develop 2011-03-25 00:14:26 +01:00
Thomas Keller
1a52133fd4 getArchiveStream() should actually be public (issue 648) 2011-03-25 00:11:44 +01:00
Thomas Keller
30900f7196 monotone zip archive entries now all carry the revision date as mtime (issue 645);
add a test case for the zip render response that works with and without PHP's
zip extension
2011-03-24 23:54:52 +01:00
Thomas Keller
b753cf0837 Fix a coment. 2011-03-24 01:19:05 +01:00
Thomas Keller
53ab5b6aff Expand the bootstrap script to setup an empty IDF environment. 2011-03-24 00:41:22 +01:00
Thomas Keller
78a0402351 Prepare the Stdio class for easier testing.
- create an interface that describes the basic methods
- let the real stdio class implement this interface
- inject the stdio instance into IDF_Scm_Monotone and do not
  create it in the constructor
- ensure in IDF_Scm_Monotone_ZipRender that we get the proper
  constructor arguments
On a slighly unrelated note, make _getAuthOptions() in the stdio
implementation private.
2011-03-23 00:47:17 +01:00
Thomas Keller
5b5705fe90 Add a unit test for monotone's basicio parser and compiler.
Also note a couple of quirks and be less strict (for now) when it
comes to hash parsing and stanza lines without values.
2011-03-23 00:26:26 +01:00
Thomas Keller
f08b5c5e3f Note syncmonotone.mdtext in INSTALL.mdtext 2011-03-20 14:19:53 +01:00
Thomas Keller
aa87acd432 Start 1.2 development. 2011-03-20 13:48:49 +01:00
Thomas Keller
7af7ef8357 Merge branch 'release-1.1' into develop 2011-03-20 13:46:45 +01:00
177 changed files with 10666 additions and 7852 deletions

3
.gitignore vendored
View File

@@ -9,3 +9,6 @@ indefero-*.zip
src/IDF/conf/path.php src/IDF/conf/path.php
.tx/config .tx/config
src/IDF/locale/idf.pot.bak src/IDF/locale/idf.pot.bak
test/test.db
test/tmp
test/config.php

View File

@@ -18,6 +18,7 @@ Much appreciated contributors (in alphabetical order):
Fernando Sayago Gil <mikados.mikados@gmail.com> - Spanish translation Fernando Sayago Gil <mikados.mikados@gmail.com> - Spanish translation
Jakub Viták <mainiak@gmail.com> - Czech translation Jakub Viták <mainiak@gmail.com> - Czech translation
Janez Troha <http://www.dz0ny.info> - Slovenian translation Janez Troha <http://www.dz0ny.info> - Slovenian translation
Jean-Philippe Fleury <jpfleury>
Jerry <lxb429@gmail.com> - Chinese translation Jerry <lxb429@gmail.com> - Chinese translation
Julien Issler <julien@issler.net> Julien Issler <julien@issler.net>
Ludovic Bellière <xrogaan> Ludovic Bellière <xrogaan>
@@ -30,6 +31,7 @@ Much appreciated contributors (in alphabetical order):
Raphaël Emourgeon <raphael> Raphaël Emourgeon <raphael>
Samuel Suther <info@suther.de> - German translation Samuel Suther <info@suther.de> - German translation
Sindre R. Myren <sindrero@stud.ntnu.no> Sindre R. Myren <sindrero@stud.ntnu.no>
Stewart Platt <stew@futurete.ch>
Thomas Keller <me@thomaskeller.biz> - Monotone support Thomas Keller <me@thomaskeller.biz> - Monotone support
Vladimir Solomatin <slash> Vladimir Solomatin <slash>
William Martin <william.martin@lcpc.fr> William Martin <william.martin@lcpc.fr>

View File

@@ -4,6 +4,12 @@ The installation of InDefero is composed of 2 parts, first the
installation of the [Pluf framework](http://www.pluf.org) and second, installation of the [Pluf framework](http://www.pluf.org) and second,
the installation of InDefero by itself. the installation of InDefero by itself.
## PHP modules for indefero
Indefero need the GD module for PHP. It's named "php5-gd" in debian.
$ apt-get install php5-gd
## Recommended Layout of the Files ## Recommended Layout of the Files
If your server document root is in `/var/www` a good thing is to keep If your server document root is in `/var/www` a good thing is to keep
@@ -126,6 +132,7 @@ The documentation is available in the `doc` folder.
* Subversion: `doc/syncsvn.mdtext`. * Subversion: `doc/syncsvn.mdtext`.
* Mercurial: `doc/syncmercurial.mdtext`. * Mercurial: `doc/syncmercurial.mdtext`.
* Git: `doc/syncgit.mdtext`. * Git: `doc/syncgit.mdtext`.
* Monotone: `doc/syncmonotone.mdtext`
## For the Apache Webserver Users ## For the Apache Webserver Users

View File

@@ -1,3 +1,47 @@
# InDefero 1.2 - xxx xxx xx xx:xx 2011 UTC
## New Features
- Mercurial source views now show parent revisions (if any) and detailed change information
- File download URLs now contain the file name rather than the upload id; old links still work though (issue 686)
## Bugfixes
- monotone zip archive entries now all carry the revision date as mtime (issue 645)
- Timeline only displays filter options for items a user has actually access to (issue 655)
- The log, tags and branches parsers for Mercurial are more robust now (issue 663)
- Fix SSH public key parsing issues and improve the check for existing, uploaded keys (issue 679)
- Let the SVN command line client not store the login credentials we give him as arguments
## Documentation
## Translations
# InDefero 1.1.2 - Thu May 26 07:42:25 2011 UTC
## Bugfixes
- Fix tags extraction from git repository (issue 675)
- Fix SSH validation method (issue 671)
- Fix malformed URL in the RSS (issue 666)
- Fix validateRevision call for Mercurial Scm (issue 657)
## Translations
- Missing word in French translation (issue 672)
- Update Spanish translation
# InDefero 1.1.1 - Mon Mar 28 15:52 2011 UTC
## Bugfixes
- Fix an incompatibility with Python 3.1 in gitserve.py (issue 554)
- Fix PHP error when the commit view shows a commit with changed binary files (issue 643)
- A migration problem prevented the preferences page being displayed properly (issues 644 and 653)
- Fix PHP error when trying to create Mercurial source archives (issue 648)
- Improve the French translation (issue 651)
- Registration page missed a link to password recovery that was mentioned in a form error (issue 652)
# InDefero 1.1 - Sun Mar 20 11:44 2011 UTC # InDefero 1.1 - Sun Mar 20 11:44 2011 UTC
## New Features ## New Features

173
logo/no_logo.svg Normal file
View File

@@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="no_logo.svg"
inkscape:version="0.47 r22583"
id="svg2985"
height="32"
width="32"
version="1.1"
inkscape:export-filename="/Users/tommyd/Entwicklung/indefero/www/media/idf/img/no_logo.png"
inkscape:export-xdpi="89.989998"
inkscape:export-ydpi="89.989998">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1440"
inkscape:window-height="852"
id="namedview9"
showgrid="false"
inkscape:zoom="16.0625"
inkscape:cx="8.5507561"
inkscape:cy="16.122403"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="g2847"
showguides="true"
inkscape:guide-bbox="true">
<sodipodi:guide
orientation="1,0"
position="16,25.836575"
id="guide3752" />
<sodipodi:guide
orientation="0,1"
position="-18.677042,16"
id="guide3754" />
</sodipodi:namedview>
<defs
id="defs2987">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 16 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="32 : 16 : 1"
inkscape:persp3d-origin="16 : 10.666667 : 1"
id="perspective13" />
<inkscape:perspective
id="perspective2863"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3676"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3717"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<filter
inkscape:collect="always"
id="filter3816"
x="-0.14434362"
width="1.2886872"
y="-0.11562817"
height="1.2312563">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.1799243"
id="feGaussianBlur3818" />
</filter>
</defs>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="shadow"
style="display:inline"
sodipodi:insensitive="true">
<g
transform="translate(0.44042901,0.78704792)"
id="g2847-8"
style="opacity:0.79710143;fill:#000000;stroke:#000000;stroke-opacity:1;filter:url(#filter3816)">
<g
id="g3838-0"
style="fill:#000000;stroke:#000000;stroke-opacity:1" />
<g
id="g2401-2"
transform="matrix(0.21219597,0,0,0.21219597,-70.751966,-27.73328)"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:export-filename="/home/loa/Projects/indefero/logo/powered-by-indefero.png"
inkscape:export-xdpi="12.330909"
inkscape:export-ydpi="12.330909">
<path
id="path2383-4"
d="m 396.19089,173.14471 c -7.67621,0.80661 -14.40195,5.39406 -19.58101,10.89131 -7.23597,7.88004 -11.69742,18.07908 -13.32198,28.60362 -1.7236,11.28173 -0.25925,23.20635 5.07686,33.37271 3.78607,7.24384 9.53161,13.92339 17.29701,16.96772 3.86478,1.53937 8.98362,1.03284 11.67912,-2.41036 2.64357,-3.5671 2.69463,-8.234 2.85756,-12.48867 0.045,-7.61054 -0.54749,-15.25544 0.45618,-22.83193 0.87131,-9.50623 4.03944,-18.56751 6.71612,-27.66851 1.16242,-4.44333 2.25094,-9.02808 1.97499,-13.64988 -0.48817,-4.62476 -3.58059,-9.31042 -8.2964,-10.4067 -1.57489,-0.44882 -3.23412,-0.48948 -4.85845,-0.37931 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
inkscape:connector-curvature="0" />
<path
id="path2391-8"
d="m 433.14691,149.28687 c 7.2059,2.76589 12.51512,8.93778 16.09494,15.58815 4.94991,9.48434 6.61962,20.49058 5.46486,31.07695 -1.25505,11.34342 -5.75582,22.48271 -13.54134,30.92159 -5.53192,6.01709 -12.81048,10.98198 -21.09918,11.91276 -4.13154,0.4866 -8.94486,-1.32748 -10.65734,-5.35104 -1.63027,-4.12976 -0.4717,-8.65084 0.47212,-12.80269 1.92628,-7.36287 4.47721,-14.59393 5.4687,-22.17201 1.61875,-9.40784 0.90381,-18.98034 0.67386,-28.46402 0.0272,-4.59278 0.1624,-9.30303 1.62515,-13.69592 1.66851,-4.34082 5.86829,-8.06645 10.70716,-7.90484 1.63738,-0.0259 3.25061,0.36424 4.79107,0.89107 z"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="logo"
style="display:inline">
<g
id="layer1"
transform="translate(-0.06540759,0.09444087)">
<g
id="g2847">
<g
id="g3838" />
<g
id="g2401"
transform="matrix(0.21219597,0,0,0.21219597,-70.751966,-27.73328)"
style="fill:#e6e6e6;fill-opacity:1;stroke:#a0a0a0;stroke-width:2.4000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:export-filename="/home/loa/Projects/indefero/logo/powered-by-indefero.png"
inkscape:export-xdpi="12.330909"
inkscape:export-ydpi="12.330909">
<path
id="path2383"
d="m 396.19089,173.14471 c -7.67621,0.80661 -14.40195,5.39406 -19.58101,10.89131 -7.23597,7.88004 -11.69742,18.07908 -13.32198,28.60362 -1.7236,11.28173 -0.25925,23.20635 5.07686,33.37271 3.78607,7.24384 9.53161,13.92339 17.29701,16.96772 3.86478,1.53937 8.98362,1.03284 11.67912,-2.41036 2.64357,-3.5671 2.69463,-8.234 2.85756,-12.48867 0.045,-7.61054 -0.54749,-15.25544 0.45618,-22.83193 0.87131,-9.50623 4.03944,-18.56751 6.71612,-27.66851 1.16242,-4.44333 2.25094,-9.02808 1.97499,-13.64988 -0.48817,-4.62476 -3.58059,-9.31042 -8.2964,-10.4067 -1.57489,-0.44882 -3.23412,-0.48948 -4.85845,-0.37931 z"
style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#a0a0a0;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
inkscape:connector-curvature="0" />
<path
id="path2391"
d="m 433.14691,149.28687 c 7.2059,2.76589 12.51512,8.93778 16.09494,15.58815 4.94991,9.48434 6.61962,20.49058 5.46486,31.07695 -1.25505,11.34342 -5.75582,22.48271 -13.54134,30.92159 -5.53192,6.01709 -12.81048,10.98198 -21.09918,11.91276 -4.13154,0.4866 -8.94486,-1.32748 -10.65734,-5.35104 -1.63027,-4.12976 -0.4717,-8.65084 0.47212,-12.80269 1.92628,-7.36287 4.47721,-14.59393 5.4687,-22.17201 1.61875,-9.40784 0.90381,-18.98034 0.67386,-28.46402 0.0272,-4.59278 0.1624,-9.30303 1.62515,-13.69592 1.66851,-4.34082 5.86829,-8.06645 10.70716,-7.90484 1.63738,-0.0259 3.25061,0.36424 4.79107,0.89107 z"
style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#a0a0a0;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -12,4 +12,16 @@
<directory>test/IDF/</directory> <directory>test/IDF/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/IDF</directory>
<exclude>
<directory suffix=".php">src/IDF/Tests</directory>
<directory suffix=".php">src/IDF/conf</directory>
<file>src/IDF/version.php</file>
</exclude>
</whitelist>
</filter>
</phpunit> </phpunit>

14
run-tests Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env php
<?php
$xmlfile = dirname(__FILE__) .'/test/report.xml';
passthru('phpunit --coverage-clover='.$xmlfile);
$xml = simplexml_load_string(file_get_contents($xmlfile));
unlink($xmlfile);
printf(
'>>> code coverage %s/%s (%s%%)'."\n",
$xml->project->metrics['coveredstatements'],
$xml->project->metrics['statements'],
round(($xml->project->metrics['coveredstatements']/(float)$xml->project->metrics['statements']) * 100.0, 2)
);

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -23,14 +23,17 @@
import os import os
import sys import sys
import commands import subprocess
import traceback
SCRIPTDIR = os.path.abspath(__file__).rsplit(os.path.sep, 1)[0]
GITSERVEPHP = '%s/gitserve.php' % SCRIPTDIR
process = subprocess.Popen(['php', GITSERVEPHP, sys.argv[1]],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output = str.encode("\n").join(process.communicate()).strip()
status = process.wait()
n = len("/gitserve.py")
GITSERVEPHP = '%s/gitserve.php' % traceback.extract_stack(limit=1)[0][0][0:-n]
status, output = commands.getstatusoutput('php %s %s' % (GITSERVEPHP, sys.argv[1]))
if status == 0: if status == 0:
os.execvp('git', ['git', 'shell', '-c', output.strip()]) os.execvp('git', ['git', 'shell', '-c', output.strip()])
else: else:
sys.stderr.write("%s\n" % output) sys.stderr.write("%s\n" % output.strip())
sys.exit(1) sys.exit(1)

View File

@@ -4,7 +4,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,19 +3,19 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# Plume Framework is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# Plume Framework is distributed in the hope that it will be useful, # InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -0,0 +1,140 @@
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright(C) 2008-2011 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
/**
* Configuration of the project.
*/
class IDF_Form_ProjectConf extends Pluf_Form
{
public $project = null;
public function initFields($extra=array())
{
$this->project = $extra['project'];
// Basic part
$this->fields['name'] = new Pluf_Form_Field_Varchar(array('required' => true,
'label' => __('Name'),
'initial' => $this->project->name,
));
$this->fields['shortdesc'] = new Pluf_Form_Field_Varchar(array('required' => true,
'label' => __('Short Description'),
'initial' => $this->project->shortdesc,
'widget_attrs' => array('size' => '68'),
));
$this->fields['description'] = new Pluf_Form_Field_Varchar(array('required' => true,
'label' => __('Description'),
'initial' => $this->project->description,
'widget_attrs' => array('cols' => 68,
'rows' => 26,
),
'widget' => 'Pluf_Form_Widget_TextareaInput',
));
// Logo part
$upload_path = Pluf::f('upload_path', false);
if (false === $upload_path) {
throw new Pluf_Exception_SettingError(__('The "upload_path" configuration variable was not set.'));
}
$upload_path .= '/' . $this->project->shortname;
$filename = '/%s';
$this->fields['logo'] = new Pluf_Form_Field_File(array('required' => false,
'label' => __('Update the logo'),
'initial' => '',
'help_text' => __('The logo must be a picture with a size of 32 by 32.'),
'max_size' => Pluf::f('max_upload_size', 5 * 1024),
'move_function_params' =>
array('upload_path' => $upload_path,
'upload_path_create' => true,
'file_name' => $filename,
)
));
$this->fields['logo_remove'] = new Pluf_Form_Field_Boolean(array('required' => false,
'label' => __('Remove the current logo'),
'initial' => false,
'widget' => 'Pluf_Form_Widget_CheckboxInput',
));
}
/**
* If we have uploaded a file, but the form failed remove it.
*
*/
function failed()
{
if (!empty($this->cleaned_data['logo'])
&& file_exists(Pluf::f('upload_path').'/'.$this->cleaned_data['logo'])) {
unlink(Pluf::f('upload_path').'/'.$this->cleaned_data['logo']);
}
}
public function clean()
{
if (!isset($this->cleaned_data['logo_remove'])) {
$this->cleaned_data['logo_remove'] = false;
}
return $this->cleaned_data;
}
public function clean_logo()
{
if (empty($this->cleaned_data['logo'])) {
return '';
}
$meta = getimagesize(Pluf::f('upload_path') . '/' . $this->project->shortname . $this->cleaned_data['logo']);
if ($meta === false) {
throw new Pluf_Form_Invalid(__('Could not determine the size of the uploaded picture.'));
}
if ($meta[0] !== 32 || $meta[1] !== 32) {
throw new Pluf_Form_Invalid(__('The picture must have a size of 32 by 32.'));
}
return $this->cleaned_data['logo'];
}
public function save($commit=true)
{
$conf = $this->project->getConf();
// Basic part
$this->project->name = $this->cleaned_data['name'];
$this->project->shortdesc = $this->cleaned_data['shortdesc'];
$this->project->description = $this->cleaned_data['description'];
$this->project->update();
// Logo part
if ($this->cleaned_data['logo'] !== "") {
$conf->setVal('logo', $this->cleaned_data['logo']);
}
if ($this->cleaned_data['logo_remove'] === true) {
@unlink(Pluf::f('upload_path') . '/' . $this->project->shortname . $conf->getVal('logo'));
$conf->delVal('logo');
}
}
}

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
)); ));
} }
$this->fields['content'] = new Pluf_Form_Field_Varchar( $this->fields['content'] = new Pluf_Form_Field_Varchar(
array('required' => true, array('required' => false,
'label' => __('General comment'), 'label' => __('General comment'),
'initial' => '', 'initial' => '',
'widget' => 'Pluf_Form_Widget_TextareaInput', 'widget' => 'Pluf_Form_Widget_TextareaInput',
@@ -96,24 +96,40 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
*/ */
public function clean() public function clean()
{ {
foreach ($this->files as $filename => $def) { $isOk = false;
if (!empty($this->cleaned_data[md5($filename)])) {
return $this->cleaned_data; foreach($this->files as $filename => $def) {
$this->cleaned_data[md5($filename)] = trim($this->cleaned_data[md5($filename)]);
if(!empty($this->cleaned_data[md5($filename)])) {
$isOk = true;
} }
} }
throw new Pluf_Form_Invalid(__('You need to provide comments on at least one file.'));
if(!empty($this->cleaned_data['content'])) {
$isOk = true;
}
if (!$isOk) {
throw new Pluf_Form_Invalid(__('You need to provide your general comment about the proposal, or comments on at least one file.'));
}
return $this->cleaned_data;
} }
function clean_content() function clean_content()
{ {
$content = trim($this->cleaned_data['content']); $content = trim($this->cleaned_data['content']);
if (!$this->show_full and strlen($content) == 0) { if(empty($content)) {
throw new Pluf_Form_Invalid(__('You need to provide your general comment about the proposal.')); if ($this->fields['status']->initial != $this->fields['status']->value) {
return __('The status have been updated.');
}
} else {
return $content;
} }
return $content;
throw new Pluf_Form_Invalid(__('This field is required.'));
} }
/** /**
* Save the model in the database. * Save the model in the database.
* *

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -317,8 +317,15 @@ class IDF_Form_UserAccount extends Pluf_Form
return ''; return '';
} }
if (preg_match('#^ssh\-[a-z]{3}\s\S+(\s\S+)?$#', $key)) { $keysearch = '';
$key = str_replace(array("\n", "\r"), '', $key); if (preg_match('#^(ssh\-(?:dss|rsa)\s+\S+)(.*)#', $key, $m)) {
$basekey = preg_replace('/\s+/', ' ', $m[1]);
$comment = trim(preg_replace('/[\r\n]/', ' ', $m[2]));
$keysearch = $basekey.'%';
$key = $basekey;
if (!empty($comment))
$key .= ' '.$comment;
if (Pluf::f('idf_strong_key_check', false)) { if (Pluf::f('idf_strong_key_check', false)) {
@@ -337,7 +344,9 @@ class IDF_Form_UserAccount extends Pluf_Form
} }
} }
} }
else if (preg_match('#^\[pubkey [^\]]+\]\s*\S+\s*\[end\]$#', $key)) { else if (preg_match('#^\[pubkey [^\]]+\]\s*(\S+)\s*\[end\]$#', $key, $m)) {
$keysearch = '%'.$m[1].'%';
if (Pluf::f('idf_strong_key_check', false)) { if (Pluf::f('idf_strong_key_check', false)) {
// if monotone can read it, it should be valid // if monotone can read it, it should be valid
@@ -367,7 +376,7 @@ class IDF_Form_UserAccount extends Pluf_Form
if ($user) { if ($user) {
$ruser = Pluf::factory('Pluf_User', $user); $ruser = Pluf::factory('Pluf_User', $user);
if ($ruser->id > 0) { if ($ruser->id > 0) {
$sql = new Pluf_SQL('content=%s', array($key)); $sql = new Pluf_SQL('content LIKE %s AND user=%s', array($keysearch, $ruser->id));
$keys = Pluf::factory('IDF_Key')->getList(array('filter' => $sql->gen())); $keys = Pluf::factory('IDF_Key')->getList(array('filter' => $sql->gen()));
if (count($keys) > 0) { if (count($keys) > 0) {
throw new Pluf_Form_Invalid( throw new Pluf_Form_Invalid(

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -80,7 +80,10 @@ class IDF_Key extends Pluf_Model
if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) { if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) {
return array('mtn', $m[1], $m[2]); return array('mtn', $m[1], $m[2]);
} }
else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S+))?$#', $this->content, $m)) { else if (preg_match('#^ssh\-(?:dss|rsa)\s(\S+)(?:\s(.*))?$#', $this->content, $m)) {
if (!isset($m[2])) {
$m[2] = "";
}
return array('ssh', $m[2], $m[1]); return array('ssh', $m[2], $m[1]);
} }

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -0,0 +1,63 @@
<?php
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
#
# InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
/**
* Add the md5 column for the download model.
*/
function IDF_Migrations_18DownloadMD5_up($params=null)
{
// Add the row
$table = Pluf::factory('IDF_Upload')->getSqlTable();
$sql = array();
$sql['PostgreSQL'] = 'ALTER TABLE '.$table.' ADD COLUMN "md5" VARCHAR(32) DEFAULT \'\'';
$sql['MySQL'] = 'ALTER TABLE '.$table.' ADD COLUMN `md5` VARCHAR(32) DEFAULT \'\'';
$db = Pluf::db();
$engine = Pluf::f('db_engine');
if (!isset($sql[$engine])) {
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
// Process md5 of already uploaded file
$files = Pluf::factory('IDF_Upload')->getList();
foreach ($files as $f) {
$f->md5 = md5_file (Pluf::f('upload_path') . '/' . $f->get_project()->shortname . '/files/' . $f->file);
$f->update();
}
}
function IDF_Migrations_18DownloadMD5_down($params=null)
{
// Remove the row
$table = Pluf::factory('IDF_Upload')->getSqlTable();
$sql = array();
$sql['PostgreSQL'] = 'ALTER TABLE '.$table.' DROP COLUMN "md5"';
$sql['MySQL'] = 'ALTER TABLE '.$table.' DROP COLUMN `md5`';
$db = Pluf::db();
$engine = Pluf::f('db_engine');
if (!isset($sql[$engine])) {
throw new Exception('SQLite complex migration not supported.');
}
$db->execute($sql[$engine]);
}

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -53,6 +53,7 @@ function IDF_Migrations_Backup_run($folder, $name=null)
'IDF_Scm_Cache_Git', 'IDF_Scm_Cache_Git',
'IDF_Queue', 'IDF_Queue',
'IDF_Gconf', 'IDF_Gconf',
'IDF_EmailAddress',
); );
$db = Pluf::db(); $db = Pluf::db();
// Now, for each table, we dump the content in json, this is a // Now, for each table, we dump the content in json, this is a
@@ -98,6 +99,7 @@ function IDF_Migrations_Backup_restore($folder, $name)
'IDF_Scm_Cache_Git', 'IDF_Scm_Cache_Git',
'IDF_Queue', 'IDF_Queue',
'IDF_Gconf', 'IDF_Gconf',
'IDF_EmailAddress',
); );
$db = Pluf::db(); $db = Pluf::db();
$schema = new Pluf_DB_Schema($db); $schema = new Pluf_DB_Schema($db);
@@ -110,4 +112,4 @@ function IDF_Migrations_Backup_restore($folder, $name)
Pluf_Test_Fixture::load($data, false); Pluf_Test_Fixture::load($data, false);
} }
return true; return true;
} }

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -1,6 +1,6 @@
-- ***** BEGIN LICENSE BLOCK ***** -- ***** BEGIN LICENSE BLOCK *****
-- This file is part of InDefero, an open source project management application. -- This file is part of InDefero, an open source project management application.
-- Copyright (C) 2011 Céondo Ltd and contributors. -- Copyright (C) 2008-2011 Céondo Ltd and contributors.
-- Copyright (C) 2010 Thomas Keller <me@thomaskeller.biz> -- Copyright (C) 2010 Thomas Keller <me@thomaskeller.biz>
-- Richard Levitte <richard@levitte.org> -- Richard Levitte <richard@levitte.org>
-- --

View File

@@ -1,6 +1,6 @@
-- ***** BEGIN LICENSE BLOCK ***** -- ***** BEGIN LICENSE BLOCK *****
-- This file is part of InDefero, an open source project management application. -- This file is part of InDefero, an open source project management application.
-- Copyright (C) 2011 Céondo Ltd and contributors. -- Copyright (C) 2008-2011 Céondo Ltd and contributors.
-- --
-- InDefero is free software; you can redistribute it and/or modify -- InDefero is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by -- it under the terms of the GNU General Public License as published by

View File

@@ -1,6 +1,6 @@
-- ***** BEGIN LICENSE BLOCK ***** -- ***** BEGIN LICENSE BLOCK *****
-- This file is part of InDefero, an open source project management application. -- This file is part of InDefero, an open source project management application.
-- Copyright (C) 2011 Céondo Ltd and contributors. -- Copyright (C) 2008-2011 Céondo Ltd and contributors.
-- --
-- InDefero is free software; you can redistribute it and/or modify -- InDefero is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by -- it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -209,7 +209,7 @@ class IDF_Scm_Git extends IDF_Scm
return $this->cache['tags']; return $this->cache['tags'];
} }
$cmd = Pluf::f('idf_exec_cmd_prefix', '') $cmd = Pluf::f('idf_exec_cmd_prefix', '')
.sprintf('GIT_DIR=%s %s for-each-ref --format="%%(taggerdate:iso)%%(committerdate:iso) %%(objectname) %%(refname)" refs/tags', .sprintf('GIT_DIR=%s %s for-each-ref --format="%%(objectname) %%(refname)" refs/tags',
escapeshellarg($this->repo), escapeshellarg($this->repo),
Pluf::f('git_path', 'git')); Pluf::f('git_path', 'git'));
self::exec('IDF_Scm_Git::getTags', $cmd, $out, $return); self::exec('IDF_Scm_Git::getTags', $cmd, $out, $return);
@@ -221,15 +221,12 @@ class IDF_Scm_Git extends IDF_Scm
rsort($out); rsort($out);
$res = array(); $res = array();
foreach ($out as $b) { foreach ($out as $b) {
$elts = explode(' ', $b, 5); $elts = explode(' ', $b, 2);
$tag = substr(trim($elts[4]), 10); $tag = substr(trim($elts[1]), 10); // Remove refs/tags/ prefix
if (false !== strpos($tag, '/')) { $res[$tag] = '';
$res[$elts[3]] = $b;
} else {
$res[$tag] = '';
}
} }
$this->cache['tags'] = $res; $this->cache['tags'] = $res;
return $res; return $res;
} }

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -22,19 +22,77 @@
# ***** END LICENSE BLOCK ***** */ # ***** END LICENSE BLOCK ***** */
/** /**
* Mercurial utils. * A simple RAII helper that manages style files to format hg's log output
*/
class IDF_Scm_Mercurial_LogStyle
{
const FULL_LOG = 1;
const CHANGES = 2;
public function __construct($type)
{
$this->file = tempnam(Pluf::f('tmp_folder'), 'hg-log-style-');
if ($type == self::FULL_LOG) {
$style = 'changeset = "'
. 'changeset: {node|short}\n'
. 'branch: {branch}\n'
. 'author: {author}\n'
. 'date: {date|isodate}\n'
. 'parents: {parents}\n\n'
. '{desc}\n'
. '\0\n"'
. "\n"
. 'parent = "{node|short} "'
. "\n";
} elseif ($type == self::CHANGES) {
$style = 'changeset = "'
. 'file_mods: {file_mods}\n'
. 'file_adds: {file_adds}\n'
. 'file_dels: {file_dels}\n'
. 'file_copies: {file_copies}\n\n'
. '\0\n"'
. "\n"
. 'file_mod = "{file_mod}\0"'
. "\n"
. 'file_add = "{file_add}\0"'
. "\n"
. 'file_del = "{file_del}\0"'
. "\n"
. 'file_copy = "{name}\0{source}\0"'
. "\n";
} else {
throw new IDF_Scm_Exception('invalid type ' . $type);
}
file_put_contents($this->file, $style);
}
public function __destruct()
{
@unlink($this->file);
}
public function get()
{
return $this->file;
}
}
/**
* Main SCM class for Mercurial
* *
* Note: Some commands take a --debug option, this is not lousy coding, but
* totally wanted, as hg returns additional / different data in this
* mode on which this largely depends.
*/ */
class IDF_Scm_Mercurial extends IDF_Scm class IDF_Scm_Mercurial extends IDF_Scm
{ {
protected $hg_log_template;
public function __construct($repo, $project=null) public function __construct($repo, $project=null)
{ {
$this->repo = $repo; $this->repo = $repo;
$this->project = $project; $this->project = $project;
$this->hg_log_template = "'".'changeset: {rev}:{node|short}\nauthor: {author}\ndate: {date|isodate}\nfiles: {files}\n{desc}\n'."'"; }
}
public function getRepositorySize() public function getRepositorySize()
{ {
@@ -94,7 +152,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
escapeshellarg($this->repo), escapeshellarg($this->repo),
escapeshellarg($rev)); escapeshellarg($rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::isValidRevision', $cmd, $out, $ret); self::exec('IDF_Scm_Mercurial::validateRevision', $cmd, $out, $ret);
// FIXME: apparently a given hg revision can also be ambigious - // FIXME: apparently a given hg revision can also be ambigious -
// handle this case here sometime // handle this case here sometime
@@ -158,7 +216,8 @@ class IDF_Scm_Mercurial extends IDF_Scm
throw new Exception(sprintf(__('Not a valid tree: %s.'), $tree)); throw new Exception(sprintf(__('Not a valid tree: %s.'), $tree));
} }
$cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s'; $cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s';
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : ''); $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo),
escapeshellarg($tree));
$out = array(); $out = array();
$res = array(); $res = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
@@ -208,7 +267,8 @@ class IDF_Scm_Mercurial extends IDF_Scm
public function getPathInfo($totest, $commit='tip') public function getPathInfo($totest, $commit='tip')
{ {
$cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s'; $cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s';
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit); $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo),
escapeshellarg($commit));
$out = array(); $out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getPathInfo', $cmd, $out); self::exec('IDF_Scm_Mercurial::getPathInfo', $cmd, $out);
@@ -284,7 +344,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
self::exec('IDF_Scm_Mercurial::getBranches', $cmd, $out); self::exec('IDF_Scm_Mercurial::getBranches', $cmd, $out);
$res = array(); $res = array();
foreach ($out as $b) { foreach ($out as $b) {
preg_match('/(\S+).*\S+:(\S+)/', $b, $match); preg_match('/(.+?)\s+\S+:(\S+)/', $b, $match);
$res[$match[1]] = ''; $res[$match[1]] = '';
} }
$this->cache['branches'] = $res; $this->cache['branches'] = $res;
@@ -308,7 +368,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
self::exec('IDF_Scm_Mercurial::getTags', $cmd, $out); self::exec('IDF_Scm_Mercurial::getTags', $cmd, $out);
$res = array(); $res = array();
foreach ($out as $b) { foreach ($out as $b) {
preg_match('/(\S+).*\S+:(\S+)/', $b, $match); preg_match('/(.+?)\s+\S+:(\S+)/', $b, $match);
$res[$match[1]] = ''; $res[$match[1]] = '';
} }
$this->cache['tags'] = $res; $this->cache['tags'] = $res;
@@ -336,17 +396,18 @@ class IDF_Scm_Mercurial extends IDF_Scm
*/ */
public function getCommit($commit, $getdiff=false) public function getCommit($commit, $getdiff=false)
{ {
if (!$this->isValidRevision($commit)) { if ($this->validateRevision($commit) != IDF_Scm::REVISION_VALID) {
return false; return false;
} }
$logStyle = new IDF_Scm_Mercurial_LogStyle(IDF_Scm_Mercurial_LogStyle::FULL_LOG);
$tmpl = ($getdiff) $tmpl = ($getdiff)
? Pluf::f('hg_path', 'hg').' log -p -r %s -R %s --template %s' ? Pluf::f('hg_path', 'hg').' log --debug -p -r %s -R %s --style %s'
: Pluf::f('hg_path', 'hg').' log -r %s -R %s --template %s'; : Pluf::f('hg_path', 'hg').' log --debug -r %s -R %s --style %s';
$cmd = sprintf($tmpl, $cmd = sprintf($tmpl,
escapeshellarg($commit), escapeshellarg($commit),
escapeshellarg($this->repo), escapeshellarg($this->repo),
$this->hg_log_template); escapeshellarg($logStyle->get()));
$out = array(); $out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out); self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out);
@@ -363,11 +424,62 @@ class IDF_Scm_Mercurial extends IDF_Scm
$log[] = $line; $log[] = $line;
} }
} }
$out = self::parseLog($log, 4); $out = self::parseLog($log);
$out[0]->diff = implode("\n", $change); $out[0]->diff = implode("\n", $change);
return $out[0]; return $out[0];
} }
/**
* @see IDF_Scm::getChanges()
*/
public function getChanges($commit)
{
if ($this->validateRevision($commit) != IDF_Scm::REVISION_VALID) {
return null;
}
$logStyle = new IDF_Scm_Mercurial_LogStyle(IDF_Scm_Mercurial_LogStyle::CHANGES);
$tmpl = Pluf::f('hg_path', 'hg').' log --debug -r %s -R %s --style %s';
$cmd = sprintf($tmpl,
escapeshellarg($commit),
escapeshellarg($this->repo),
escapeshellarg($logStyle->get()));
$out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getChanges', $cmd, $out);
$log = self::parseLog($out);
// we expect only one log entry that contains all the needed information
$log = $log[0];
$return = (object) array(
'additions' => preg_split('/\0/', $log->file_adds, -1, PREG_SPLIT_NO_EMPTY),
'deletions' => preg_split('/\0/', $log->file_dels, -1, PREG_SPLIT_NO_EMPTY),
'patches' => preg_split('/\0/', $log->file_mods, -1, PREG_SPLIT_NO_EMPTY),
// hg has no support for built-in attributes, so this keeps empty
'properties' => array(),
// this is filled below
'renames' => array(),
);
$file_copies = preg_split('/\0/', $log->file_copies, -1, PREG_SPLIT_NO_EMPTY);
// FIXME: copies are only treated as renames if they have an add _and_
// an drop, otherwise they're just treated as adds
for ($i=0; $i<count($file_copies); $i+=2) {
$new = $file_copies[$i];
$old = $file_copies[$i+1];
$newidx = array_search($new, $return->additions);
$oldidx = array_search($old, $return->deletions);
if ($newidx !== false && $oldidx !== false) {
$return->renames[$old] = $new;
unset($return->additions[$newidx]);
unset($return->deletions[$oldidx]);
}
}
return $return;
}
/** /**
* Check if a commit is big. * Check if a commit is big.
* *
@@ -388,54 +500,66 @@ class IDF_Scm_Mercurial extends IDF_Scm
*/ */
public function getChangeLog($commit='tip', $n=10) public function getChangeLog($commit='tip', $n=10)
{ {
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s --template %s', escapeshellarg($this->repo), $n, $this->hg_log_template, $commit); $logStyle = new IDF_Scm_Mercurial_LogStyle(IDF_Scm_Mercurial_LogStyle::FULL_LOG);
// hg accepts revision IDs as arguments to --branch / -b as well and
// uses the branch of the revision in question to filter the other
// revisions
$cmd = sprintf(Pluf::f('hg_path', 'hg').' log --debug -R %s -l%s --style %s -b %s',
escapeshellarg($this->repo),
$n,
escapeshellarg($logStyle->get()),
escapeshellarg($commit));
$out = array(); $out = array();
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
self::exec('IDF_Scm_Mercurial::getChangeLog', $cmd, $out); self::exec('IDF_Scm_Mercurial::getChangeLog', $cmd, $out);
return self::parseLog($out, 4); return self::parseLog($out);
} }
/** /**
* Parse the log lines of a --pretty=medium log output. * Parse the log lines of our custom style format.
* *
* @param array Lines. * @param array Lines.
* @param int Number of lines in the headers (3)
* @return array Change log. * @return array Change log.
*/ */
public static function parseLog($lines)
public static function parseLog($lines, $hdrs=3)
{ {
$res = array(); $res = array();
$c = array(); $c = array();
$i = 0; $headers_processed = false;
$hdrs += 1;
foreach ($lines as $line) { foreach ($lines as $line) {
$i++; if ($line == "\0") {
if (0 === strpos($line, 'changeset:')) { $headers_processed = false;
if (count($c) > 0) { if (count($c) > 0) {
$c['full_message'] = trim($c['full_message']); $c['full_message'] = trim($c['full_message']);
$res[] = (object) $c; $res[] = (object) $c;
} }
$c = array();
$c['commit'] = substr(strrchr($line, ':'), 1);
$c['full_message'] = '';
$i=1;
continue;
}
if ($i == $hdrs) {
$c['title'] = trim($line);
continue; continue;
} }
$match = array(); if (!$headers_processed && empty($line)) {
if (preg_match('/^(\S+):\s*(.*)/', $line, $match)) { $headers_processed = true;
continue;
}
if (!$headers_processed && preg_match('/^(\S+):\s*(.*)/', $line, $match)) {
$match[1] = strtolower($match[1]); $match[1] = strtolower($match[1]);
if ($match[1] == 'user') { if ($match[1] == 'changeset') {
$c = array();
$c['commit'] = $match[2];
$c['tree'] = $c['commit'];
$c['full_message'] = '';
} elseif ($match[1] == 'user') {
$c['author'] = $match[2]; $c['author'] = $match[2];
} elseif ($match[1] == 'summary') { } elseif ($match[1] == 'summary') {
$c['title'] = $match[2]; $c['title'] = $match[2];
} elseif ($match[1] == 'branch') { } elseif ($match[1] == 'branch') {
$c['branch'] = $match[2]; $c['branch'] = empty($match[2]) ? 'default' : $match[2];
} elseif ($match[1] == 'parents') {
$parents = preg_split('/\s+/', $match[2], -1, PREG_SPLIT_NO_EMPTY);
for ($i=0, $j=count($parents); $i<$j; ++$i) {
if ($parents[$i] == '000000000000')
unset($parents[$i]);
}
$c['parents'] = $parents;
} else { } else {
$c[$match[1]] = trim($match[2]); $c[$match[1]] = trim($match[2]);
} }
@@ -444,15 +568,14 @@ class IDF_Scm_Mercurial extends IDF_Scm
} }
continue; continue;
} }
if ($i > ($hdrs+1)) { if ($headers_processed) {
$c['full_message'] .= trim($line)."\n"; if (empty($c['title']))
$c['title'] = trim($line);
else
$c['full_message'] .= trim($line)."\n";
continue; continue;
} }
} }
$c['tree'] = !empty($c['commit']) ? trim($c['commit']) : '';
$c['branch'] = empty($c['branch']) ? 'default' : $c['branch'];
$c['full_message'] = !empty($c['full_message']) ? trim($c['full_message']) : '';
$res[] = (object) $c;
return $res; return $res;
} }
@@ -463,7 +586,7 @@ class IDF_Scm_Mercurial extends IDF_Scm
* @param string Prefix ('git-repo-dump') * @param string Prefix ('git-repo-dump')
* @return Pluf_HTTP_Response The HTTP response containing the zip archive * @return Pluf_HTTP_Response The HTTP response containing the zip archive
*/ */
protected function getArchiveStream($commit, $prefix='') public function getArchiveStream($commit, $prefix='')
{ {
$cmd = sprintf(Pluf::f('idf_exec_cmd_prefix', ''). $cmd = sprintf(Pluf::f('idf_exec_cmd_prefix', '').
Pluf::f('hg_path', 'hg').' archive --type=zip -R %s -r %s -', Pluf::f('hg_path', 'hg').' archive --type=zip -R %s -r %s -',

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -29,19 +29,19 @@
class IDF_Scm_Monotone extends IDF_Scm class IDF_Scm_Monotone extends IDF_Scm
{ {
/** the minimum supported interface version */ /** the minimum supported interface version */
public static $MIN_INTERFACE_VERSION = 12.0; public static $MIN_INTERFACE_VERSION = 13.0;
private $stdio; private $stdio;
private static $instances = array(); private static $instances = array();
/** /**
* @see IDF_Scm::__construct() * Constructor
*/ */
public function __construct($project) public function __construct(IDF_Project $project, IDF_Scm_Monotone_IStdio $stdio)
{ {
$this->project = $project; $this->project = $project;
$this->stdio = new IDF_Scm_Monotone_Stdio($project); $this->stdio = $stdio;
} }
/** /**
@@ -135,13 +135,13 @@ class IDF_Scm_Monotone extends IDF_Scm
/** /**
* @see IDF_Scm::getArchiveStream * @see IDF_Scm::getArchiveStream
*/ */
public function getArchiveStream($commit, $prefix='repository/') public function getArchiveStream($commit, $prefix = null)
{ {
$revs = $this->_resolveSelector($commit); $revs = $this->_resolveSelector($commit);
// sanity: this should actually not happen, because the // sanity: this should actually not happen, because the
// revision is validated before already // revision is validated before already
if (count($revs) == 0) { if (count($revs) == 0) {
return new Pluf_HTTP_Response_NotFound(); throw new IDF_Scm_Exception("$commit is not a valid revision");
} }
return new IDF_Scm_Monotone_ZipRender($this->stdio, $revs[0]); return new IDF_Scm_Monotone_ZipRender($this->stdio, $revs[0]);
} }
@@ -458,8 +458,9 @@ class IDF_Scm_Monotone extends IDF_Scm
public static function factory($project) public static function factory($project)
{ {
if (!array_key_exists($project->shortname, self::$instances)) { if (!array_key_exists($project->shortname, self::$instances)) {
$stdio = new IDF_Scm_Monotone_Stdio($project);
self::$instances[$project->shortname] = self::$instances[$project->shortname] =
new IDF_Scm_Monotone($project); new IDF_Scm_Monotone($project, $stdio);
} }
return self::$instances[$project->shortname]; return self::$instances[$project->shortname];
} }
@@ -535,9 +536,6 @@ class IDF_Scm_Monotone extends IDF_Scm
$stanzas = IDF_Scm_Monotone_BasicIO::parse($out); $stanzas = IDF_Scm_Monotone_BasicIO::parse($out);
foreach ($stanzas as $stanza) { foreach ($stanzas as $stanza) {
if ($stanza[0]['key'] == 'format_version')
continue;
if ($stanza[0]['values'][0] != $file) if ($stanza[0]['values'][0] != $file)
continue; continue;
@@ -601,7 +599,7 @@ class IDF_Scm_Monotone extends IDF_Scm
{ {
$revs = $this->_resolveSelector($commit); $revs = $this->_resolveSelector($commit);
if (count($revs) == 0) if (count($revs) == 0)
return null; return false;
$revision = $revs[0]; $revision = $revs[0];
$out = $this->stdio->exec(array('get_revision', $revision)); $out = $this->stdio->exec(array('get_revision', $revision));
@@ -670,14 +668,15 @@ class IDF_Scm_Monotone extends IDF_Scm
{ {
$revs = $this->_resolveSelector($commit); $revs = $this->_resolveSelector($commit);
if (count($revs) == 0) if (count($revs) == 0)
return array(); return false;
$res = array(); $res = array();
$parents = $this->stdio->exec(array('parents', $revs[0])); $parents = $this->stdio->exec(array('parents', $revs[0]));
$res['parents'] = preg_split("/\n/", $parents, -1, PREG_SPLIT_NO_EMPTY); $res['parents'] = preg_split("/\n/", $parents, -1, PREG_SPLIT_NO_EMPTY);
$certs = $this->_getCerts($revs[0]); $certs = $this->_getCerts($revs[0]);
// FIXME: this assumes that author, date and changelog are always given // FIXME: this assumes that author, date and changelog are always given
$res['author'] = implode(', ', $certs['author']); $res['author'] = implode(', ', $certs['author']);

View File

@@ -3,7 +3,7 @@
/* /*
# ***** BEGIN LICENSE BLOCK ***** # ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application. # This file is part of InDefero, an open source project management application.
# Copyright (C) 2010 Céondo Ltd and contributors. # Copyright (C) 2008-2011 Céondo Ltd and contributors.
# #
# InDefero is free software; you can redistribute it and/or modify # InDefero is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
# #
# ***** END LICENSE BLOCK ***** */ # ***** END LICENSE BLOCK ***** */
require_once 'IDF/Scm/Exception.php';
/** /**
* Utility class to parse and compile basic_io stanzas * Utility class to parse and compile basic_io stanzas
* *
@@ -31,6 +33,11 @@ class IDF_Scm_Monotone_BasicIO
/** /**
* Parses monotone's basic_io format * Parses monotone's basic_io format
* *
* Known quirks:
* - does not handle multi-values starting with a hash '[]' (no known output)
* - does not validate hashes (should be /[0-9a-f]{40}/i)
* - does not handle forbidden \0
*
* @param string $in * @param string $in
* @return array of arrays * @return array of arrays
*/ */
@@ -54,50 +61,56 @@ class IDF_Scm_Monotone_BasicIO
$stanzaLine['key'] .= $ch; $stanzaLine['key'] .= $ch;
} }
// symbol w/o a value list // ensure we don't look at a symbol w/o a value list
if ($pos >= $length || $in[$pos] == "\n") break; if ($pos >= $length || $in[$pos] == "\n") {
if ($in[$pos] == '[') {
unset($stanzaLine['values']); unset($stanzaLine['values']);
++$pos; // opening square bracket
$stanzaLine['hash'] = substr($in, $pos, 40);
$pos += 40;
++$pos; // closing square bracket
}
else
{
unset($stanzaLine['hash']); unset($stanzaLine['hash']);
$valCount = 0; }
// if hashs and plain values are encountered in the same else {
// value list, we add the hash values as simple values as well if ($in[$pos] == '[') {
while ($in[$pos] == '"' || $in[$pos] == '[') { unset($stanzaLine['values']);
$isHashValue = $in[$pos] == '['; ++$pos; // opening square bracket
++$pos; // opening quote / bracket while ($pos < $length && $in[$pos] != ']') {
$stanzaLine['values'][$valCount] = ''; $stanzaLine['hash'] .= $in[$pos];
while ($pos < $length) {
$ch = $in[$pos]; $pr = $in[$pos-1];
if (($isHashValue && $ch == ']')
||(!$isHashValue && $ch == '"' && $pr != '\\'))
break;
++$pos; ++$pos;
$stanzaLine['values'][$valCount] .= $ch;
} }
++$pos; // closing quote ++$pos; // closing square bracket
}
else
{
unset($stanzaLine['hash']);
$valCount = 0;
// if hashs and plain values are encountered in the same
// value list, we add the hash values as simple values as well
while ($in[$pos] == '"' || $in[$pos] == '[') {
$isHashValue = $in[$pos] == '[';
++$pos; // opening quote / bracket
$stanzaLine['values'][$valCount] = '';
while ($pos < $length) {
$ch = $in[$pos]; $pr = $in[$pos-1];
if (($isHashValue && $ch == ']')
||(!$isHashValue && $ch == '"' && $pr != '\\'))
break;
++$pos;
$stanzaLine['values'][$valCount] .= $ch;
}
++$pos; // closing quote
if (!$isHashValue) { if (!$isHashValue) {
$stanzaLine['values'][$valCount] = str_replace( $stanzaLine['values'][$valCount] = str_replace(
array("\\\\", "\\\""), array("\\\\", "\\\""),
array("\\", "\""), array("\\", "\""),
$stanzaLine['values'][$valCount] $stanzaLine['values'][$valCount]
); );
} }
if ($pos >= $length) if ($pos >= $length)
break; break;
if ($in[$pos] == ' ') { if ($in[$pos] == ' ') {
++$pos; // space ++$pos; // space
++$valCount; ++$valCount;
}
} }
} }
} }
@@ -114,6 +127,12 @@ class IDF_Scm_Monotone_BasicIO
/** /**
* Compiles monotone's basicio format * Compiles monotone's basicio format
* *
* Known quirks:
* - does not validate keys for /[a-z_]+/
* - does not validate hashes (should be /[0-9a-f]{40}/i)
* - does not support intermixed value / hash formats
* - does not handle forbidden \0
*
* @param array $in Array of arrays * @param array $in Array of arrays
* @return string * @return string
*/ */
@@ -129,7 +148,7 @@ class IDF_Scm_Monotone_BasicIO
$maxkeylength = 0; $maxkeylength = 0;
foreach ((array)$stanza as $lx => $line) { foreach ((array)$stanza as $lx => $line) {
if (!array_key_exists('key', $line)) { if (!array_key_exists('key', $line) || empty($line['key'])) {
throw new IDF_Scm_Exception( throw new IDF_Scm_Exception(
'"key" not found in basicio stanza '.$sx.', line '.$lx '"key" not found in basicio stanza '.$sx.', line '.$lx
); );
@@ -157,13 +176,6 @@ class IDF_Scm_Monotone_BasicIO
$value).'"'; $value).'"';
} }
} }
else
{
throw new IDF_Scm_Exception(
'neither "hash" nor "values" found in basicio '.
'stanza '.$sx.', line '.$lx
);
}
$out .= "\n"; $out .= "\n";
} }

Some files were not shown because too many files have changed in this diff Show More