php-general Digest 2 May 2012 19:02:18 -0000 Issue 7797
Topics (messages 317735 through 317741):
Re: code deployment through php
317735 by: rene7705
317736 by: rene7705
317737 by: Lester Caine
PHP & Emacs
317738 by: Mihamina Rakotomandimby
get content rss feed
317739 by: Doeke Wartena
Problem with AssertTag: children count wrong
317740 by: Michael Otteneder
PHP & Database Problems
317741 by: Ethan Rosenberg
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
I can't use anything like git on my shared hoster. But I suppose I could
use something like git at home, and use a sync script like I posted in my
OP on the shared hoster.
--- End Message ---
--- Begin Message ---
On Wed, May 2, 2012 at 11:47 AM, rene7705 <rene7...@gmail.com> wrote:
> I can't use anything like git on my shared hoster. But I suppose I could
> use something like git at home, and use a sync script like I posted in my
> OP on the shared hoster.
>
>
>
Maybe you git gurus can help me along a bit further.
I've managed to install msysgit and get it to work on my windows dev box,
so far so good.
Now, I'm wondering how to set up my repositories. The last cvs I used was
Microsoft's visual source control back in the 90's, so I'm very rusty. At
the same time, I'd prefer not to experiment too much..
I've got a tree structure in a folder called simply "code", that I have in
several locations on my windows box.
Each site that I develop for has a folder in .../htdocs/sites/somedomain.com,
and many of these sites will need a copy of the common "code" folder in
them. I can restrict myself to developing in one domain's subdir only.
The non-common code for each domain is designed to run from any
$_SERVER['SERVER_NAME'] and any sub-directory it happens to be in. In other
words, http://my-dev-box.biz/sites/somedomain.com/ will show the same thing
from windowze as http://somedomain.com will from shared hosted linux.
I would also like to version control the non-common code for each domain.
And I would like to store the entire repository on my windows box at home
in 2 or 3 specific locations (on seperate disks encrypted with truecrypt.org,
and also a truecrypted usb disk, if and when that's plugged in).
For distributing the common code to the shared hosted live server (my
workflow is to check finalized changes on my win box against all my sites
that used the common code base, before deploying to the shared hoster live
server), I can simply FTP one finalized copy and use the simplest of rm -rf
and cp -r commands in a short script to distribute the changes. I could
even do without the PHP filesync code I posted earlier (altho it was fun to
build! :)
That darn hoster of mine won't support git on shared hosting, only on much
more expensive virtual dedicated and dedicated plans :(
But I've also found
http://serverfault.com/questions/26836/setting-up-a-git-repo-on-my-godaddy-hosting-plan
and
http://www.lyraphase.com/wp/uncategorized/how-to-build-git-for-a-host-with-no-compiler/
that
show me how I might get git running on my (kinda lame now) shared hosting
account.
Maybe a stupid question, but would perhaps copying the common code around
with a simple script be faster than multiple pushes by git?
--- End Message ---
--- Begin Message ---
rene7705 wrote:
I can't use anything like git on my shared hoster. But I suppose I could
use something like git at home, and use a sync script like I posted in my
OP on the shared hoster.
I have some legacy hosting packages which are just ftp access and BC just lists
them and allows me to manage things quickly when I need to update those sites.
One of these days they will get moved to an easier location :)
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
Hi all,
For curiosity, are there people here using Emacs to code in PHP?
What modes do you add? cedet, ecb,...
I see (just for the example) that Drupal has a short documentation page
for Emacs http://drupal.org/node/59868
Have you got some in your bookmarks for general PHP coding?
--
RMA.
--- End Message ---
--- Begin Message ---
Hi all,
I try to get the content from the following rss feed
http://www.adafruit.com/blog/feed/
I want to store it in a database in order to use it for a school assignment.
If i look in my browser to the feed then i see content and description,
however if i try to get them with php then description is this:
[description] => SimpleXMLElement Object
(
)
and content is gone.
----------
$db = dbConnect();
$xml = getFileContents("http://www.adafruit.com/blog/feed/");
$xmlTree = new SimpleXMLElement($xml);
for($i = count($xmlTree->channel->item)-1; $i >= 0; $i--) {
$item = $xmlTree->channel->item[$i];
echo "<pre>";
print_r($item);
echo "</pre>";
}
dbClose($db);
?>
----------
this is 1 part of the print_r:
SimpleXMLElement Object
(
[title] => Birth of the ARM: Acorn Archimedes Promo from 1987
[link] =>
http://www.adafruit.com/blog/2012/04/28/birth-of-the-arm-acorn-archimedes-promo-from-1987/
[comments] =>
http://www.adafruit.com/blog/2012/04/28/birth-of-the-arm-acorn-archimedes-promo-from-1987/#comments
[pubDate] => Sat, 28 Apr 2012 04:01:35 +0000
[category] => Array
(
[0] => SimpleXMLElement Object
(
)
[1] => SimpleXMLElement Object
(
)
)
[guid] => http://www.adafruit.com/blog/?p=30498
[description] => SimpleXMLElement Object
(
)
)
I guess content is gone cause it's like this:
<content:encoded>
And description is gone cause it's like this:
<![CDATA[
But how can i avoid this problem (i'm quite new)?
bye
--- End Message ---
--- Begin Message ---
Hi List!
I'm trying to use phpUnit's AssertTag function to make sure that some html
code contains an ul element with exactly li items in it.
My test looks like this:
function testUnconfiguredFilter() {
$matcher = array(
'tag' => 'ul',
'children' => array(
'count' => 3,
'only' => array('tag' => 'li')
)
);
$this->assertTag($matcher, $this->html, $message, $isHtml = FALSE);
}
the value of $html is:
<div class="flFilterbox" id="flFilterunconfiguredFilter">
<h3>unconfiguredFilter</h3>
<ul class="flFilterboxInner">
<li><a href=""> FilterValue1</a> ()</li>
<li><a href=""> FilterValue2</a> ()</li>
<li><a href=""> FilterValue3</a> ()</li>
</ul>
</div>
So I think the assertion SHOULD work - but it does not, no matter what I
use for count! Sadly PHPUnit's output ist not very helpful, all it gives me
is:
1) GeneratedFiltersTest::testUnconfiguredFilter
Failed asserting that false is true.
Has someone got an idea whats going on? This is really freakin me out,
could not find anything about it anywhere on the web.
Kind regards,
Michael
--- End Message ---
--- Begin Message ---
have a database
mysql> describe Intake3;
+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| Site | varchar(6) | NO | PRI | | |
| MedRec | int(6) | NO | PRI | NULL | |
| Fname | varchar(15) | YES | | NULL | |
| Lname | varchar(30) | YES | | NULL | |
| Phone | varchar(30) | YES | | NULL | |
| Height | int(4) | YES | | NULL | |
| Sex | char(7) | YES | | NULL | |
| Hx | text | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
8 rows in set (0.00 sec)
mysql> describe Visit3;
+--------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+----------------+
| Indx | int(4) | NO | PRI | NULL | auto_increment |
| Site | varchar(6) | YES | | NULL | |
| MedRec | int(6) | YES | | NULL | |
| Notes | text | YES | | NULL | |
| Weight | int(4) | YES | | NULL | |
| BMI | decimal(3,1) | YES | | NULL | |
| Date | date | YES | | NULL | |
+--------+--------------+------+-----+---------+----------------+
and a program to enter and extract data.
I can easily extract data from the database. However, if I try to
enter data, it goes into the incorrect record. Following are some
screenshots. The program is attached. [pardon the comical
names. This is a test, and any resemblance to true names is not
intentional....]
Let us say that I wish to deal with Medical Record 10000:
This it data from Intake3:
Site Medical Record First Name Last Name Phone Height Sex History
AA 10000 David Dummy 845 365-1456 66 Male c/o obesity. Various
treatments w/o success
This is data from Visit3:
Index Site Medical Record Notes Weight BMI Date
2322 AA 10000 Second Visit. 170 27.4 2010-01-20
2326 AA 10000 Third visit. Small progress, but pt is very happy. 165
26.6 2010-02-01
I then request to enter additional data:
Site Medical Record First Name Last Name Phone Height Sex History
AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his
friends that he is obese. Normal BMI = 23.
Index Site Medical Record Notes Weight BMI Date
Notice that it is entered into record 10003
The data is "First Try"
Index Site Medical Record Notes Weight BMI Date
2590 AA 10003 First Try 189 31.4 02 May 2012
Help and advice, please.
Thanks.
Ethan
--- End Message ---