php-5.3

Is there any replacement for PHPDocumentor that supports PHP 5.3?

你说的曾经没有我的故事 提交于 2019-12-02 20:21:48
Some of the new PHP 5.3 features, including namespaces and anonymous functions, are not compatible with PHPDocumentor, even with the latest release. For example, it just raises an error when it encounters "a function with no name", i.e. a closure. So, are there any other open-source tools that generate API documentation (preferably in HTML) from Javadoc-style comments in PHP 5.3 code? You could try DocBlox; which is intended to be an alternative for phpDocumentor but with support for additional features of which full PHP 5.3 support is one. An additional benefit is that is it quite fast and

How to parse xml namespaces with DOMDocument and be sure to get objects

為{幸葍}努か 提交于 2019-12-02 17:04:03
问题 I'm trying to parse a xml response from other server. I can get my needed objects from that xml. but some times and some how, I cant get some objects. and this error appears. Fatal error: Call to a member function getElementsByTagName() on a non-object in line 91 I checked every thing and I think there is nothing wrong. here is an example xml response: <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="http://epp.nic.ir/ns/domain-1.0"> <response xmlns:domain="http://epp.nic.ir/ns

How to fix error with xml2-config not found when installing PHP from sources?

五迷三道 提交于 2019-12-02 14:45:50
When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php ) and I run ./configure I get this error: configure: error: xml2-config not found. Please check your libxml2 installation. TroodoN-Mike All you need to do instal install package libxml2-dev for example: sudo apt-get install libxml2-dev On CentOS/RHEL: sudo yum install libxml2-devel For the latest versions it is needed to install libxml++2.6-dev like that: apt-get install libxml++2.6-dev I had the same issue when I used a DockerFile. My Docker is based on

making an array from database [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-02 12:54:49
I'm going crazy with this issue, I want to get an array separated by commas(string) like example:(1,2,4,6) from a database and insert this as a variable inside a query like(select from table where id IN($variable string). Can anyone help me with this? example: <?php //connect $sql = "select id from users where id=1"; //get the results as an array insert that variable inside this query select from table where id IN($variable); // ?> i tried multiple ways and always have different issues. Please need an answer! implode() transforms an array into a string of values separated by the char you

How to parse xml namespaces with DOMDocument and be sure to get objects

泄露秘密 提交于 2019-12-02 09:43:43
I'm trying to parse a xml response from other server. I can get my needed objects from that xml. but some times and some how, I cant get some objects. and this error appears. Fatal error: Call to a member function getElementsByTagName() on a non-object in line 91 I checked every thing and I think there is nothing wrong. here is an example xml response: <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="http://epp.nic.ir/ns/domain-1.0"> <response xmlns:domain="http://epp.nic.ir/ns/domain-1.0"> <result code="1000"> <msg>Command completed successfully</msg> </result> <resData xmlns:domain=

How to generate or modify a PHP class at runtime?

霸气de小男生 提交于 2019-12-01 23:37:13
The schmittjoh/cg-library seems what I need, but there is no documentation at all. This library provides some tools that you commonly need for generating PHP code. One of it's strength lies in the enhancement of existing classes with behaviors. Given A class: class A {} I'd like to modify, at runtime of course and with some cache mechanism, class A , making it implementing a given interface: interface I { public function mustImplement(); } ... with a "default" implementation for method mustImplement() in A class. hakre Note: OP needs PHP 5.3 (it was not tagged that way before), this question

How to use __get() to return null in multilevel object property accessing?

雨燕双飞 提交于 2019-12-01 21:19:09
How can I use __get() to return null in multilevel object property accessing the case like this below? For instance, this is my classes, class property { public function __get($name) { return (isset($this->$name)) ? $this->$name : null; } } class objectify { public function array_to_object($array = array(), $property_overloading = false) { # if $array is not an array, let's make it array with one value of former $array. if (!is_array($array)) $array = array($array); # Use property overloading to handle inaccessible properties, if overloading is set to be true. # Else use std object. if(

In PHP, 0 (int, zero) is equal to “first” or “last” (strings)?

。_饼干妹妹 提交于 2019-12-01 21:06:01
I'm confused by something I just ran into in a script I was working on. I had the following: function getPart($part) { $array = array('a', 'b', 'c'); if ($part == 'first') $part = 0; if ($part == 'last') $part = count($array) - 1; if (isset($array[$part])) return $array[$part]; return false; } $position = 0; echo getPart($position); So, if I were to try the string "first", I should get "a" as the output. With the string "last" I should get "c" and so on. When I run the script above, with PHP 5.3, I get "c" ... Confused, I ran a quick test ... var_dump(0 == 'first'); var_dump(0 == 'last'); Both

Does the .user.ini file work for subdirectories?

六月ゝ 毕业季﹏ 提交于 2019-12-01 17:54:44
Does the .user.ini file that controls folder specific PHP settings also descend into the subfolders? I was reading a few websites and they suggest that it does (albeit there is not alot of information about it), however I've found that if I run a script from a subfolder, it doesn't use the settings from the .user.ini file. Am I missing something or is it only meant to be for the same folder that the script is executing from? If so, is there a way to make php scripts look for the .user.ini file from the parent folder etc? Yes, it should work. However, I had the same issue with .user.ini files

PHP `DateTime::days` returns trash?

谁都会走 提交于 2019-12-01 16:49:45
PHP Class DateInterval has a property "days". According to the manual it returns "Total number of days the interval spans. If this is unknown, days will be FALSE." In my case the code: $d = new DateInterval('P1Y'); echo $d->days; returns -99999 and a code like this $a = DateTime::createFromFormat("d.m.Y", "01.01.2010"); $b = DateTime::createFromFormat("d.m.Y", "03.01.2010"); $d = $b->diff($a); echo $d->days; returns 6015 Did I misunderstand something? DateInterval is buggy on windows platform. See bug #51183 . The official answer seems to be "use VC9 builds instead for now". I just run your