archive-com.com » COM » S » STUARTHERBERT.COM

Total: 477

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

Or switch to "Titles and links view".
  • Stuart on PHP - » Recommendations
    towards the end of this section the material starts to feel a bit rushed as if the author himself can t wait to get onto the clever features of phpMyAdmin that have yet to come If you re completely new to MySQL you might find the end of this section to be a little light on detail I hope the next edition of this book beefs these chapters up a bit Like most people I know my use of phpMyAdmin over the years has tended to stick with the basics creating and browsing tables I confess it s partly because I ve found the phpMyAdmin UI to be more and more clunky as time has gone by a throwback to the days before Google showed us just what could be done with Javascript and AJAX So the second half of the book which looks at the more advanced features of phpMyAdmin were ones I found very educational I had no idea for example that phpMyAdmin now includes an AJAX based Designer tool or that I can use phpMyAdmin to generate PDF documentation of my databases I found these chapters to be very detailed and informative although again towards the end of the second half of the book the chapters began to feel a little rushed in places to me Conclusion I have several new starters joining my team in June and it ll be interesting to see whether or not they find the book useful as they find their feet in their first job doing PHP web development One thing s for sure I ll have no hesitation in leaving this book out for them to read 4 comments Learning PHP Data Objects by Dennis Popel Posted by Stuart Herbert on October 22nd 2007 in Recommendations The folks at Packt Publishing sent me a copy of Dennis Popel s Learning PHP Data Objects to review I d never heard of Packt before and was intrigued They re a relatively new publisher with a growing range of books on PHP related topics and they remind me of what O Reilly was like when they first started out According to their About Us page they also pay a royalty direct to open source projects so sales from Dennis book should result in money coming the PHP Group s way What Does The Book Claim To Do The jacket of the book says that by reading the book you ll learn An overview of the technology Getting started with PDO Creating sample databases Different methods of creating connection strings Error handling prepared statements and handling rowsets Getting column metadata Setting connection parameters with examples Handling rowsets and different ways to retrieve multiple rows The book also includes a helpful appendix on PHP object oriented programming for readers who aren t familiar with using PHP this way My copy of the book doesn t include a CD with the code listings on and I wasn t able to find the code listings online to

    Original URL path: http://blog.stuartherbert.com/php/category/recommendations/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » book review
    your databases It feels like phpMyAdmin has been around forever Unfortunately it looks that way too at times In the post Google Maps world of AJAX enabled slick and efficient user interfaces phpMyAdmin s usefulness can be hampered by its Web 1 0 UI and by its continued reliance of manual configuration instead of a WordPress like admin panel Don t get me wrong phpMyAdmin is a good tool without equal atm but it s a workmanlike and functional tool that younger folks used to the Facebook world find a bit long in the tooth About The Book Marc s book is aimed both at folks new to MySQL and phpMyAdmin as well as experienced developers such as myself who aren t aware of the advanced features that have been added over the years The full chapter list is Introducing phpMyAdmin Installing phpMyAdmin Interface Overview First Steps Changing Data Changing Table Structures Exporting Structure and Data Importing Structure and Data Searching Data Table and Database Operations The Relational System Entering SQL Commands The Multi Table Query Generator Bookmarks System Documentation MIME Based Transformations Character Sets and Collations MySQL 5 0 Features MySQL Server Administration Troubleshooting and Support The first ten chapters cover the basics of using phpMyAdmin If you re new to phpMyAdmin these chapters will be very helpful to you and if you ve been using phpMyAdmin for years there s still little bits in here that you might not have been aware of before now I particularly like the way that these chapters often refer back to the configuration settings in phpMyAdmin s config file However towards the end of this section the material starts to feel a bit rushed as if the author himself can t wait to get onto the clever features of phpMyAdmin that have yet to come If you re completely new to MySQL you might find the end of this section to be a little light on detail I hope the next edition of this book beefs these chapters up a bit Like most people I know my use of phpMyAdmin over the years has tended to stick with the basics creating and browsing tables I confess it s partly because I ve found the phpMyAdmin UI to be more and more clunky as time has gone by a throwback to the days before Google showed us just what could be done with Javascript and AJAX So the second half of the book which looks at the more advanced features of phpMyAdmin were ones I found very educational I had no idea for example that phpMyAdmin now includes an AJAX based Designer tool or that I can use phpMyAdmin to generate PDF documentation of my databases I found these chapters to be very detailed and informative although again towards the end of the second half of the book the chapters began to feel a little rushed in places to me Conclusion I have several new starters joining my team in June and it

    Original URL path: http://blog.stuartherbert.com/php/tag/book-review/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » If Node.js Is So Hot, Then Where Is The Ecosystem?
    a link to http nodejs news com Regards Ian says May 21st 2012 at 12 23 pm Not the here s how to install it into a VPS type stuff but a Heroku Engine Yard like service targeted at Node JS How about heroku themselves https devcenter heroku com articles nodejs Ian says May 21st 2012 at 12 23 pm Not the here s how to install it into a VPS type stuff but a Heroku Engine Yard like service targeted at Node JS How about heroku themselves https devcenter heroku com articles nodejs Jef Claes says May 21st 2012 at 12 39 pm I can think of two pretty big hosters for node js Azure and AppHarbor Jef Claes says May 21st 2012 at 12 39 pm I can think of two pretty big hosters for node js Azure and AppHarbor jockl says May 21st 2012 at 12 55 pm There s an eco system for Node It s called hot air jockl says May 21st 2012 at 12 55 pm There s an eco system for Node It s called hot air Pete says May 21st 2012 at 12 56 pm What about Heroku s Cedar stack https devcenter heroku com articles nodejs Pete says May 21st 2012 at 12 56 pm What about Heroku s Cedar stack https devcenter heroku com articles nodejs alessioalex says May 21st 2012 at 1 02 pm Evert Node 0 6 x is stable and used in production just look at the official Node website for companies using it Stuart Node is just a few years old that s why there aren t many companies that offer Node hosting or offer but only private beta or such Most people use a VPS atm EC2 Linode etc P S Heroku also supports Node alessioalex says May 21st 2012 at 1 02 pm Evert Node 0 6 x is stable and used in production just look at the official Node website for companies using it Stuart Node is just a few years old that s why there aren t many companies that offer Node hosting or offer but only private beta or such Most people use a VPS atm EC2 Linode etc P S Heroku also supports Node Severin says May 21st 2012 at 1 04 pm Just fyi Heroku itself offers node js hosting Severin says May 21st 2012 at 1 04 pm Just fyi Heroku itself offers node js hosting Dave says May 21st 2012 at 1 05 pm Just use Heroku https devcenter heroku com articles nodejs Dave says May 21st 2012 at 1 05 pm Just use Heroku https devcenter heroku com articles nodejs Till says May 21st 2012 at 2 06 pm Heroku cedar stack has a paid option to host node js One process is always free but that s not node js specific Start 2 processes and you pay them We run multiple node js app s on Heroku s PaaS It s sweet and painless for the most part Till says May 21st 2012 at 2 06 pm Heroku cedar stack has a paid option to host node js One process is always free but that s not node js specific Start 2 processes and you pay them We run multiple node js app s on Heroku s PaaS It s sweet and painless for the most part Till says May 21st 2012 at 3 08 pm I totally forgot this but basically joyent s cloud is a good environment to run a node js service as well I m not referring to no de but their smartmachines It s not exactly node js only but they are a great environment to run node js in I ve used them to troubleshoot some issues in our applications since they are SmartOS Solaris based and dtrace is a first class citizen on that platform We haven t deployed in production there because all our applications run in EC2 and I didn t feel maintaining tools for different platforms Till says May 21st 2012 at 3 08 pm I totally forgot this but basically joyent s cloud is a good environment to run a node js service as well I m not referring to no de but their smartmachines It s not exactly node js only but they are a great environment to run node js in I ve used them to troubleshoot some issues in our applications since they are SmartOS Solaris based and dtrace is a first class citizen on that platform We haven t deployed in production there because all our applications run in EC2 and I didn t feel maintaining tools for different platforms chris tacy says May 21st 2012 at 3 14 pm I think the word hosting is somewhat problematic when we re talking about Node and the Google results kind of point to this If you search instead for Node PaaS you get a ton of results chris tacy says May 21st 2012 at 3 14 pm I think the word hosting is somewhat problematic when we re talking about Node and the Google results kind of point to this If you search instead for Node PaaS you get a ton of results Nihil says May 21st 2012 at 6 32 pm dotcloud com offers pretty good node js hosting service along with lots of other services Nihil says May 21st 2012 at 6 32 pm dotcloud com offers pretty good node js hosting service along with lots of other services JoshLeaves says May 21st 2012 at 10 16 pm DotCloud hosts Node js easily most all my projects in Node js are launched from DotCloud Okay that sounded spammy Sorry Stuart Herbert says May 23rd 2012 at 12 17 pm JoshLeaves thanks for the recommendation of dotcloud com Unfortunately I couldn t find any mention of Node JS support in their documentation so I m not comfortable recommending them to my customers for now Charlie Robbins says May 22nd 2012

    Original URL path: http://blog.stuartherbert.com/php/2012/05/21/if-node-js-is-so-hot-then-where-is-the-ecosystem/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » Advice To A Conference Virgin?
    time to meet with them Buying them lunch is the most worthwhile 20 you ll ever spend If there are no sessions at a time you re really interested in don t go to any of them Hang out in the hall track instead Preferably find the schedule in advance and email the above people to schedule time with them Donnie Berkholz says October 24th 2008 at 11 30 pm Never eat alone Always get together with either existing friends or new ones Find the big shots who you re interested in email them well in advance and try to set up a time to meet with them Buying them lunch is the most worthwhile 20 you ll ever spend If there are no sessions at a time you re really interested in don t go to any of them Hang out in the hall track instead Preferably find the schedule in advance and email the above people to schedule time with them Dave Marshall says October 25th 2008 at 11 21 am PHPNW will be my first conference although I m not sure I ll be able to meet the preconference social Anybody know how many people are going to the conference These things should let you upload a passport photo when you register people can then match faces to names they know in advance Dave Marshall says October 25th 2008 at 11 21 am PHPNW will be my first conference although I m not sure I ll be able to meet the preconference social Anybody know how many people are going to the conference These things should let you upload a passport photo when you register people can then match faces to names they know in advance terry chay says October 27th 2008 at 5 52 pm Find out the twitter to follow Set up search twitter com for the part you need phpc on irc freenode net approach speakers in between sessions if you have a question they don t bite mostly terry chay says October 27th 2008 at 5 52 pm Find out the twitter to follow Set up search twitter com for the part you need phpc on irc freenode net approach speakers in between sessions if you have a question they don t bite mostly Daniel Cousineau says October 27th 2008 at 6 28 pm I can second these suggestions ZendCon 08 was my first real if you don t count local BarCamps conference I attended and I made sure to be active on the phpc phpwomen channels a few days before as well as attend the pre conference pub crawl which really helped me meet new friends and get to know the community I also stayed active on the IRC channels and Twitter Thanks to me following essentially the same guidelines I made new friends and got the opportunity to sit down and hang out with a lot of really freaking cool and internet famous people Granted I m sure some of the

    Original URL path: http://blog.stuartherbert.com/php/2008/10/24/advice-to-a-conference-virgin/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » Using SimpleXML To Parse RSS Feeds
    for this parser It is really good The only probllem I have now it is ugly characters microsoft quotes etc for example â predatorsâ on my page should be predators How to fix it Thank you Bojan says December 18th 2007 at 5 26 pm Great stuff you helped me a lot with the CDATA children Gwyneth Llewelyn says February 16th 2008 at 3 27 am Thanks for the many precious tips This was pretty useful Glou says February 17th 2008 at 12 12 am Hello I don t understand i try it there http www spx be XML rss2 php5 but it s doesn t show Can you understand why Thanks Michael says February 22nd 2008 at 9 41 pm This info is very good Thanks for your works Vivek says February 25th 2008 at 1 24 pm Hi it s very useful Thanks Vivek says February 25th 2008 at 1 27 pm Can you use the same code for Atom feed also I guess not How do we tweak it to accept atom feed Dave says February 25th 2008 at 6 02 pm An excellent and very useful article especially with regards to retrieving information from namespaces Many thanks Karpacz Noclegi says March 16th 2008 at 3 30 pm Good work i It is very usefull i hope that i understand everything and Your advice will work php5 simplexml feed says April 1st 2008 at 7 37 am Using SimpleXML To Parse RSS Feeds Mike says May 10th 2008 at 5 11 pm Thanks for the code it s been a great help Another way to get the CDATA is to load the xml using xml simplexml load string rawFeed SimpleXMLElement LIBXML NOCDATA PHP 5 1 0 Then you just get the CDATA elements without complications See http us php net manual en function simplexml load string php Tristan Bailey says July 8th 2008 at 4 10 am Nice article and good to point out the limits of the documentation rather than just compete the example without it webborne says July 10th 2008 at 1 34 pm Man You just itched my scratch thanks for the article MTHarris Blogs Parsing XML with SimpleXML says July 10th 2008 at 2 12 pm refering to grabbing content from inside different namespaces Stuart Herbert on php using simpleXML to pull rss feeds seemed to have the same problem as I which was solved using a get children method slloyd says October 31st 2008 at 6 16 am Thanks a bunch for the great article It really helped me out Thanks Ian Rose says December 2nd 2008 at 11 22 pm Perfect Exactly what I needed to get to my encoded CDATA feed content Thanks a ton Fuzzy says December 5th 2008 at 10 38 pm the code is great thank you What i would like to do now is limit the number of entries shown on my webpage how would i do this please What i am trying to eventually do is once the articles are shown on the webpage a user can click a check box next to each article and then click a submit button which would save the article in a mysql database So i will have a table similar to ArticleID Title Link Description Date Body for body the whole article would be stored in there so somehow pull the data from the page in link and store that Any ideas Andy G says January 7th 2009 at 3 42 am Thanks for your help with solving this namespace issue Working great Tine Müller says January 21st 2009 at 12 01 pm Shouldn t it be possible to see YOUR blog on my site if I copy your code After changing all and to i uploaded the file but it s blank Should I change some of the code before it s functioning Tine Müller says January 26th 2009 at 11 01 am Why not also put the error code in your tutorial so us beginners can understand why the blog isn t showed please Whoila Blog Blog Archive Some useful information on parsing RSS 2 feeds says February 14th 2009 at 8 54 am http blog stuartherbert com php 2007 01 07 using simplexml to parse rss feeds Work at Home says April 16th 2009 at 2 52 am I just recently switched today from my hosted windows platform to linux I am not versed in php at all and of course all of my asp broke when I moved to linux My whole site revolves around a feed that I get from another site I was using an asp script and xsl to publish the feed I came upon your site in my search on Google I wanted to comment that this is filed under beginners and my gosh I am less than a beginner I don t quite understand all of this but I am reading the explanations a few times over I appreciate how detailed this article is Jack says May 19th 2009 at 8 52 pm Nice one Your post helped me a lot Richard Williams says May 24th 2009 at 5 23 pm Very good and needed article RSS can be parsed also using biterscripting I use biterscripting in addition to java Richard Gregg says June 12th 2009 at 4 17 pm Incredible writeup this will come in handy thank you for error handling be sure to do a try catch on creating new SimpleXMLElement object try xmlData new SimpleXMLElement rawFeed catch Exception e error handling in here Amy Varga says July 6th 2009 at 4 55 pm Very valuable information thank you so much swathi says July 25th 2009 at 9 29 am thanks a lot for this article very understandable Nicolas says September 12th 2009 at 10 40 am Your just god 4 hours i m looking for content encoded extraction Thanks Feyi says September 30th 2009 at 8 46 am Thanks Stuart I found your site from a

    Original URL path: http://blog.stuartherbert.com/php/2007/01/07/using-simplexml-to-parse-rss-feeds/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » Examples
    Then other package channels arrived and publishing your own PEAR package channel became really easy with Pirum Now you don t even need your own web server to host it you can host it on GitHub along with the source code for your PEAR package Now if we only can get some kind of PEAR channel aggregator or similar thing to avoid having to use channel discover for every new tool we want to install Footnotes The channel name must match the regular expression a zA Z0 9 a zA Z0 9 a zA Z0 9 You might want to turn off email notifications for successful page builds because the emails can easily pile up if you make many pushes Be the first to leave a comment PHP Components Shipping Web Pages With Your Components Posted by Stuart Herbert on August 16th 2011 in Examples phix Toolbox In my Beyond Frameworks talk I explained how a component based architecture can help answer some of the important i e expensive questions you might face when creating long lived apps that rely on a PHP framework In this series of blog posts I m going to look at how to go about creating and working with components I m now going under the bonnet of our components and looking at the different file roles that the PEAR installer expects to find when we distribute our component as a PEAR compatible package It isn t very often that a component needs to ship web pages too but should the need arise here s how to do it What Is A Web Page A web page the www file role supported by the PEAR Installer is any sort of content meant to be served up by web server software such as Apache This can be a HTML file a PHP script CSS files Javascript files images you name it Where Do Web Pages Go Inside Your Component s Structure If we look at the PhpInfo component you ll find that the web pages live in the src www folder src www is meant to be a folder that holds all of the web pages and related content that you want installed into the computer system Where Does The PEAR Installer Install The Web Pages When you use the PEAR installer to install your component pear install phix PhpInfo all of the web pages get installed into usr share php www on your computer The PEAR installer s behaviour here is almost identical to command line scripts the installer installs your web pages directly into the main www dir folder This does create the potential for clashes where two or more packages want to install files with identical names In practice PHP components include web pages so rarely that the problem is unlikely to happen The test file src www phpinfo php therefore ends up installed onto your computer as usr share php www phpinfo php There s always the possibility that some Linux distros and Mac OS X will install doc files into a different folder You can see where the PEAR installer will put these files on your computer by running sudo pear config show grep www dir PEAR www files directory www dir usr share php www How Do I Get Apache To Serve These Files By default and for very good reasons Apache does not serve content directly from usr share php www You will need to copy any files from usr share php www to your website folders normally found under var www before they can be used 8 comments PHP Components Shipping Unit Tests With Your Component Posted by Stuart Herbert on August 15th 2011 in Examples phix Toolbox In my Beyond Frameworks talk I explained how a component based architecture can help answer some of the important i e expensive questions you might face when creating long lived apps that rely on a PHP framework In this series of blog posts I m going to look at how to go about creating and working with components I m now going under the bonnet of our components and looking at the different file roles that the PEAR installer expects to find when we distribute our component as a PEAR compatible package One of the most important file roles allows you to ship your tests with your package and it s vital that this is something that you get in the habit of doing routinely Test Your Code And Ship Your Tests If you want other developers to re use your code in their projects it is essential that you earn their trust Trust has to be earned over time by establishing a track record of dependability There are many things you need to do to establish such a reputation such as semantic versioning to flag backwards compatibility breaks and writing unit tests to prove that your code works as expected Although the PEAR Installer has long supported shipping unit test code to date the PHP community hasn t really embraced this and it is still very rare for a PEAR package to include unit tests when downloaded This is also compounded by unfortunate legacy choices in some Linux distributions ubuntu bug fedora bug where unit test code currently ends up being installed under the same directory tree as the main code from the PEAR packages something that only really matters since the PHP Community started to adopt PSR 0 as the standard for autoloading What Are PHP Tests PHP tests the test file role supported by the PEAR Installer are executable tests There is currently no formal standard for these tests however PHPUnit has emerged as the community s de facto standard for unit tests and is the approach that the PHP components skeleton supports out of the box to make life much easier for you Just as important as shipping tests is making sure that it is extremely easy for someone who knows nothing about your code to safely and reliably execute any tests that you ship The components skeleton handles much of this for you by including a PHPUnit bootstrap php file and a build xml file with full instructions on how to execute the tests However it is important that you write your tests in a way that doesn t rely on anything that your users won t have installed or configured Where Do Tests Go Inside Your Component s Structure If we look at the CommandLineLibrary component you ll find that the unit test files live in the src tests unit tests folder Important notes The folder structure underneath src tests unit tests exactly matches the folder structure for both PHP scripts and PHP files under the src folder Each unit test script is designed for PSR 0 autoloading just like the PHP scripts that they test Each unit test script ends in the word Test This is a convention that is supported in IDEs such as Netbeans Where Does The PEAR Installer Install The Tests When you use the PEAR installer to install your component pear install phix CommandLineLib all of the test files get installed into usr share php tests package name on your computer The PEAR installer s behaviour here is different to both command line scripts and PHP code the installer creates a sub folder with the name of your package and then installs your test files into this sub folder and not into the main test dir folder This isn t a problem in practice as long as you are aware of the different behaviour here The test file src php unit tests Phix Project CommandLineLib CommandLineParserTest php therefore ends up installed onto your computer as usr share php tests CommandLineLib Phix Project CommandLineLib CommandLineParserTest php There s always the possibility that some Linux distros and Mac OS X will install doc files into a different folder You can see where the PEAR installer will put these files on your computer by running sudo pear config show grep test dir PEAR test directory test dir usr share php tests What About Other Kinds Of Test Code In the PHP component skeleton the src tests functional tests folder is available for anyone who wants to add any automated testing to prove that their app works Selenium is a tool that might help with this There s also the src tests integration tests folder available for anyone who wants to maintain a strict separation between unit tests which technically should prove that a single class works as required and integration tests which technically should prove that a collection of classes work together as required especially across system boundaries At the time of writing the component skeleton doesn t do anything with code inside these folders Patches are most welcome 10 comments PHP Components Shipping Documentation With Your Component Posted by Stuart Herbert on April 28th 2011 in Examples phix Toolbox In my Beyond Frameworks talk I explained how a component based architecture can help answer some of the important i e expensive questions you might face when creating long lived apps that rely on a PHP framework In this series of blog posts I m going to look at how to go about creating and working with components I m now going under the bonnet of our components and looking at the different file roles that the PEAR installer expects to find when we distribute our component as a PEAR compatible package Documentation is very important to your users but what you ship in your PEAR compatible package should really be just the bare minimum Documentation Is The Missing Feature I m sorry to report that there is currently a large gap when it comes to handling of documentation in PHP s PEAR driven packaged ecosystem There is no standard markup format s for documentation shipped in packages There is no standard structure to install a package s documentation into The PEAR installer does not gather up all of the installed documentation to generate a single PHP Manual style local website of all of the installed PEAR compatible packages This would be a killer feature for someone to create The PEAR installer does not auto generate PHPdoc compatible documentation from all of the installed PEAR compatible packages after installation The pear php net website hosts documentation for the PEAR project but at the time of writing this documentation isn t shipped with PEAR or PEAR compatible packages During the rehersals for my Beyond Frameworks talk my test audience was crystal clear about the importance of documentation The PHP Manual is undoubtedly one of PHP s killer features and it rightly sets a high standard for the documentation that developers should expect to both create and have provided to them The process and toolset for documenting PEAR compatible packages isn t yet a mature practice and there s definitely an opportunity for someone to step up and plug this gap This doesn t mean that it s a waste of time documenting your packages it just means that today you re better off including some documentation in your package and publishing the rest of the docs somewhere else What Are The Docs You Should Include In Your Package Every PHP component should as a minimum ship the following documentation inside the PEAR compatible package LICENSE txt what copyright and licensing terms apply to the package README txt general information about the package and where to find the package s main website The LICENSE txt file is absolutely essential it tells responsible developers whether or not they can legally use your work in their project and just as important it sets the scene for whether or not anyone can fork your component should you decide not to maintain it any more This file should contain the full text of the license If you are not sure which license to use the PHP ecosystem strongly prefers the new BSD license or the MIT license You should also include license details in your docblocks at the top of your source files that is a topic for later in the series The README txt file is also essential at the very least it tells developers where to go to find your component s website and full documentation If you publish your source code via GitHub you can write this file as README md using GitHub s flavour of Markdown and GitHub will automatically pick up the file and display it on your repository s homepage as an example see phix s homepage Quite a few existing PHP components also include a CREDITS txt file although some PHP components prefer to publish this information on their website instead Where Do Docs Go Inside Your Component s Structure If we look at the ComponentManagerPhpLibrary component you ll find that the essential documentation files actually live in the component s top level folder The component skeleton will automatically pick up any files in the top level folder that match the patterns txt or md Where Does The PEAR Installer Install The Docs When you use the PEAR installer to install your component pear install phix ComponentManagerPhpLibrary all of the documentation files get installed into usr share php docs package name on your computer The PEAR installer s behaviour here is different to both command line scripts and PHP code the installer creates a sub folder with the name of your package and then installs your doc files into this sub folder and not into the main doc dir folder This isn t a problem in practice as long as you are aware of the different behaviour here The doc file README md therefore ends up installed onto your computer as usr share php docs ComponentManagerPhpLibrary README md There s always the possibility that some Linux distros and Mac OS X will install doc files into a different folder You can see where the PEAR installer will put these files on your computer by running sudo pear config show grep doc dir PEAR documentation directory doc dir usr share php docs Okay So What Should We Do About Proper Documentation Anyone getting started with your component clearly needs a lot more documentation than a LICENSE and a basic README Unfortunately as discussed at the start of this article today the PEAR installer has poor support for shipping the sort of high quality in depth documentation that your users both expect and deserve For now the right thing to do is to publish your documentation on a website I m going to look at that in detail later in this series after I have finished looking at the rest of the file roles supported by the PEAR installer Be the first to leave a comment PHP Components Shipping Data Files With Your Components Posted by Stuart Herbert on April 11th 2011 in Examples phix Toolbox In my Beyond Frameworks talk I explained how a component based architecture can help answer some of the important i e expensive questions you might face when creating long lived apps that rely on a PHP framework In this series of blog posts I m going to look at how to go about creating and working with components I m now going under the bonnet of our components and looking at the different file roles that the PEAR installer expects to find when we distribute our component as a PEAR compatible package Although the vast majority of your components will simply be libraries of code sometimes you might need to ship data files for them to operate on Thanks to the PEAR installer s data role this is possible What Is A Data File A data file the data file role supported by the PEAR installer is an arbitrary file that your code either reads from or in the case of images et al serves up to other programs There are some important practices and limitations that you need to follow to avoid any disappointments or nasty surprises Data files should not be PHP code that you plan on executing Your users expect your code to be in the standard place which is usr share php for popular Linux systems or vendor php in the per app sandbox Follow the rule of no surprises and make sure you put your code where your users expect to look for it For example PEAR s HTTP2 Request component ships PHP code in its data folder code to rebuild the Public Suffix List which is itself a data file The chances are that most of HTTP2 Request s users are unaware that the data folder exists and that there is code in the data folder which they might need to use Another example is ezComponent s ConsoleTools which ships a UML diagram for ezComponents in its data folder This probably belongs in the docs folder if it is meant to be read by developers using ConsoleTools My local usr share php contains many more relevant examples yours probably does too Our component skeleton offers an alternative approach to ship generate list php a properly installed command line program or perhaps as a drop in command for phix Data files cannot be written to your code should treat them as read only When your data files are installed for system wide use the files are owned by the root user Unless there is an almighty security cock up your code will never ever actually get to run with the root user s security privileges If your code tries to write to these data files it will generate a runtime error But this won t show up when you unit test your code So remember and don t write the code in the first place Where Do Data Files Go Inside The Component s Structure If we take a look at the ComponentManagerPhpLibrary component you ll find the data files are inside in the src data folder These are the skeleton files

    Original URL path: http://blog.stuartherbert.com/php/category/examples/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » PHP NorthWest 2012 – Another Great Year
    next year s event See more of my photos from the PHPNW12 conference on Flickr About The Author Stuart has been writing PHP applications since 2003 and has been contributing to open source software since 1994 He was an early writer for php architect a co author of the Official Zend Certification Study Guide for PHP 4 and a regular speaker at conferences and user groups since 2004 When he s not designing software Stuart loves to explore the world through a camera lens spend time with his beloved guitars and continue his study to T ai Chi Chu an Taijiquan Comments are closed Latest Photos Categories phpnw 1 Beginner 2 Intermediate 3 Advanced Brighton PHP Conferences Opinion phix PHP In Business PSR Servers and Hosting Storyplayer Talks Toolbox Training Uncategorized Archives February 2016 January 2016 November 2015 October 2015 August 2015 March 2015 January 2014 May 2013 April 2013 March 2013 December 2012 November 2012 October 2012 September 2012 August 2012 July 2012 June 2012 May 2012 February 2012 January 2012 October 2011 September 2011 August 2011 July 2011 April 2011 March 2011 February 2011 October 2010 August 2010 July 2010 February 2010 January 2010 October 2009 September 2009 August 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 October 2008 September 2008 August 2008 June 2008 May 2008 April 2008 March 2008 January 2008 December 2007 November 2007 October 2007 July 2007 April 2007 March 2007 February 2007 January 2007 This Month October 2012 M T W T F S S Sep Nov 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Recent Posts How To Do Positive Code Reviews

    Original URL path: http://blog.stuartherbert.com/php/2012/10/08/php-northwest-2012-another-great-year/ (2016-05-02)
    Open archived version from archive

  • Stuart on PHP - » Using Git Collaboratively: My Tutorial At PHPNW12
    working at their own pace we needed to adopt a common way of working together with Git and GitHub so that the company continued to scale well It had to be a way that allowed every developer to take full advantage of Git especially when it comes to committing their work early and often It had to allow developers to form ad hoc teams that worked at their own pace Remote working is a fact of life these days and it had to work just as well whether everyone is in the office or working from somewhere else It also had to ensure that only work that had been finished made its way into any of our releases We wanted to make sure that there was an opportunity to review every change before it went into a release Code reviews play an important part in delivering high quality work time after time after time We didn t want pending releases to hold up new development ever And if something did screw up in production we needed a way to go back to our last known good version fix it and release that all without disrupting any pending releases or existing ad hoc teams Finally it had to be easy to teach to people who are new to Git and GitHub preferably by wrapping complicated Git operations up inside a single command each time Those are the benefits that HubFlow gives us And at phpnw12 I ll be teaching everyone who attends my tutorial session how to get those benefits too What makes me qualified to teach this topic And what makes me qualified to be teaching at all I ve got 18 years of experience setting up and or running software configuration management taking in systems as diverse as RCS CVS Perforce Continuus Clearcase Subversion Mercurial and Git I ve done this with and for organisations as small as a one man team all the way through to large international corporates I ve even built a version control system for one company in the past Git is much better And I was around long enough to see and learn from the failures as well as the successes I m a big believer that success teaches you a bit but failure teaches you more Plus I m the author of the HubFlow strategy and the maintainer of the HubFlow extension for Git It simply isn t possible for me to distill all of that rich and lengthy experience down into the documentation that I ve written for HubFlow I think the documentation is good I wouldn t have put my name to it otherwise but I think you can learn even more from me in person I m a qualified teacher of adults I m trained how to teach and I ve had a lot of practice doing so My first PHP conference appearance was back in 2004 on Marco s php cruise and since then I ve spoken at the

    Original URL path: http://blog.stuartherbert.com/php/2012/09/13/using-git-collaboratively-my-tutorial-at-phpnw12/ (2016-05-02)
    Open archived version from archive



  •