Skip to content

Instantly share code, notes, and snippets.

@thekid
thekid / xp-framework-issue15.diff
Created May 22, 2011 12:07
XP Framework: Patch for Issue #15
diff --git a/core/src/main/php/io/FileNotFoundException.class.php b/core/src/main/php/io/FileNotFoundException.class.php
index aa9b872..6f88e6b 100644
--- a/core/src/main/php/io/FileNotFoundException.class.php
+++ b/core/src/main/php/io/FileNotFoundException.class.php
@@ -10,9 +10,17 @@
* Indicates the file could not be found
*
* @see xp://io.IOException
- * @purpose Exception
*/
@thekid
thekid / runners.tar.gz
Created June 13, 2011 00:01
XP Framework: Unicode revamp
@thekid
thekid / quiet.diff
Created June 23, 2011 16:05
XP Framework: Patch for issue #24
diff --git a/tools/src/main/php/xp/unittest/QuietListener.class.php b/tools/src/main/php/xp/unittest/QuietListener.class.php
new file mode 100644
index 0000000..72e9d7e
--- /dev/null
+++ b/tools/src/main/php/xp/unittest/QuietListener.class.php
@@ -0,0 +1,101 @@
+<?php
+/* This class is part of the XP framework
+ *
+ * $Id$
@thekid
thekid / Escape.class.php
Created June 24, 2011 11:31
Experiment: Colored console output / fluent interface
<?php
// Inspired by http://ku1ik.com/blog/2009/03/24/colorizing-console-output-with-rainbow-ruby-gem.html
class Text extends Object {
protected $string, $attr= array();
public function __construct($string) {
$this->string= $string;
}
public function toString() {
@thekid
thekid / Issue14PerformanceTest.class.php
Created July 8, 2011 08:19
XP Framework: Performance suite for issue #14
<?php
/* This class is part of the XP framework
*
* $Id$
*/
uses('util.profiling.Timer');
/**
* Performance test
@thekid
thekid / issue30.diff
Created July 9, 2011 17:56
XP Framework: Patch for issue #30
diff --git a/core/src/main/php/unittest/AssertionFailedError.class.php b/core/src/main/php/unittest/AssertionFailedError.class.php
index e4e706c..a6d9377 100644
--- a/core/src/main/php/unittest/AssertionFailedError.class.php
+++ b/core/src/main/php/unittest/AssertionFailedError.class.php
@@ -7,7 +7,7 @@
/**
* Indicates an assertion failed
*
- * @purpose Exception
+ * @test xp://net.xp_framework.unittest.tests.StringComparisonTest
@thekid
thekid / issue28.diff
Created July 10, 2011 09:44
XP Framework: Patch for issue #28
diff --git a/core/src/main/php/io/File.class.php b/core/src/main/php/io/File.class.php
index 15b165a..635c757 100644
--- a/core/src/main/php/io/File.class.php
+++ b/core/src/main/php/io/File.class.php
@@ -323,7 +323,8 @@
* @throws io.IOException in case of an error
*/
public function readLine($bytes= 4096) {
- return chop($this->gets($bytes));
+ $bytes= $this->gets($bytes);
@thekid
thekid / issue35.diff
Created July 11, 2011 18:24
XP Framework: Patch for Issue #35
diff --git a/core/src/main/php/io/archive/zip/AbstractZipReaderImpl.class.php b/core/src/main/php/io/archive/zip/AbstractZipReaderImpl.class.php
index a025b87..4b6ac7d 100644
--- a/core/src/main/php/io/archive/zip/AbstractZipReaderImpl.class.php
+++ b/core/src/main/php/io/archive/zip/AbstractZipReaderImpl.class.php
@@ -49,7 +49,7 @@
*/
public function setPassword($password) {
$this->password= new ZipCipher();
- $this->password->initialize(iconv('iso-8859-1', 'cp437', $password));
+ $this->password->initialize(iconv(xp::CHARSET, 'cp437', $password));
@thekid
thekid / issue40.diff
Created July 22, 2011 20:41
XP Framework: Patch for Issue #40
diff --git a/core/src/main/php/unittest/AssertionFailedError.class.php b/core/src/main/php/unittest/AssertionFailedError.class.php
index befaabd..eff84f7 100644
--- a/core/src/main/php/unittest/AssertionFailedError.class.php
+++ b/core/src/main/php/unittest/AssertionFailedError.class.php
@@ -27,6 +27,17 @@
$this->actual= $actual;
$this->expect= $expect;
}
+
+ /**
@thekid
thekid / issue41.diff
Created July 22, 2011 21:11
XP Framework: Patch for Issue #41
diff --git a/core/src/main/php/lang.base.php b/core/src/main/php/lang.base.php
index b2cdb9f..1dc132f 100644
--- a/core/src/main/php/lang.base.php
+++ b/core/src/main/php/lang.base.php
@@ -93,6 +93,8 @@
return '<null>';
} else if (is_int($arg) || is_float($arg)) {
return (string)$arg;
+ } else if ($arg instanceof PrimitiveWrapper) {
+ return $arg->__toString();