Re: [PHP-CVS] com php-src: Allow 'make distclean' to clean up the 'generated' phar.inc: Makefile.global ext/phar/Makefile.frag ext/phar/phar/phar.inc ext/phar/phar/phar.inc.in

2013-08-01 Thread Christopher Jones



On 7/31/13 7:59 PM, Johannes Schlüter wrote:

On Wed, 2013-07-31 at 19:31 +, Christopher Jones wrote:

Commit:017145bc57e604153f2a2400dd6e73a397f52f96 Author:Christopher Jones 
s...@php.net Wed, 31 Jul 2013 12:31:50 -0700 Parents:
4ed18d5955ad7ac0172f6eec87735fefcd113270 Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=017145bc57e604153f2a2400dd6e73a397f52f96

Log: Allow 'make distclean' to clean up the 'generated' phar.inc


This seems to be the wrong fix for the actual issue.


-$(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc +$(builddir)/phar/phar.inc: 
$(srcdir)/phar/phar.inc.in -@test -d $(builddir)/phar || mkdir
$(builddir)/phar -  -@test -f $(builddir)/phar/phar.inc || cp 
$(srcdir)/phar/phar.inc $(builddir)/phar/phar.inc +   -@test -f
$(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc.in 
$(builddir)/phar/phar.inc


This rule copies the file from the source to the buildir for out of tree builds 
...


$(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc 
$(srcdir)/phar/*.php $(SAPI_CLI_PATH) -@echo Generating phar.php


... where it is then used by this rule, so phar.php can include it easily or 
something. (a quick scan over the file didn't tell me why that .inc is
different from the others ...)

If sourcedir == builddir nothing should happen in the first step.

If I read the Makefile correctly (mind the $(srcdir)/phar/ argument to the 
phar.php pack call) the .in file will be added to the generated
phar, too.

I don't now which exact problem is meant to be solved with this change but copying files 
around for no reason seems weird. Maybe the copy from
srcdir to builddir can be avoided at all?

johannes




When srcdir != builddir then a 'make distclean' needs to remove the
installed copy of the file.  However a unilateral rm on the file would
affect the source copy in the case when srcdir == builddir, since the
paths  names are identical.  My patch solved this by making sure the
rm never affected the base source file.  All phar tests passed, BTW.

What the copy is for, only the (nonexistent) phar maintainer can tell.
(this is why I did the change in a separate commit, so it can be
reverted etc).

Your followup fix looks better, though it pushes some phar
logic-awareness into Makefile.global.  (Unless we can add a
'distcleanphar' target in phar/Makefile.frag and add that target as a
dependency to Makefile.global's 'distclean'. This could depend how the
Makefile gets constructed and if the target is always present - I
might leave this icing to a phar person).

Chris

--
christopher.jo...@oracle.com  http://twitter.com/ghrd
Free PHP  Oracle book:
http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Revert Allow 'make distclean' to clean up the 'generated' phar.inc: Makefile.global ext/phar/Makefile.frag ext/phar/phar/phar.inc ext/phar/phar/phar.inc.in

2013-08-01 Thread Christopher Jones
Commit:146b933ab49f8068a5fe983bcb5c821e103e575e
Author:Christopher Jones s...@php.net Thu, 1 Aug 2013 08:47:13 
-0700
Parents:   c069b5f571f0d5d28d8f12cbf795155fe4c1c90b
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=146b933ab49f8068a5fe983bcb5c821e103e575e

Log:
Revert Allow 'make distclean' to clean up the 'generated' phar.inc

This reverts commit 017145bc57e604153f2a2400dd6e73a397f52f96.

Changed paths:
  M  Makefile.global
  M  ext/phar/Makefile.frag
  A  ext/phar/phar/phar.inc
  D  ext/phar/phar/phar.inc.in


Diff:
diff --git a/Makefile.global b/Makefile.global
index 73fcdda..a868ad0 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -124,7 +124,7 @@ distclean: clean
rm -f scripts/man1/phpize.1 scripts/php-config 
scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 
ext/phar/phar.phar.1
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm 
sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h 
ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h 
ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h 
ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h 
ext/iconv/php_php_iconv_impl.h
-   rm -f ext/phar/phar.phar ext/phar/phar.php ext/phar/phar/phar.inc
+   rm -f ext/phar/phar.phar ext/phar/phar.php
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 
's/.*//'|xargs rm -f
 
 .PHONY: all clean install distclean test
diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
index d95a998..faa9db0 100644
--- a/ext/phar/Makefile.frag
+++ b/ext/phar/Makefile.frag
@@ -20,9 +20,9 @@ PHP_PHARCMD_EXECUTABLE = ` \
fi;`
 PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- 
$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT);`
 
-$(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc.in
+$(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc
-@test -d $(builddir)/phar || mkdir $(builddir)/phar
-   -@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc.in 
$(builddir)/phar/phar.inc
+   -@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc 
$(builddir)/phar/phar.inc
 
 $(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc 
$(srcdir)/phar/*.php $(SAPI_CLI_PATH)
-@echo Generating phar.php
diff --git a/ext/phar/phar/phar.inc b/ext/phar/phar/phar.inc
new file mode 100644
index 000..7e7d618
--- /dev/null
+++ b/ext/phar/phar/phar.inc
@@ -0,0 +1,80 @@
+?php
+
+/**
+ * @file phar.inc
+ * @ingroup Phar
+ * @brief class Phar
+ * @author  Marcus Boerger
+ * @date2007 - 2008
+ *
+ * Phar Command
+ */
+// {{{ class Phar extends PHP_Archive
+/**
+ * Phar class
+ * 
+ * @ingroup Phar
+ * @brief   Phar implementation
+ * @author  Marcus Boerger
+ * @version 1.0
+ */
+class Phar extends PHP_Archive implements RecursiveIterator
+{
+   function getSignature()
+   {
+   return false;
+   }
+
+   function getAlias()
+   {
+   return false;
+   }
+
+   function rewind()
+   {
+   }
+
+   function valid()
+   {
+   return false;
+   }
+
+   function current()
+   {
+   }
+
+   function key()
+   {
+   }
+
+   function next()
+   {
+   }
+
+   function hasChildren()
+   {
+   return false;
+   }
+
+   function getChildren()
+   {
+   }
+
+   function hasMetadata()
+   {
+   }
+
+   function getMetadata()
+   {
+   }
+
+   function getStub()
+   {
+   }
+
+   function setStub()
+   {
+   }
+}
+
+?
\ No newline at end of file
diff --git a/ext/phar/phar/phar.inc.in b/ext/phar/phar/phar.inc.in
deleted file mode 100644
index 7e7d618..000
--- a/ext/phar/phar/phar.inc.in
+++ /dev/null
@@ -1,80 +0,0 @@
-?php
-
-/**
- * @file phar.inc
- * @ingroup Phar
- * @brief class Phar
- * @author  Marcus Boerger
- * @date2007 - 2008
- *
- * Phar Command
- */
-// {{{ class Phar extends PHP_Archive
-/**
- * Phar class
- * 
- * @ingroup Phar
- * @brief   Phar implementation
- * @author  Marcus Boerger
- * @version 1.0
- */
-class Phar extends PHP_Archive implements RecursiveIterator
-{
-   function getSignature()
-   {
-   return false;
-   }
-
-   function getAlias()
-   {
-   return false;
-   }
-
-   function rewind()
-   {
-   }
-
-   function valid()
-   {
-   return false;
-   }
-
-   function current()
-   {
-   }
-
-   function key()
-   {
-   }
-
-   function next()
-   {
-   }
-
-   function hasChildren()
-   {
-   return false;
-   }
-
-   function getChildren()
-   {
-   }
-
-   function hasMetadata()
-   {
-   }
-
-   

[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Makefile.global

2013-08-01 Thread Christopher Jones
Commit:1c91ca990ff673edf8aa521285986759996f0cca
Author:Christopher Jones s...@php.net Thu, 1 Aug 2013 08:49:19 
-0700
Parents:   1f6b940dd1b5d43fc2f846a2a85babb342749f05 
146b933ab49f8068a5fe983bcb5c821e103e575e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1c91ca990ff673edf8aa521285986759996f0cca

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Revert Allow 'make distclean' to clean up the 'generated' phar.inc

Changed paths:
  MM  Makefile.global


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Clean up the 'generated' phar.inc file. When building outside the source tree the copied phar.inc needs to be removed, but when building in the tree, the file must remain since

2013-08-01 Thread Christopher Jones
Commit:d884ec15e93fa153c845961f5e4c35ef9240eedd
Author:Christopher Jones s...@php.net Thu, 1 Aug 2013 09:19:53 
-0700
Parents:   146b933ab49f8068a5fe983bcb5c821e103e575e
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d884ec15e93fa153c845961f5e4c35ef9240eedd

Log:
Clean up the 'generated' phar.inc file.
When building outside the source tree the copied phar.inc needs to be removed,
but when building in the tree, the file must remain since it is part of the 
source.
See the copying logic in ext/phar/Makefile.frag.

Changed paths:
  M  Makefile.global


Diff:
diff --git a/Makefile.global b/Makefile.global
index a868ad0..4edaca9 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -125,6 +125,9 @@ distclean: clean
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm 
sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h 
ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h 
ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h 
ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h 
ext/iconv/php_php_iconv_impl.h
rm -f ext/phar/phar.phar ext/phar/phar.php
+   if test $(srcdir) != $(builddir); then \
+ rm -f ext/phar/phar/phar.inc; \
+   fi
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 
's/.*//'|xargs rm -f
 
 .PHONY: all clean install distclean test


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Makefile.global

2013-08-01 Thread Christopher Jones
Commit:9cd1ac7b61a473232d867c3eb69bfb8525f0d951
Author:Christopher Jones s...@php.net Thu, 1 Aug 2013 09:22:47 
-0700
Parents:   1c91ca990ff673edf8aa521285986759996f0cca 
d884ec15e93fa153c845961f5e4c35ef9240eedd
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9cd1ac7b61a473232d867c3eb69bfb8525f0d951

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Clean up the 'generated' phar.inc file. When building outside the source tree 
the copied phar.inc needs to be removed, but when building in the tree, the 
file must remain since it is part of the source. See the copying logic in 
ext/phar/Makefile.frag.

Changed paths:
  MM  Makefile.global


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Add user contributed test. Bug #61748: ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt

2013-08-01 Thread Yasuo Ohgaki
Commit:cb13f8318b39f72798c3756dcfe55daae4c932e2
Author:Yasuo Ohgaki yohg...@php.net Fri, 2 Aug 2013 09:52:08 +0900
Parents:   4590070f31bf93b351a5c2b0b023479265477a60
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=cb13f8318b39f72798c3756dcfe55daae4c932e2

Log:
Add user contributed test. Bug #61748

Bugs:
https://bugs.php.net/61748

Changed paths:
  A  ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt


Diff:
diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt 
b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt
new file mode 100644
index 000..a1d890a
--- /dev/null
+++ b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt
@@ -0,0 +1,17 @@
+--TEST--
+PDO_sqlite: Testing sqliteCreateFunction() produces warning when
+un-callable function passed
+--CREDITS--
+Chris MacPherson ch...@kombine.co.uk
+--SKIPIF--
+?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?
+--FILE--
+?php
+
+$db = new PDO( 'sqlite::memory:');
+
+$db-sqliteCreateFunction('bar-alias', 'bar');
+
+?
+--EXPECTF--
+Warning: PDO::sqliteCreateFunction(): function 'bar' is not callable in %s on 
line %d


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php