Your SlideShare is downloading. ×
Why is PHP Awesome
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Why is PHP Awesome

5,559
views

Published on

University of Manchester: COMP101 Guest Lecture Monday 10th March, 11am Kilburn LT1.1 …

University of Manchester: COMP101 Guest Lecture Monday 10th March, 11am Kilburn LT1.1

This talk will argue that PHP's bad reputation is a thing of the past and look at where and how PHP is used in the wild. We will describe some really useful tools and libraries which people can take away and play with. We will touch on the jobs market for PHP, agency working and how to get involved. We will finally talk about the huge community for PHP around the world but also specifically in Manchester.

Speaker Biographies: Steph Cook @steph_cook22 and Damien Walsh @themainframe are web developers @magma_digital and recent graduates of @csmcr. Jeremy Coates @phpcodemonkey is the Managing Director of Magma Digital, the leading software development agency in Lancashire.

Published in: Technology

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,559
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
16
Comments
0
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Why PHP Is Awesome Honest. @magma_digital
  • 2. The Team @magma_digital
  • 3. Speaking today Jeremy Coates @phpcodemonkey @magma_digital Steph Cook @stephcook22 Damien Walsh @themainframe
  • 4. “PHP is used by 81.8% of all the websites whose server-side programming language we know.” – w3techs.com @magma_digital
  • 5. @magma_digital
  • 6. So why the reputation @magma_digital
  • 7. PHP has moved on. @magma_digital
  • 8. The dark ages… @magma_digital
  • 9. //genearate a filename...
 $fn_temp = preg_replace("/[^a-zA-Z0-9s]/", "", $_POST[‘f_n’]); Magic strings… //Does it exist?
 while(file_exists("/home/cocoder/.data/{$fn_temp}{$n}/"))
 $n++; ?>
 <h1>Project Created!</h1> 
 <?php
 Suddenly… HTML 
 //DB...
 $return_id = cc_core::make_project(
 $_POST['n_name'],
 i ($fn_temp.$n),
 $_SESSION['user_id']
 );
 
 ?> @magma_digital Highly procedural
  • 10. Now… @magma_digital
  • 11. public function editAction(Request $request)
 {
 $this->form->handleRequest($request);
 $entity = $this->form->getData(); Interact with Model if ($this->form->isValid()) {
 $this->em = $this->doctrine->getManager();
 $this->em->persist($entity);
 $this->em->flush();
 }
 
 } return $this->render(
 ‘TestBundle:Items:edit.html.twig',
 array(
 'entity' => $entity,
 'form' => $this->form->createView()
 )
 );
 @magma_digital Render View
  • 12. The cool stuff To make your projects easier @magma_digital
  • 13. @magma_digital
  • 14. Composer curl -sS https://getcomposer.org/installer | php @magma_digital
  • 15. Composer composer.json: {
 "require": {
 "monolog/monolog": "1.2.*"
 }
 } @magma_digital
  • 16. Composer include include include include include @magma_digital ‘classes/Foo.class.php’;
 ‘classes/Bar.class.php’;
 ‘classes/OtherStuff.class.php’;
 ‘classes/MyClass.class.php’;
 ‘classes/AnotherClass.class.php’;
  • 17. Composer include ‘vendor/autoload.php’; ...
 
 $foo = new Foo(); @magma_digital
  • 18. Silex @magma_digital
  • 19. Silex composer.json: {
 } @magma_digital "require": {
 "silex/silex": "~1.1"
 }

  • 20. Silex Fire up composer. require_once __DIR__ . '/../vendor/autoload.php'; $app = new SilexApplication(); Create the App $app->get('/hello/{name}', function($name) use($app) { return 'Hello '.$app->escape($name); }); $app->run(); @magma_digital Be safe! Run it. Add a route
  • 21. Twig @magma_digital
  • 22. Twig <ul> {% for user in users %}
 <li> {{ user.name }} </li>
 {% else %}
 <li>
 <strong>No users have been found.</strong>
 </li>
 {% endfor %} </ul> @magma_digital
  • 23. @magma_digital
  • 24. Xdebug! Install the extension Install the browser extension Setup for integration with IDE (NetBeans, PHPStorm) Press Play Refresh your page Profit @magma_digital
  • 25. Codeception @magma_digital
  • 26. Codeception $I = new WebGuy($scenario);
 $I->wantTo('create a wiki page');
 $I->amOnPage('/');
 $I->click('Pages');
 $I->click('New');
 $I->see('New Page'); @magma_digital
  • 27. Full Stack Frameworks Symfony2 & Zend Framework 2 @magma_digital
  • 28. @magma_digital
  • 29. @magma_digital
  • 30. Types of Projects @magma_digital
  • 31. @magma_digital
  • 32. Manchester Digital has revealed that 32% of digital organisations in the region were forced to refuse work in 2013 due to a lack of resource, despite 83% of businesses experiencing growth. @magma_digital
  • 33. Get involved! @magma_digital
  • 34. @magma_digital
  • 35. PHPNW @magma_digital
  • 36. Have we convinced you yet @magma_digital
  • 37. All resources over here:! http://bit.ly/phpawesome @magma_digital