<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[118026] trunk/dports/php</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/118026">118026</a></dd>
<dt>Author</dt> <dd>ryandesign@macports.org</dd>
<dt>Date</dt> <dd>2014-03-19 12:38:38 -0700 (Wed, 19 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>php-excel: apply upstream changes, including build fix for libxl 3.5.4 (#42936) and some bug fixes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsphpphpexcelPortfile">trunk/dports/php/php-excel/Portfile</a></li>
<li><a href="#trunkdportsphpphp5excelPortfile">trunk/dports/php/php5-excel/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/php/php-excel/files/</li>
<li><a href="#trunkdportsphpphpexcelfilespatchlibxl354diff">trunk/dports/php/php-excel/files/patch-libxl-3.5.4.diff</a></li>
<li>trunk/dports/php/php5-excel/files/</li>
<li><a href="#trunkdportsphpphp5excelfilespatchlibxl354diff">trunk/dports/php/php5-excel/files/patch-libxl-3.5.4.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsphpphpexcelPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/php/php-excel/Portfile (118025 => 118026)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/php/php-excel/Portfile        2014-03-19 18:34:46 UTC (rev 118025)
+++ trunk/dports/php/php-excel/Portfile        2014-03-19 19:38:38 UTC (rev 118026)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> PortGroup           php 1.1
</span><span class="cx"> 
</span><span class="cx"> github.setup        iliaal php_excel 0.9.9
</span><ins>+revision            1
</ins><span class="cx"> name                php-excel
</span><span class="cx"> categories-append   textproc
</span><span class="cx"> platforms           darwin
</span><span class="lines">@@ -25,6 +26,8 @@
</span><span class="cx"> if {${name} ne ${subport}} {
</span><span class="cx">     depends_lib-append  port:libxl
</span><span class="cx">     
</span><ins>+    patchfiles          patch-libxl-3.5.4.diff
+    
</ins><span class="cx">     # libxl is Intel-only
</span><span class="cx">     supported_archs     i386 x86_64
</span><span class="cx">     configure.universal_archs i386 x86_64
</span></span></pre></div>
<a id="trunkdportsphpphpexcelfilespatchlibxl354diff"></a>
<div class="addfile"><h4>Added: trunk/dports/php/php-excel/files/patch-libxl-3.5.4.diff (0 => 118026)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/php/php-excel/files/patch-libxl-3.5.4.diff                                (rev 0)
+++ trunk/dports/php/php-excel/files/patch-libxl-3.5.4.diff        2014-03-19 19:38:38 UTC (rev 118026)
</span><span class="lines">@@ -0,0 +1,256 @@
</span><ins>+Fix return value check:
+https://github.com/iliaal/php_excel/commit/f6ddb5b0fe24a701dcbd95e932fb7b4a5ea7f7c4
+Fix parameter order:
+https://github.com/iliaal/php_excel/commit/9fa10ad2ec3b0772baecf26d8f0f1bebc1b22e08
+Fix getVerPageBreak, getHorPageBreak:
+https://github.com/iliaal/php_excel/commit/38cafd8be5bd578e2fbc2146bc5112cece399662
+Fix build with libxl 3.5.4:
+https://github.com/iliaal/php_excel/commit/0ae7d20d58107d87cf51b987f3707a17597bc45d
+Change int to long:
+https://github.com/iliaal/php_excel/commit/a8ce68eff5699501a059bd8173bd0ea1aa1fc747
+https://github.com/iliaal/php_excel/commit/d3568f6bc954a77d940567c23045a23e8e31d078
+--- excel.c.orig        2013-11-18 06:56:00.000000000 -0600
++++ excel.c        2014-03-19 14:24:37.000000000 -0500
+@@ -53,7 +53,9 @@
+ #if LIBXL_VERSION &gt;= 0x03020000
+ #define xlBookSetRefR1C1 xlBookSetRefR1C1A
+ #define xlBookRefR1C1 xlBookRefR1C1A
++#endif

++#if LIBXL_VERSION &gt;= 0x03020000 &amp;&amp; LIBXL_VERSION &lt; 0x03050401
+ enum libXLPictureType {PICTURETYPE_PNG, PICTURETYPE_JPEG, PICTURETYPE_WMF, PICTURETYPE_DIB, PICTURETYPE_EMF, PICTURETYPE_PICT, PICTURETYPE_TIFF, PICTURETYPE_ERROR = 0xFF};
+ #endif

+@@ -1227,7 +1229,7 @@
+         BOOK_FROM_OBJECT(book, object);

+         xlBookSetActiveSheet(book, id);
+-        RETURN_BOOL(id != xlBookActiveSheet(book));
++        RETURN_BOOL(id == xlBookActiveSheet(book));
+ }
+ /* }}} */

+@@ -2043,7 +2045,7 @@
+ #else
+                         if (xlSheetIsDate(sheet, row, col)) {
+ #endif
+-                                int dt = _php_excel_date_unpack(book, d);
++                                long dt = _php_excel_date_unpack(book, d);
+                                 if (dt == -1) {
+                                         return 0;
+                                 } else {
+@@ -3414,8 +3416,13 @@
+         long row, to_row, col, to_col;
+         char *name;
+         int name_len;
++#if LIBXL_VERSION &gt;= 0x03050401
++        long scope_id = SCOPE_WORKBOOK;

++        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;sllll|l&quot;, &amp;name, &amp;name_len, &amp;row, &amp;to_row, &amp;col, &amp;to_col, &amp;scope_id) == FAILURE) {
++#else
+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;sllll&quot;, &amp;name, &amp;name_len, &amp;row, &amp;to_row, &amp;col, &amp;to_col) == FAILURE) {
++#endif
+                 RETURN_FALSE;
+         }

+@@ -3433,7 +3440,11 @@

+         SHEET_FROM_OBJECT(sheet, object);

++#if LIBXL_VERSION &gt;= 0x03050401
++        RETURN_BOOL(xlSheetSetNamedRange(sheet, name, row, to_row, col, to_col, scope_id));
++#else
+         RETURN_BOOL(xlSheetSetNamedRange(sheet, name, row, to_row, col, to_col));
++#endif
+ }
+ /* }}} */

+@@ -3445,8 +3456,13 @@
+         zval *object = getThis();
+         char *val;
+         int val_len;
++#if LIBXL_VERSION &gt;= 0x03050401
++        long scope_id = SCOPE_WORKBOOK;

++        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s|&quot;, &amp;val, &amp;val_len, &amp;scope_id) == FAILURE) {
++#else
+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s&quot;, &amp;val, &amp;val_len) == FAILURE) {
++#endif
+                 RETURN_FALSE;
+         }

+@@ -3457,7 +3473,11 @@

+         SHEET_FROM_OBJECT(sheet, object);

++#if LIBXL_VERSION &gt;= 0x03050401
++        RETURN_BOOL(xlSheetDelNamedRange(sheet, val, scope_id));
++#else
+         RETURN_BOOL(xlSheetDelNamedRange(sheet, val));
++#endif
+ }
+ /* }}} */

+@@ -3616,18 +3636,31 @@
+         char *name;
+         int name_len;
+         int rf, rl, cf, cl;
++#if LIBXL_VERSION &gt;= 0x03050401
++        long scope_id = SCOPE_WORKBOOK;
++        int hidden = 0;

++        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s|l&quot;, &amp;name, &amp;name_len, &amp;scope_id) == FAILURE) {
++#else
+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s&quot;, &amp;name, &amp;name_len) == FAILURE) {
++#endif
+                 RETURN_FALSE;
+         }

+         SHEET_FROM_OBJECT(sheet, object);
++#if LIBXL_VERSION &gt;= 0x03050401
++        if (xlSheetGetNamedRange(sheet, name, &amp;rf, &amp;rl, &amp;cf, &amp;cl, scope_id, &amp;hidden)) {
++#else
+         if (xlSheetGetNamedRange(sheet, name, &amp;rf, &amp;rl, &amp;cf, &amp;cl)) {
++#endif
+                 array_init(return_value);
+                 add_assoc_long(return_value, &quot;row_first&quot;, rf);
+                 add_assoc_long(return_value, &quot;row_last&quot;, rl);
+-                add_assoc_long(return_value, &quot;col_first&quot;, cl);
+-                add_assoc_long(return_value, &quot;col_last&quot;, cf);
++                add_assoc_long(return_value, &quot;col_first&quot;, cf);
++                add_assoc_long(return_value, &quot;col_last&quot;, cl);
++#if LIBXL_VERSION &gt;= 0x03050401
++                add_assoc_bool(return_value, &quot;hidden&quot;, hidden);
++#endif
+         } else {
+                 RETURN_FALSE;
+         }
+@@ -3641,18 +3674,29 @@
+         zval *object = getThis();
+         long index;
+         int rf, rl, cf, cl;
++#if LIBXL_VERSION &gt;= 0x03050401
++        int hidden = 0, scope_id;
++#endif

+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;l&quot;, &amp;index) == FAILURE) {
+                 RETURN_FALSE;
+         }

+         SHEET_FROM_OBJECT(sheet, object);
++#if LIBXL_VERSION &gt;= 0x03050401
++        if (xlSheetNamedRange(sheet, (int)index, &amp;rf, &amp;rl, &amp;cf, &amp;cl, &amp;scope_id, &amp;hidden)) {
++#else
+         if (xlSheetNamedRange(sheet, (int)index, &amp;rf, &amp;rl, &amp;cf, &amp;cl)) {
++#endif
+                 array_init(return_value);
+                 add_assoc_long(return_value, &quot;row_first&quot;, rf);
+                 add_assoc_long(return_value, &quot;row_last&quot;, rl);
+-                add_assoc_long(return_value, &quot;col_first&quot;, cl);
+-                add_assoc_long(return_value, &quot;col_last&quot;, cf);
++                add_assoc_long(return_value, &quot;col_first&quot;, cf);
++                add_assoc_long(return_value, &quot;col_last&quot;, cl);
++#if LIBXL_VERSION &gt;= 0x03050401
++                add_assoc_bool(return_value, &quot;hidden&quot;, hidden);
++                add_assoc_long(return_value, &quot;scope&quot;, scope_id);
++#endif
+         } else {
+                 RETURN_FALSE;
+         }
+@@ -3688,7 +3732,7 @@
+         }

+         SHEET_FROM_OBJECT(sheet, object);
+-        RETURN_LONG(xlSheetGetVerPageBreakSize(sheet));
++        RETURN_LONG(xlSheetGetVerPageBreak(sheet, index));
+ }
+ /* }}} */

+@@ -3721,7 +3765,7 @@
+         }

+         SHEET_FROM_OBJECT(sheet, object);
+-        RETURN_LONG(xlSheetGetHorPageBreakSize(sheet));
++        RETURN_LONG(xlSheetGetHorPageBreak(sheet, index));
+ }
+ /* }}} */

+@@ -4876,11 +4920,17 @@
+ PHP_EXCEL_ARGINFO
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_Sheet_getNamedRange, 0, 0, 1)
+         ZEND_ARG_INFO(0, name)
++#if LIBXL_VERSION &gt;= 0x03050401
++        ZEND_ARG_INFO(0, scope_id)
++#endif
+ ZEND_END_ARG_INFO()

+ PHP_EXCEL_ARGINFO
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_Sheet_getIndexRange, 0, 0, 1)
+         ZEND_ARG_INFO(0, index)
++#if LIBXL_VERSION &gt;= 0x03050401
++        ZEND_ARG_INFO(0, scope_id)
++#endif
+ ZEND_END_ARG_INFO()

+ ZEND_BEGIN_ARG_INFO_EX(arginfo_Sheet_namedRangeSize, 0, 0, 0)
+@@ -5366,6 +5416,10 @@
+         REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;PICTURETYPE_PICT&quot;, PICTURETYPE_PICT);
+         REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;PICTURETYPE_TIFF&quot;, PICTURETYPE_TIFF);
+ #endif
++#if LIBXL_VERSION &gt;= 0x03050401
++        REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;SCOPE_UNDEFINED&quot;, SCOPE_UNDEFINED);
++        REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;SCOPE_WORKBOOK&quot;, SCOPE_WORKBOOK);
++#endif
+         return SUCCESS;
+ }
+ /* }}} */
+--- tests/062.phpt.orig        2013-11-18 06:56:00.000000000 -0600
++++ tests/062.phpt        2014-03-19 14:28:12.000000000 -0500
+@@ -26,7 +26,7 @@
+ --EXPECT--
+ bool(true)
+ bool(true)
+-array(4) {
++array(5) {
+   [&quot;row_first&quot;]=&gt;
+   int(1)
+   [&quot;row_last&quot;]=&gt;
+@@ -35,9 +35,11 @@
+   int(10)
+   [&quot;col_last&quot;]=&gt;
+   int(10)
++  [&quot;hidden&quot;]=&gt;
++  bool(false)
+ }
+ bool(false)
+-array(4) {
++array(6) {
+   [&quot;row_first&quot;]=&gt;
+   int(20)
+   [&quot;row_last&quot;]=&gt;
+@@ -46,6 +48,10 @@
+   int(30)
+   [&quot;col_last&quot;]=&gt;
+   int(30)
++  [&quot;hidden&quot;]=&gt;
++  bool(false)
++  [&quot;scope&quot;]=&gt;
++  int(-1)
+ }
+ bool(false)
+ int(2)
+--- tests/063.phpt.orig        2013-11-18 06:56:00.000000000 -0600
++++ tests/063.phpt        2014-03-19 14:26:23.000000000 -0500
+@@ -37,8 +37,8 @@
+ bool(true)
+ int(2)
+ int(2)
+-int(2)
+-int(2)
+-int(2)
+-int(2)
++int(10)
++int(10)
++int(-1)
++int(-1)
+ OK
</ins></span></pre></div>
<a id="trunkdportsphpphp5excelPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/php/php5-excel/Portfile (118025 => 118026)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/php/php5-excel/Portfile        2014-03-19 18:34:46 UTC (rev 118025)
+++ trunk/dports/php/php5-excel/Portfile        2014-03-19 19:38:38 UTC (rev 118026)
</span><span class="lines">@@ -6,6 +6,7 @@
</span><span class="cx"> PortGroup           php5extension 1.0
</span><span class="cx"> 
</span><span class="cx"> github.setup        iliaal php_excel 0.9.9
</span><ins>+revision            1
</ins><span class="cx"> php5extension.setup excel ${version}
</span><span class="cx"> categories-append   textproc
</span><span class="cx"> platforms           darwin
</span><span class="lines">@@ -22,6 +23,8 @@
</span><span class="cx"> 
</span><span class="cx"> depends_lib-append  port:libxl
</span><span class="cx"> 
</span><ins>+patchfiles          patch-libxl-3.5.4.diff
+
</ins><span class="cx"> # libxl is Intel-only
</span><span class="cx"> supported_archs     i386 x86_64
</span><span class="cx"> configure.universal_archs i386 x86_64
</span></span></pre></div>
<a id="trunkdportsphpphp5excelfilespatchlibxl354diff"></a>
<div class="addfile"><h4>Added: trunk/dports/php/php5-excel/files/patch-libxl-3.5.4.diff (0 => 118026)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/php/php5-excel/files/patch-libxl-3.5.4.diff                                (rev 0)
+++ trunk/dports/php/php5-excel/files/patch-libxl-3.5.4.diff        2014-03-19 19:38:38 UTC (rev 118026)
</span><span class="lines">@@ -0,0 +1,256 @@
</span><ins>+Fix return value check:
+https://github.com/iliaal/php_excel/commit/f6ddb5b0fe24a701dcbd95e932fb7b4a5ea7f7c4
+Fix parameter order:
+https://github.com/iliaal/php_excel/commit/9fa10ad2ec3b0772baecf26d8f0f1bebc1b22e08
+Fix getVerPageBreak, getHorPageBreak:
+https://github.com/iliaal/php_excel/commit/38cafd8be5bd578e2fbc2146bc5112cece399662
+Fix build with libxl 3.5.4:
+https://github.com/iliaal/php_excel/commit/0ae7d20d58107d87cf51b987f3707a17597bc45d
+Change int to long:
+https://github.com/iliaal/php_excel/commit/a8ce68eff5699501a059bd8173bd0ea1aa1fc747
+https://github.com/iliaal/php_excel/commit/d3568f6bc954a77d940567c23045a23e8e31d078
+--- excel.c.orig        2013-11-18 06:56:00.000000000 -0600
++++ excel.c        2014-03-19 14:24:37.000000000 -0500
+@@ -53,7 +53,9 @@
+ #if LIBXL_VERSION &gt;= 0x03020000
+ #define xlBookSetRefR1C1 xlBookSetRefR1C1A
+ #define xlBookRefR1C1 xlBookRefR1C1A
++#endif

++#if LIBXL_VERSION &gt;= 0x03020000 &amp;&amp; LIBXL_VERSION &lt; 0x03050401
+ enum libXLPictureType {PICTURETYPE_PNG, PICTURETYPE_JPEG, PICTURETYPE_WMF, PICTURETYPE_DIB, PICTURETYPE_EMF, PICTURETYPE_PICT, PICTURETYPE_TIFF, PICTURETYPE_ERROR = 0xFF};
+ #endif

+@@ -1227,7 +1229,7 @@
+         BOOK_FROM_OBJECT(book, object);

+         xlBookSetActiveSheet(book, id);
+-        RETURN_BOOL(id != xlBookActiveSheet(book));
++        RETURN_BOOL(id == xlBookActiveSheet(book));
+ }
+ /* }}} */

+@@ -2043,7 +2045,7 @@
+ #else
+                         if (xlSheetIsDate(sheet, row, col)) {
+ #endif
+-                                int dt = _php_excel_date_unpack(book, d);
++                                long dt = _php_excel_date_unpack(book, d);
+                                 if (dt == -1) {
+                                         return 0;
+                                 } else {
+@@ -3414,8 +3416,13 @@
+         long row, to_row, col, to_col;
+         char *name;
+         int name_len;
++#if LIBXL_VERSION &gt;= 0x03050401
++        long scope_id = SCOPE_WORKBOOK;

++        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;sllll|l&quot;, &amp;name, &amp;name_len, &amp;row, &amp;to_row, &amp;col, &amp;to_col, &amp;scope_id) == FAILURE) {
++#else
+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;sllll&quot;, &amp;name, &amp;name_len, &amp;row, &amp;to_row, &amp;col, &amp;to_col) == FAILURE) {
++#endif
+                 RETURN_FALSE;
+         }

+@@ -3433,7 +3440,11 @@

+         SHEET_FROM_OBJECT(sheet, object);

++#if LIBXL_VERSION &gt;= 0x03050401
++        RETURN_BOOL(xlSheetSetNamedRange(sheet, name, row, to_row, col, to_col, scope_id));
++#else
+         RETURN_BOOL(xlSheetSetNamedRange(sheet, name, row, to_row, col, to_col));
++#endif
+ }
+ /* }}} */

+@@ -3445,8 +3456,13 @@
+         zval *object = getThis();
+         char *val;
+         int val_len;
++#if LIBXL_VERSION &gt;= 0x03050401
++        long scope_id = SCOPE_WORKBOOK;

++        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s|&quot;, &amp;val, &amp;val_len, &amp;scope_id) == FAILURE) {
++#else
+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s&quot;, &amp;val, &amp;val_len) == FAILURE) {
++#endif
+                 RETURN_FALSE;
+         }

+@@ -3457,7 +3473,11 @@

+         SHEET_FROM_OBJECT(sheet, object);

++#if LIBXL_VERSION &gt;= 0x03050401
++        RETURN_BOOL(xlSheetDelNamedRange(sheet, val, scope_id));
++#else
+         RETURN_BOOL(xlSheetDelNamedRange(sheet, val));
++#endif
+ }
+ /* }}} */

+@@ -3616,18 +3636,31 @@
+         char *name;
+         int name_len;
+         int rf, rl, cf, cl;
++#if LIBXL_VERSION &gt;= 0x03050401
++        long scope_id = SCOPE_WORKBOOK;
++        int hidden = 0;

++        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s|l&quot;, &amp;name, &amp;name_len, &amp;scope_id) == FAILURE) {
++#else
+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;s&quot;, &amp;name, &amp;name_len) == FAILURE) {
++#endif
+                 RETURN_FALSE;
+         }

+         SHEET_FROM_OBJECT(sheet, object);
++#if LIBXL_VERSION &gt;= 0x03050401
++        if (xlSheetGetNamedRange(sheet, name, &amp;rf, &amp;rl, &amp;cf, &amp;cl, scope_id, &amp;hidden)) {
++#else
+         if (xlSheetGetNamedRange(sheet, name, &amp;rf, &amp;rl, &amp;cf, &amp;cl)) {
++#endif
+                 array_init(return_value);
+                 add_assoc_long(return_value, &quot;row_first&quot;, rf);
+                 add_assoc_long(return_value, &quot;row_last&quot;, rl);
+-                add_assoc_long(return_value, &quot;col_first&quot;, cl);
+-                add_assoc_long(return_value, &quot;col_last&quot;, cf);
++                add_assoc_long(return_value, &quot;col_first&quot;, cf);
++                add_assoc_long(return_value, &quot;col_last&quot;, cl);
++#if LIBXL_VERSION &gt;= 0x03050401
++                add_assoc_bool(return_value, &quot;hidden&quot;, hidden);
++#endif
+         } else {
+                 RETURN_FALSE;
+         }
+@@ -3641,18 +3674,29 @@
+         zval *object = getThis();
+         long index;
+         int rf, rl, cf, cl;
++#if LIBXL_VERSION &gt;= 0x03050401
++        int hidden = 0, scope_id;
++#endif

+         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;l&quot;, &amp;index) == FAILURE) {
+                 RETURN_FALSE;
+         }

+         SHEET_FROM_OBJECT(sheet, object);
++#if LIBXL_VERSION &gt;= 0x03050401
++        if (xlSheetNamedRange(sheet, (int)index, &amp;rf, &amp;rl, &amp;cf, &amp;cl, &amp;scope_id, &amp;hidden)) {
++#else
+         if (xlSheetNamedRange(sheet, (int)index, &amp;rf, &amp;rl, &amp;cf, &amp;cl)) {
++#endif
+                 array_init(return_value);
+                 add_assoc_long(return_value, &quot;row_first&quot;, rf);
+                 add_assoc_long(return_value, &quot;row_last&quot;, rl);
+-                add_assoc_long(return_value, &quot;col_first&quot;, cl);
+-                add_assoc_long(return_value, &quot;col_last&quot;, cf);
++                add_assoc_long(return_value, &quot;col_first&quot;, cf);
++                add_assoc_long(return_value, &quot;col_last&quot;, cl);
++#if LIBXL_VERSION &gt;= 0x03050401
++                add_assoc_bool(return_value, &quot;hidden&quot;, hidden);
++                add_assoc_long(return_value, &quot;scope&quot;, scope_id);
++#endif
+         } else {
+                 RETURN_FALSE;
+         }
+@@ -3688,7 +3732,7 @@
+         }

+         SHEET_FROM_OBJECT(sheet, object);
+-        RETURN_LONG(xlSheetGetVerPageBreakSize(sheet));
++        RETURN_LONG(xlSheetGetVerPageBreak(sheet, index));
+ }
+ /* }}} */

+@@ -3721,7 +3765,7 @@
+         }

+         SHEET_FROM_OBJECT(sheet, object);
+-        RETURN_LONG(xlSheetGetHorPageBreakSize(sheet));
++        RETURN_LONG(xlSheetGetHorPageBreak(sheet, index));
+ }
+ /* }}} */

+@@ -4876,11 +4920,17 @@
+ PHP_EXCEL_ARGINFO
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_Sheet_getNamedRange, 0, 0, 1)
+         ZEND_ARG_INFO(0, name)
++#if LIBXL_VERSION &gt;= 0x03050401
++        ZEND_ARG_INFO(0, scope_id)
++#endif
+ ZEND_END_ARG_INFO()

+ PHP_EXCEL_ARGINFO
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_Sheet_getIndexRange, 0, 0, 1)
+         ZEND_ARG_INFO(0, index)
++#if LIBXL_VERSION &gt;= 0x03050401
++        ZEND_ARG_INFO(0, scope_id)
++#endif
+ ZEND_END_ARG_INFO()

+ ZEND_BEGIN_ARG_INFO_EX(arginfo_Sheet_namedRangeSize, 0, 0, 0)
+@@ -5366,6 +5416,10 @@
+         REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;PICTURETYPE_PICT&quot;, PICTURETYPE_PICT);
+         REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;PICTURETYPE_TIFF&quot;, PICTURETYPE_TIFF);
+ #endif
++#if LIBXL_VERSION &gt;= 0x03050401
++        REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;SCOPE_UNDEFINED&quot;, SCOPE_UNDEFINED);
++        REGISTER_EXCEL_CLASS_CONST_LONG(book, &quot;SCOPE_WORKBOOK&quot;, SCOPE_WORKBOOK);
++#endif
+         return SUCCESS;
+ }
+ /* }}} */
+--- tests/062.phpt.orig        2013-11-18 06:56:00.000000000 -0600
++++ tests/062.phpt        2014-03-19 14:28:12.000000000 -0500
+@@ -26,7 +26,7 @@
+ --EXPECT--
+ bool(true)
+ bool(true)
+-array(4) {
++array(5) {
+   [&quot;row_first&quot;]=&gt;
+   int(1)
+   [&quot;row_last&quot;]=&gt;
+@@ -35,9 +35,11 @@
+   int(10)
+   [&quot;col_last&quot;]=&gt;
+   int(10)
++  [&quot;hidden&quot;]=&gt;
++  bool(false)
+ }
+ bool(false)
+-array(4) {
++array(6) {
+   [&quot;row_first&quot;]=&gt;
+   int(20)
+   [&quot;row_last&quot;]=&gt;
+@@ -46,6 +48,10 @@
+   int(30)
+   [&quot;col_last&quot;]=&gt;
+   int(30)
++  [&quot;hidden&quot;]=&gt;
++  bool(false)
++  [&quot;scope&quot;]=&gt;
++  int(-1)
+ }
+ bool(false)
+ int(2)
+--- tests/063.phpt.orig        2013-11-18 06:56:00.000000000 -0600
++++ tests/063.phpt        2014-03-19 14:26:23.000000000 -0500
+@@ -37,8 +37,8 @@
+ bool(true)
+ int(2)
+ int(2)
+-int(2)
+-int(2)
+-int(2)
+-int(2)
++int(10)
++int(10)
++int(-1)
++int(-1)
+ OK
</ins></span></pre>
</div>
</div>

</body>
</html>