<feed xmlns='http://www.w3.org/2005/Atom'>
<title>markzz/aurweb.git/web/lib/aurjson.class.php, branch v2.0.0</title>
<subtitle>aurweb working repository</subtitle>
<id>https://git.markzz.net/markzz/aurweb.git/atom/web/lib/aurjson.class.php?h=v2.0.0</id>
<link rel='self' href='https://git.markzz.net/markzz/aurweb.git/atom/web/lib/aurjson.class.php?h=v2.0.0'/>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/'/>
<updated>2012-10-22T10:33:13Z</updated>
<entry>
<title>aurjson.class.php: Limit number of RPC results</title>
<updated>2012-10-22T10:33:13Z</updated>
<author>
<name>canyonknight</name>
<email>canyonknight@gmail.com</email>
</author>
<published>2012-10-21T19:53:16Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=43a69e7127c65f2651a61300d3e32bf6f89a2595'/>
<id>urn:sha1:43a69e7127c65f2651a61300d3e32bf6f89a2595</id>
<content type='text'>
With no limit to the number of results, memory_limit set to 32M
can easily be exceeded for searches that have a large number of
results. This results in an HTTP error 500 for those queries.

Limit results to an amount set within config.inc.php to avoid
exceeding memory_limit. Introduce new JSON error code for when
the result limit is hit.

Fixes FS#31849

Signed-off-by: canyonknight &lt;canyonknight@gmail.com&gt;
Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>Migrate all DB code to use PDO</title>
<updated>2012-09-17T22:58:46Z</updated>
<author>
<name>canyonknight</name>
<email>canyonknight@gmail.com</email>
</author>
<published>2012-08-08T22:09:51Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=e171f6f34eeacf35cf7142b4788d43e7d0978546'/>
<id>urn:sha1:e171f6f34eeacf35cf7142b4788d43e7d0978546</id>
<content type='text'>
All DB code currently uses the quickly aging mysql_* functions. These
functions are strongly discouraged and may eventually be deprecated.

Transition all code to utilize the PDO data access abstraction layer. PDO
allows for consistent query code across multiple databases. This could
potentially allow for someone to use a database other than MySQL with
minimal code changes.

All functions and behaviors are reproduced as faithfully as possible with
PDO equivalents and some changes in code.

Signed-off-by: canyonknight &lt;canyonknight@gmail.com&gt;
Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>RPC: Do not return an error on 0 results</title>
<updated>2011-11-03T07:48:20Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>archlinux@cryptocrack.de</email>
</author>
<published>2011-11-03T07:48:20Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=0557f7705ab12c84e53a5f2dc352557b908af511'/>
<id>urn:sha1:0557f7705ab12c84e53a5f2dc352557b908af511</id>
<content type='text'>
Return an empty array and set the result count to zero instead.

Before:

    $ curl 'http://localhost/rpc.php?type=search&amp;arg=raboof'
    {"type":"error","resultcount":0,"results":"No results found"}

After:

    $ curl 'http://localhost/rpc.php?type=search&amp;arg=raboof'
    {"type":"search","resultcount":0,"results":[]}

Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>aurjson: add result count to JSON result</title>
<updated>2011-11-02T20:21:23Z</updated>
<author>
<name>Dave Reisner</name>
<email>d@falconindy.com</email>
</author>
<published>2011-10-25T22:39:52Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=168a51431bda11d2250a26e8acb8b05c0876092e'/>
<id>urn:sha1:168a51431bda11d2250a26e8acb8b05c0876092e</id>
<content type='text'>
We already ask for the result count, but only use it as a basis for testing
query success or failure. Add the value to the JSON reply.

Signed-off-by: Dave Reisner &lt;dreisner@archlinux.org&gt;
Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>Escape wildcards in "LIKE" patterns</title>
<updated>2011-10-24T15:57:54Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>archlinux@cryptocrack.de</email>
</author>
<published>2011-10-20T06:43:44Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=47c5167acb0a4a2c809c03dc664fea1d130d0c8b'/>
<id>urn:sha1:47c5167acb0a4a2c809c03dc664fea1d130d0c8b</id>
<content type='text'>
Percent signs ("%") and underscores ("_") are not escaped by
mysql_real_escape_string() and are interpreted as wildcards if combined
with "LIKE". Write a wrapper function db_escape_like() and use it where
appropriate.

Note that we already fixed this for the RPC interface in commit
da2ebb667b7a332ddd8d905bf9b9a8694765fed6 but missed the other places.
This patch should fix all remaining flaws reported in FS#26527.

Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
Signed-off-by: Dan McGee &lt;dan@archlinux.org&gt;
</content>
</entry>
<entry>
<title>Wrap mysql_real_escape_string() in a function</title>
<updated>2011-10-24T15:57:54Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>archlinux@cryptocrack.de</email>
</author>
<published>2011-10-20T06:15:02Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=323d418f02074613241d65b9cabbfd65afea9abe'/>
<id>urn:sha1:323d418f02074613241d65b9cabbfd65afea9abe</id>
<content type='text'>
Wrap mysql_real_escape_string() in a wrapper function db_escape_string()
to ease porting to other databases, and as another step to pulling more
of the database code into a central location.

This is a rebased version of a patch by elij submitted about half a year
ago.

Thanks-to: elij &lt;elij.mx@gmail.com&gt;
Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>RPC: Coerce numeric values into integers</title>
<updated>2011-09-23T13:30:32Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>archlinux@cryptocrack.de</email>
</author>
<published>2011-08-20T23:45:41Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=795971bc806776ad48de6f0135736cbaaefa5fcd'/>
<id>urn:sha1:795971bc806776ad48de6f0135736cbaaefa5fcd</id>
<content type='text'>
Coerce following fields into integers to ensure json_encode() serializes
them as integers:

* ID
* CategoryID
* NumVotes
* OutOfDate
* FirstSubmitted
* LastModified

This means that there will be a minor API break. There's no better way
to do this properly, though. Fixes FS#25693.

Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>RPC: Provide out-of-date timestamp</title>
<updated>2011-09-23T12:05:41Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>archlinux@cryptocrack.de</email>
</author>
<published>2011-09-23T11:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=04a0fd47482f513c24645eb3f8b88b07303f9ec4'/>
<id>urn:sha1:04a0fd47482f513c24645eb3f8b88b07303f9ec4</id>
<content type='text'>
Convert the "OutOfDate" field to provide a timestamp instead of a
boolean flag in JSON results. We don't really care about backward
compatibility here, as most AUR helpers would break anyway when trying
to parse RPC responses after the data type overhaul that should come
with one of the following patches.

Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>RPC: Fix info queries when using package IDs</title>
<updated>2011-08-22T06:17:26Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>archlinux@cryptocrack.de</email>
</author>
<published>2011-08-22T06:17:26Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=53a31865f41db7315dc5c99e1b100f397ef80b1a'/>
<id>urn:sha1:53a31865f41db7315dc5c99e1b100f397ef80b1a</id>
<content type='text'>
Info queries using package IDs were no longer working due to commit
c6d84b3a8df10c522d79c754d4f73cb2a352586f, which introduced a table join
in process_query(), thus making the "ID" column ambiguous. Fix this by
explicitly specifying the table to use. Fixes FS#25696.

Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>Segment the upload directory by package name prefix</title>
<updated>2011-08-10T12:34:07Z</updated>
<author>
<name>Dan McGee</name>
<email>dan@archlinux.org</email>
</author>
<published>2011-08-09T22:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.markzz.net/markzz/aurweb.git/commit/?id=9a79d2105e2dea9876883da65a00d245d475bed2'/>
<id>urn:sha1:9a79d2105e2dea9876883da65a00d245d475bed2</id>
<content type='text'>
This implements the following scheme:

* /packages/cower/ --&gt; /packages/co/cower/
* /packages/j/     --&gt; /packages/j/j/
* /packages/zqy/   --&gt; /packages/zq/zqy/

We take up to the first two characters of each package name as a
intermediate subdirectory, and then the full package name lives
underneath that. Shorter named packages live in a single letter
directory.

Why, you ask? Well because earlier today the AUR hit 32,000 entries in
the unsupported/ directory, making new package uploads impossible. While
some might argue we shouldn't have so many damn packages in the repos,
we should be able to handle this case.

Why two characters instead of one? Our two biggest two-char groups, 'pe'
and 'py', both start with 'p', and have nearly 2000 packages each. Go
Python and Perl.

Still needed is a "move the existing data" script, as well as a set of
rewrite rules for those wishing to preserve backward compatible URLs for
any helper programs doing the wrong thing and relying on them.

Signed-off-by: Dan McGee &lt;dan@archlinux.org&gt;
Signed-off-by: Lukas Fleischer &lt;archlinux@cryptocrack.de&gt;
</content>
</entry>
</feed>
