php-general Digest 14 May 2012 14:44:00 -0000 Issue 7813

Topics (messages 317871 through 317876):

Re: Converting date string to unix timestamp
        317871 by: Govinda

looking for some PECL PHP GTK tutorial
        317872 by: Mihamina Rakotomandimby
        317874 by: Matijn Woudt

Re: code deployment through php
        317873 by: rene7705

Bug in DOMDocument schemaValidate() function?
        317875 by: Voß, Marko
        317876 by: Matijn Woudt

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 ---
>> On another note, just curious why I keep getting your responses, but don't
>> get the emails that I post.
>> Anyone else having trouble with the list like that?
> 
> That is how the mailing list works. You don't see the messages you send.

If you want to see your post, you can check (drill down) here:

http://marc.info/?l=php-general

-Govinda


--- End Message ---
--- Begin Message ---
Hi all

As PHP-GTK has "moved" to the PECL, I suppose several part of this documentation are not relevent anymore: http://gtk.php.net/manual/en/tutorials.installation.linux.php

Would you know a place where I could find some way to work with it?

Thank you!


--
RMA.

--- End Message ---
--- Begin Message ---
On Mon, May 14, 2012 at 7:05 AM, Mihamina Rakotomandimby
<miham...@rktmb.org> wrote:
> Hi all
>
> As PHP-GTK has "moved" to the PECL, I suppose several part of this
> documentation are not relevent anymore:
> http://gtk.php.net/manual/en/tutorials.installation.linux.php
>
> Would you know a place where I could find some way to work with it?
>
> Thank you!
>

Installing PECL packages under linux is as simple as:
$ pecl install <packagename>

- Matijn

--- End Message ---
--- Begin Message ---
On Sun, May 6, 2012 at 3:32 PM, rene7705 <rene7...@gmail.com> wrote:
> On Sat, May 5, 2012 at 5:13 AM, tamouse mailing lists
> <tamouse.li...@gmail.com> wrote:
>>
>> On Wed, May 2, 2012 at 5:23 AM, rene7705 <rene7...@gmail.com> wrote:
>> > 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?
>>
>>
>> Using git, you can set up either publicly hosted repositories on
>> github.com or gitorious.org or perhaps other public repo places. If
>> you don't want you code to be publicly available, you can set up
>> private repositories as well.
>>
>> Not being familiar with Windows implementations much at all, I can't
>> tell you specifically what to do with msysgit, so these will be more
>> generic instructions.
>>
>> I'm going to assume you don't have a host somewhere with ssh access.
>> In this case you'll most likely want/need to set up your repository on
>> your local system. (Note that it isn't *strictly* necessary to have a
>> repository -- you can clone a new tree from the existing code tree,
>> however having a repository can ensure a clean code set in case your
>> working tree gets out of sync somehow.)
>>
>> (These instructions are modified from
>>
>> http://tumblr.intranation.com/post/766290565/how-set-up-your-own-private-git-server-linux
>> )
>>
>> First, create a directory you want to hold all of your local
>> repositories (such as C:\User\rene\MyRepositories). Then create a
>> subdirectory off that to hold your server/application common code
>> (C:\Users\rene\MyRepositories\commoncode).
>>
>> Make that directory (..\commoncode) a *bare* repository. (Not sure how
>> that's done with msysgit, but the basic git command is: "git init
>> --bare C:\Users\rene\MyRepositories\commoncode")
>>
>> Then you add the repository as a remote to the working tree: git
>> remote add origin C:\Users\rene\MyRepositories\commoncode
>>
>> Now you can push commits to your repository with the following sequence:
>>
>> git add <files you want to commit>
>> git commit
>> git push origin master
>>
>> Now, to *deploy*, you can do the following:
>>
>> Somewhere outside your working tree, create a directory called "deploy":
>>
>> mkdir C:\Users\rene\deploy
>>
>> Then clone your the repository of your commond code:
>>
>> git clone C:\Users\rene\MyRepositories\commoncode cleancode-20120404
>>
>> Then you can ftp the contents of cleancode-20120404 to your server as
>> needed.
>>
>> Sorry to be unable to tell you the exact steps with msysgit, but I
>> hope you can interpolate from the commands above.
>
>
> Thanks for that useful info, tamouse..
>
> I didn't check this list for a few days thinking the thread had gone dead,
> but I did manage to figure git on windows out.
>
> I do need a bare repo for my common code, which I've put on a crypted disk
> somewhere.
> The command on msysgit is btw the same as a linux git command..
>
> In each .../htdocs/sites/someDomain.com, under which I have the common code
> in the folder "code", I have a file called .gitignore, which contains;
>
> /cache
> /code
> *~
>
> this ensures that my cache and common code folders, plus vim backup files,
> are not put into the domain repo ("git init" in each
> /sites/someDomain.com/).
>
> then, to ease cloning and pushing of the common code, I have 2 .bat scripts
> in my %PATH%;
>
> code-c.bat: (fetch from master bare repo) (only to be executed in
> .../sites/someDomain.com)
> echo Y | rmdir /s code
> git clone X:\path\to\myCommonCode.git HEAD
>
> code-p.bat: (push local changes back into master bare repo) (only to be
> executed in .../sites/someDomain.com/code)
> git push X:\path\to\myCommonCode.git HEAD
>
> to initialize the master bare repo X:\path\to\myCommonCode.git with my code,
> I enter the latest code dir; .../htdocs/sites/someSite.com/code, and do the
> following there;
>
> git init
> git add .
> git commit -m "Initial commit"
> code-p
>
> Now, if I understand it correctly, I can backup all the relevant directories
> and (hopefuly safely?!) backup the git repos all with simple xcopy /s
> commands (cp -r on linux).
> So that's what I'm doing now, I have a batch script to copy everything with
> xcopy to another permanently attached large crypted usb drive in
> .../backups/[date-time] category/, and another batch script like it to do
> the same to a crypted usb drive (against breakins and such).
>

one final gotcha; if you want to backup the git repositories, you have
to use xcopy /s /h source destination. it needs that /h to copy .git
directories that are hidden by default.

--- End Message ---
--- Begin Message ---
Hello,

I am validating user DOM against schema files using the following piece of code:

$valid = @$doc->schemaValidate($xsdFile);

where $doc is of type DOMDocument and $xsdFile is the file location of the XSD 
file.

Everything worked fine until the following validation occured:

A validation of a XML against the SRW/U schema 
(http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd) 
failed.

Here is the XML:

-----------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<srw:explainResponse xmlns:srw="http://www.loc.gov/zing/srw/"; 
xmlns:zr="http://explain.z3950.org/dtd/2.0/";>
   <srw:version>1.1</srw:version>
   <srw:record>
     <srw:recordSchema>http://explain.z3950.org/dtd/2.0/</srw:recordSchema>
     <srw:recordPacking>XML</srw:recordPacking>
     <srw:recordData>
       <zr:explain>
         <zr:serverInfo wsdl="http://myserver.com/db"; protocol="SRU" 
version="1.1">
           <host>myserver.com</host>
           <port>80</port>
           <database>sru</database>
         </zr:serverInfo>
         <zr:databaseInfo>
           <title lang="en" primary="true">SRU Test Database</title>
           <description lang="en" primary="true"> My server SRU Test 
Database</description>
         </zr:databaseInfo>
         <zr:metaInfo>
           <dateModified>27-11-2003</dateModified>
         </zr:metaInfo>
       </zr:explain>
     </srw:recordData>
   </srw:record>
</srw:explainResponse>
-----------------------------------------------------

This XML is valid. However, I keep getting the following libxml error:

object(LibXMLError)#192 (6) {
     ["level"]=>
     int(2)
     ["code"]=>
     int(1871)
     ["column"]=>
     int(0)
     ["message"]=>
     string(133) "Element '{http://www.loc.gov/zing/srw/}record': This element 
is not expected. Expected is ( 
{http://www.loc.gov/zing/srw/}version ).
"
     ["file"]=>
     string(0) ""
     ["line"]=>
     int(0)
}

I think, the validator is unable to handle the xsd:extension part of the schema:

<xsd:complexType name="explainResponseType">
   <xsd:complexContent>
     <xsd:extension base="responseType">
       <xsd:sequence><xsd:element ref="record"/>
         <xsd:element ref="echoedExplainRequest" minOccurs="0"/>
         <xsd:element ref="diagnostics" minOccurs="0"/>
         <xsd:element ref="extraResponseData" minOccurs="0"/>
       </xsd:sequence>
     </xsd:extension>
   </xsd:complexContent>
</xsd:complexType>

The version-element exists and is at the right place. If I add another 
version-element after the first one, it complains 
about expecting a record-element instead, which is correct. But it is not 
correct to expect another version-element 
after the already existing one.

Is this a bug? Or did I made a mistake somewhere and I am not able to see it 
right now?


Thank you for any help!

Best regards,
Marko


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.



--- End Message ---
--- Begin Message ---
On Mon, May 14, 2012 at 1:39 PM, Voß, Marko <marko.v...@fiz-karlsruhe.de> wrote:
> Hello,
>
> I am validating user DOM against schema files using the following piece of 
> code:
>
> $valid = @$doc->schemaValidate($xsdFile);
>
> where $doc is of type DOMDocument and $xsdFile is the file location of the 
> XSD file.
>
> Everything worked fine until the following validation occured:
>
> A validation of a XML against the SRW/U schema 
> (http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd)
> failed.
>
> Here is the XML:
>
> -----------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <srw:explainResponse xmlns:srw="http://www.loc.gov/zing/srw/"; 
> xmlns:zr="http://explain.z3950.org/dtd/2.0/";>
>   <srw:version>1.1</srw:version>
>   <srw:record>
>     <srw:recordSchema>http://explain.z3950.org/dtd/2.0/</srw:recordSchema>
>     <srw:recordPacking>XML</srw:recordPacking>
>     <srw:recordData>
>       <zr:explain>
>         <zr:serverInfo wsdl="http://myserver.com/db"; protocol="SRU" 
> version="1.1">
>           <host>myserver.com</host>
>           <port>80</port>
>           <database>sru</database>
>         </zr:serverInfo>
>         <zr:databaseInfo>
>           <title lang="en" primary="true">SRU Test Database</title>
>           <description lang="en" primary="true"> My server SRU Test 
> Database</description>
>         </zr:databaseInfo>
>         <zr:metaInfo>
>           <dateModified>27-11-2003</dateModified>
>         </zr:metaInfo>
>       </zr:explain>
>     </srw:recordData>
>   </srw:record>
> </srw:explainResponse>
> -----------------------------------------------------
>
> This XML is valid. However, I keep getting the following libxml error:
>
> object(LibXMLError)#192 (6) {
>     ["level"]=>
>     int(2)
>     ["code"]=>
>     int(1871)
>     ["column"]=>
>     int(0)
>     ["message"]=>
>     string(133) "Element '{http://www.loc.gov/zing/srw/}record': This element 
> is not expected. Expected is (
> {http://www.loc.gov/zing/srw/}version ).
> "
>     ["file"]=>
>     string(0) ""
>     ["line"]=>
>     int(0)
> }
>
> I think, the validator is unable to handle the xsd:extension part of the 
> schema:
>
> <xsd:complexType name="explainResponseType">
>   <xsd:complexContent>
>     <xsd:extension base="responseType">
>       <xsd:sequence><xsd:element ref="record"/>
>         <xsd:element ref="echoedExplainRequest" minOccurs="0"/>
>         <xsd:element ref="diagnostics" minOccurs="0"/>
>         <xsd:element ref="extraResponseData" minOccurs="0"/>
>       </xsd:sequence>
>     </xsd:extension>
>   </xsd:complexContent>
> </xsd:complexType>
>
> The version-element exists and is at the right place. If I add another 
> version-element after the first one, it complains
> about expecting a record-element instead, which is correct. But it is not 
> correct to expect another version-element
> after the already existing one.
>
> Is this a bug? Or did I made a mistake somewhere and I am not able to see it 
> right now?
>
>
> Thank you for any help!
>
> Best regards,
> Marko
>

If you're 100% sure this XML is valid, then this is a bug. You should
report it at bugs.php.net, but it is most likely this bug is in
libXML, and needs to be fixed there.

- Matijn

--- End Message ---

Reply via email to