archive-com.com » COM » B » BENRAMSEY.COM

Total: 425

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Add Children with SimpleXML, by Ben Ramsey
    child which would have to use DOM in order to work or so I thought During this process I ve discovered two major limitations of SimpleXML You cannot override the SimpleXMLElement constructor it is a final method in the internals You can extend SimpleXMLElement and add new methods but looping through child nodes creates new SimpleXMLElement objects that do not use your class and thus cannot use your methods Nevertheless I can get over these limitations after discovering these new SimpleXMLElement methods in PHP 5 1 4 In particular the last three are what interest me most these are not yet documented in the PHP manual bool SimpleXMLElement registerXPathNamespace string prefix string uri array SimpleXMLElement getNamespaces bool recursive array SimpleXMLElement getDocNamespaces bool recursive string SimpleXMLElement getName object SimpleXMLElement addChild string name string value string ns void SimpleXMLElement addAttribute string name string value string ns Previously one of the biggest limitations of SimpleXML was that you could not add new child nodes to an XML document Adding attributes to an element was no problem but in order to add a child element you had to go a round about way through importing the SimpleXML object to DOM with dom import simplexml adding the child element and importing the DOM object back to SimpleXML with simplexml import dom This was messy and anything but simple Now it s clean and simple as SimpleXML should be php xml XML books book title Fahrenheit 451 author Ray Bradbury book title Stranger in a Strange Land author Robert Heinlein books XML sxe new SimpleXMLElement xml new book sxe addChild book new book addAttribute title 1984 new book addAttribute author George Orwell echo sxe as abbr title XML abbr UPDATE I ve added all of these except for registerXPathNamespace which I can t seem to figure

    Original URL path: https://benramsey.com/blog/2006/05/add-children-with-simplexml/ (2016-04-26)
    Open archived version from archive


  • Share Your OPML, by Ben Ramsey
    bring together many types of structured content that are currently being developed on the Web such as microcontent attention data identity data and data that will eventually comprise the Semantic Web OPML won t replace these many efforts it will help integrate them by providing a common packaging mechanism Adam Green OPML Camp blog As of right now many sites are using RSS as a common content delivery format While RSS works for syndication though I think that it lacks the extensibility and context to fill the role of this flexible container OPML won t replace RSS but it will aid in its delivery So I m a little more than casually interested in seeing the application and future direction of OPML Along these lines Dave Winer launched today his new Share Your OPML service the purpose of which is to gather a community of subscription lists in OPML format and aggregate them in interesting ways It s unclear to me right now the practical value of this service since I was unable to discover how to actually generate OPML from the site If the site were to provide OPML feeds for each data display then its value would be

    Original URL path: https://benramsey.com/blog/2006/05/share-your-opml/ (2016-04-26)
    Open archived version from archive

  • Generating OPML From del.icio.us (And Getting All Your Links), by Ben Ramsey
    of its own which I ll explain in a few moments Using the del icio us API instead of their RSS feeds I was able to use the following code to first check whether my del icio us account has been updated since I last cached their data and if so to grab all of the links for a particular tag and cache the data to a file for later use php username your username password your password cache file tmp blogroll xml check for updates to del icio us account update simplexml load file https username password api del icio us v1 posts update if strtotime update time filemtime cache file del icio us has been updated since last cache recache data file get contents https username password api del icio us v1 posts all tag blogroll file put contents cache file data read links from cached del icio us data blogroll simplexml load file cache file foreach blogroll post as blog echo a href htmlentities blog href echo htmlentities blog description echo a br n This code sample uses SimpleXML to traverse the nodes of the XML documents retrieved from del icio us It first polls del icio us with a request to see the update timestamp Checking this before executing a query to see all posts saves bandwidth for del icio us and can help us determine whether our cached file needs updating This is also the recommended practice from del icio us This approach can help you grab all of your links or all links for a specific tag from del icio us I ve noted several issues however You can specify a tag to the posts all command with tag tagname but you cannot specify a combination of tags to retrieve You cannot specify a

    Original URL path: https://benramsey.com/blog/2006/05/generating-opml-from-delicious/ (2016-04-26)
    Open archived version from archive

  • OPML Reading List & PHP Upgrade Notice, by Ben Ramsey
    the syndicate heading is a link to my OPML blogroll Feel free to import my OPML into your feed reader that s what it s there for Please also note that I use SimpleXML to generate the blogroll on my home page from this list There s a lot of overlap between Scott s and my list however I think both lists provide a good overview of some of the great PHP bloggers out there and I know there are many more than are on these lists as pointed out by Chris In other news the PHP development team released PHP 5 1 3 earlier this week and shortly thereafter a user reported a critical bug with data in the POST array when submitting from a multi part form As of right now there is no official release update posted on the PHP downloads page but Chris provides a link to download the 5 1 4 source from a mirror I ve already compiled and updated from the new source and I encourage you to do the same UPDATE 5 5 06 4 30 UTC The PHP team has made an official announcement concerning the 5 1 4 release on

    Original URL path: https://benramsey.com/blog/2006/05/opml-reading-list-php-upgrade-notice/ (2016-04-26)
    Open archived version from archive

  • Comet Is the New Ajax, by Ben Ramsey
    data transfer between the Web browser and server Alex Russell who coined the term in his March 3rd blog post calls this style of event driven server push data streaming Comet though the term doesn t stand for anything unlike its cousin AJAX In short Comet applications maintain an open HTTP connection reducing the latency for data delivery The user no longer needs to take any action for updates to appear updates to a Web page can appear in real time sans any clicks or other form of user interaction It s hard to sometimes grasp what a technology does without a good reference point Alex lists several examples among which are GMail s GTalk integration Meebo and Renkoo 1 2 Thus far the most prominent implementation is chat through a Web browser but I think that some other uses are obvious data entry and reporting among teams of researchers Web based stock sites such as Scottrade Web based e mail applications groupware etc Anything that involves data that is ever changing and evolving would do well to take note of Comet Comet evokes the obvious scalability questions that come with any new technology like this and Alex addresses this briefly mentioning some server software for event driven IO I noticed that Renkoo uses one of these tools mod pubsub He also mentions that the Dojo toolkit already supports Comet via dojo io bind Again I saw that Renkoo uses this toolkit I ve also been able to take a look at Renkoo still in beta of which I must admit I was very skeptical about at first However after seeing how forward thinking they have been with their technology and how they ve managed to leverage as much of the coolness factor as possible into their service I think

    Original URL path: https://benramsey.com/blog/2006/05/comet-is-the-new-ajax/ (2016-04-26)
    Open archived version from archive

  • The Impending PHP Boom, by Ben Ramsey
    any indication that future is getting brighter and sunnier Jim lists some ways for up and coming PHP programmers to hone their skills and get noticed I d like to add one additional thing to it blog blog blog Start a blog and begin taking part in the PHP blogosphere by offering your opinions and experience to the PHP community In addition and perhaps more importantly read the blogs of other PHP developers A good place to start is to take a look at the blogroll on my home page It may take a while and generally in the PHP community it doesn t take very long but you will soon be noticed and potential employers will be able to find you easily through search engines as Jim suggested From my experience starting a blog about PHP is a quick and easy way to make connections and network with others You simply need to start and make it a regular habit to blog unlike the near silence I ve had over the past six months I think the number of PHP jobs will only grow over the next few years as middle to upper management folks begin to realize the

    Original URL path: https://benramsey.com/blog/2006/05/the-impending-php-boom/ (2016-04-26)
    Open archived version from archive

  • What's Good for Zend is Good for PHP, by Ben Ramsey
    is successful in convincing the Enterprise of PHP s scalability and power there will be jobs for PHP developers So now we come to the question of the PHP Collaboration Project which many are describing as the Zend PHP Framework Since June I have known that this framework was something that the folks at Zend were cooking up but at the time they were still unclear on how they wanted to approach it There seemed to be two sides to the coin as I understood it 1 the framework would be developed by Zend and used in Enterprise projects or 2 the framework would be developed at first by Zend for Enterprise grade applications and then released to the community as an open source project In either scenario Zend would be the major driving force in the development of the framework Yet agree with me or not Zend is committed to the PHP community and the PHP Group while at the same time their corporate goal is to encourage and drive PHP adoption in the Enterprise To fuse these two ideals it appears they have created the PHP Collaboration Project not to create a Zend PHP Framework but to foster the development of a community driven Enterprise grade framework Herein lies the core of what Zend is about Zend wants to remain true to the community and by connecting the community to the Enterprise with this collaborative project they solidify the relationship between the community and the Enterprise and ensure a future job market for PHP developers I laud Zend s commitment to the community and I commend them on their successes in advocating PHP to the Enterprise Both the community and Enterprise adoption are important to me and they should be important to you Far too often do I see a staunch commitment to the PHP community with an increasingly negative attitude towards the Enterprise This arises from people s varying philosophical beliefs and values but it is detrimental to the job market I for one cannot live without a job and if the Enterprise takes hold of PHP and starts using it with the same fervor they embraced Java then I can rest assured knowing that PHP will be around for many years and I will be able to easily find PHP jobs Still what does this mean for the core of the language How much influence will these large companies have on the community and how much push and pull will they be able to inject into the language development process I think this is a worry that is on many people s minds and I think it s a legitimate concern What pandora s box has Zend opened by involving the Enterprise with the community I think these concerns can be assuaged with one word or acronym rather PECL More and more core developers have been working to remove bloat from the PHP core and relegate it to PECL where it can live a satisfying life

    Original URL path: https://benramsey.com/blog/2005/10/whats-good-for-zend-is-good-for-php/ (2016-04-26)
    Open archived version from archive

  • AJAX W3C Standardization, by Ben Ramsey
    happen In short I have a shiny new job as an Engineer with Art Logic and that s all I ll say about that for now Now for the more interesting piece of this post as indicated by the title Apparently the Web APIs Working Group at the World Wide Web Consortium W3C published on April 5th a working draft for a forthcoming recommendation on the XMLHttpRequest object the JavaScript object that gives AJAX it s power The draft does not yet introduce any new features to XMLHttpRequest and serves merely to advance the purpose of the Web APIs WG which is to document existing APIs as well as develop new ones Nevertheless I think this is a great step forward for standardizing AJAX Currently developers must take into consideration both the now standard way of creating an XMLHttpRequest object var req new XMLHttpRequest and the MSIE way of creating one which was actually the first way of doing it though it uses Microsoft s ActiveX technology var req new ActiveXObject Microsoft XMLHTTP A standard would provide grounds for agreement between browser makers and developers Unfortunately as history has shown browser makers ahem Microsoft are wont to follow their own whims creating their own standards The working draft of the recommendation addresses this problem The XMLHttpRequest object is implemented today in some form by many popular Web browsers Unfortunately the implementations are not completely interoperable The goal of this specification is to document a minimum set of interoperable features based on existing implementations allowing Web developers to use these features without platform specific code In order to do this only features that are already implemented are considered In the case where there is a feature with no interoperable implementations the authors have specified what they believe to be the most

    Original URL path: https://benramsey.com/blog/2006/04/ajax-w3c-standardization/ (2016-04-26)
    Open archived version from archive



  •