From aa52a7aa4e9d64e0647a9852c933c56167dd7f0b Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Thu, 24 Oct 2024 19:51:57 +0300 Subject: [PATCH 1/5] Initial Why use PHP page --- include/layout.inc | 2 +- styles/why-use-php.css | 118 +++++++++++++++++ why-use-php.php | 289 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 408 insertions(+), 1 deletion(-) create mode 100644 styles/why-use-php.css create mode 100644 why-use-php.php diff --git a/include/layout.inc b/include/layout.inc index df947f4550..74ef7cf6ef 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -425,7 +425,7 @@ function site_header(string $title = 'Hypertext Preprocessor', array $config = [ global $MYSITE; $meta_image_path = $MYSITE . 'images/meta-image.png'; - $meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; + $meta_description = $config['description'] ?? "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; $defaults = [ "lang" => myphpnet_language(), diff --git a/styles/why-use-php.css b/styles/why-use-php.css new file mode 100644 index 0000000000..daae4329af --- /dev/null +++ b/styles/why-use-php.css @@ -0,0 +1,118 @@ +.block { + margin: 2rem auto 4.5rem; +} + +.block--grid { + display: grid; + grid-template-columns: 1fr 3fr; + grid-gap: 4rem; +} + +.title { + font-size: 2.5rem; + font-weight: 500; + white-space: nowrap; + margin-bottom: 1rem; + color: #000; + line-height: 1; +} + +.description { + color: #4b5563; +} + +.subtitle { + font-weight: 500; + margin-bottom: 0.5rem; +} + +.hero__body { + font-size: 1rem; + line-height: 1.75rem; +} + +.hero ul { + list-style: none; + padding: 0; + margin: 1.25rem 0; +} + +.hero ul li { + position: relative; + padding: 0 0 0 2.25rem; +} + +.hero ul li:before { + position: absolute; + top: 2px; + left: 0; + content: url('data:image/svg+xml,'); + width: 20px; + height: 20px; + display: inline-block; +} + +.cta { + text-align: center; + font-size: 1.2rem; + line-height: 1.75rem; + max-width: 900px; + margin: 4rem auto 0; +} + +.logo { + display: grid; + grid-template-columns: repeat(5, 1fr); + grid-gap: 1rem; +} + +.logo__item { + height: 100px; + break-inside: avoid; + box-shadow: #dddddd 0 .125rem .5rem; + border-radius: .25rem; + background: #F9F9F9; +} + +.cards { + display: grid; + grid-template-columns: repeat(2, 1fr); + grid-gap: 1rem; + margin: 2rem auto; +} + +.cards--3 { + grid-template-columns: repeat(3, 1fr); +} + +.card { + padding: 1.5rem; + break-inside: avoid; + box-shadow: #dddddd 0 .125rem .5rem; + border-radius: .25rem; + background: #F9F9F9; +} + +.card__title { + font-size: 1.5rem; + font-weight: 500; + margin-bottom: 1.5rem; +} + +.card__link { + margin-top: 0.5rem; + color: #4b5563; +} + +@media (max-width: 768px) { + .block { + margin: 2rem auto; + } + + .block--grid, + .cards { + display: flex; + flex-direction: column; + gap: 1rem; + } +} diff --git a/why-use-php.php b/why-use-php.php new file mode 100644 index 0000000000..ed08ac9a04 --- /dev/null +++ b/why-use-php.php @@ -0,0 +1,289 @@ + 'community', + 'description' => 'PHP is the ideal choice for web development. Learn about its speed, flexibility, and rich ecosystem. Explore PHP\'s capabilities in building websites, APIs, e-commerce platforms, and more. See why industry leaders trust PHP for their projects.', + 'css' => ['why-use-php.css'], +]); +?> + +
+
+
Why Use PHP?
+
+
+
+
Fast, Flexible, Pragmatic. Everywhere.
+
+ PHP is a general-purpose language that excels on the web. Here are some + compelling reasons to choose PHP: +
+
    +
  • Versatile and widely adopted
  • +
  • Extensive ecosystem of libraries and frameworks
  • +
  • Excellent performance and scalability
  • +
  • Strong community support
  • +
  • Cost-effective development
  • +
+ +
With PHP You Can Do More and Deliver Faster!
+
+
+
+ +
+
+
+
Mature and Stable
+
+
PHP has a rich history spanning over 29 years, resulting in:
+
    +
  • Fewer bugs due to extensive testing and refinement
  • +
  • Predictable release cycle
  • +
  • Stable API, ensuring backward compatibility
  • +
  • Regular security updates and audits
  • +
+
+
+
+
Fast and Efficient
+
+
PHP consistently ranks among the fastest server-side languages:
+
    +
  • Outperforms Python and Ruby in benchmarks
  • +
  • Built-in opcode caching for improved performance
  • +
  • Supports asynchronous programming with libraries like Swoole and ReactPHP
  • +
  • Has modern application servers for containerized applications: + FrankenPHP, RoadRunner
  • +
+
+
+
+
Rich Ecosystem
+
+
PHP boasts a thriving ecosystem that speeds up development:
+ +
+
+
+
+ +
+
+
Who Uses PHP
+
PHP powers some of the world's most popular websites and platforms
+
+
+ +
+
+ +
+
+
Success Stories
+
PHP continues to attract significant investments and power successful businesses:
+
+
+
+
+
Laravel
+
Raised $57M in Series A funding from Accel in 2023
+ +
+
+
Shopware (Symfony-based)
+
Secured $100M investment in 2022
+ +
+
+
Spryker
+
Raised $130M in 2020
+ +
+
+
WordPress parent company Automattic
+
Valued at $7.5B
+ +
+
+
+
+ +
+
What You Can Build with PHP
+ +
+
+
Websites and Web Applications
+
+

PHP offers developers a robust and versatile platform for building dynamic and scalable web + applications, empowered by its intuitive syntax, extensive libraries, and vibrant community support. + Laravel and Symfony stand as premier choices for building web applications, offering developers + robust + frameworks equipped with modern features, elegant design patterns, and comprehensive documentation + to + streamline development and ensure scalability and maintainability.

+
+
+
+
Frontend
+
+

We should add a sentence, or even a full section about "frontend" tools like Laravel Livewire and + Symfony Turbo and their benefits (UX as good as with JS heavy frameworks, easier to develop and to + maintain, better cache dynamics...). These tools are a large part of what makes PHP relevant + again.

+

I would also mention how these tools are part of the "no build" movement (Symfony AssetMapper + etc).

+
+
+
+
Data Processing
+
+

PHP offers a powerful suite of data processing tools, enabling developers to manipulate and analyze + data efficiently with its extensive libraries and functions. Leveraging PHP's intuitive syntax and + seamless integration with databases, developers can tackle complex data processing tasks + effectively, empowering them to extract valuable insights and drive informed decision-making + processes.

+
+
+
+
High-load Services
+
+

PHP excels in high-load environments and scales effortlessly:

+
    +
  • Powers some of the world's busiest websites
  • +
  • Designed as share-nothing architecture and scales horizontally out of the box.
  • +
  • Serverless by design and runs successfully on AWS Lambda (Bref: https://bref.sh/).
  • +
  • Good for microservices in conjunction with powerful application servers.
  • +
  • Perfect for “No PaaS Required” scenarios allowing you to save costs.
  • +
+
+
+
+
APIs
+
+

PHP stands as a reliable choice for developing APIs, offering a wealth of features and libraries such + as API Platform to streamline the process while ensuring + scalability and security. With its + extensive community support and seamless integration with databases and web servers, PHP empowers + developers to create robust APIs that facilitate smooth communication between applications and + enable efficient data exchange across platforms.

+
+
+
+
E-commerce
+
+

PHP dominates the e-commerce space:

+
    +
  • Powers platforms like WooCommerce, PrestaShop, Shopware, Adobe Commerce, and OpenMage.
  • +
  • Offers robust security features for handling sensitive data.
  • +
  • Integrates easily with payment gateways and shipping APIs.
  • +
+
+
+
+
AI and Machine Learning
+
+

PHP integrates well with AI and ML technologies:

+
    +
  • Interfaces with popular ML libraries through extensions
  • +
  • Supports data preprocessing and feature engineering
  • +
  • Enables deployment of ML models in web applications
  • +
  • Facilitates integration with cloud-based AI services
  • +
+
+
+
+
+ +
+
+
Who Develops PHP
+
PHP's development is driven by a passionate community:
+
+
+
+
+ +
Ensures PHP's long-term sustainability.
+
+
+
Corporate Sponsors
+
+ PHP is funded by corporate sponsors and governments. +
+
+
+
PHP Internals
+
Core developers who shape the language's future.
+
+
+
More than XXX global community
+
Many contributors and maintainers are volunteering.
+
+
+ +
+ By choosing PHP, you're selecting a mature, versatile, and well-supported language that + powers a significant portion of the web and continues to evolve to meet modern development needs. +
+
+
+ + From dbeb9df1b68a12d96ee063b7f2994667530d32cc Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Thu, 24 Oct 2024 23:06:59 +0300 Subject: [PATCH 2/5] Add logos and icons --- styles/why-use-php.css | 21 +++++++- why-use-php.php | 116 +++++++++++++++++++++++++++++++++-------- 2 files changed, 113 insertions(+), 24 deletions(-) diff --git a/styles/why-use-php.css b/styles/why-use-php.css index daae4329af..5ec6a01e5b 100644 --- a/styles/why-use-php.css +++ b/styles/why-use-php.css @@ -67,11 +67,20 @@ } .logo__item { - height: 100px; + display: flex; + align-items: center; + justify-content: center; + height: 80px; break-inside: avoid; box-shadow: #dddddd 0 .125rem .5rem; border-radius: .25rem; background: #F9F9F9; + padding: 0.5rem; +} + +.logo__item img { + max-width: 100%; + max-height: 100%; } .cards { @@ -104,6 +113,16 @@ color: #4b5563; } +.card__image { + height: 40px; + margin-bottom: 1rem; +} + +.card__image img { + max-width: 100%; + max-height: 100%; +} + @media (max-width: 768px) { .block { margin: 2rem auto; diff --git a/why-use-php.php b/why-use-php.php index ed08ac9a04..96881c59b2 100644 --- a/why-use-php.php +++ b/why-use-php.php @@ -96,29 +96,75 @@
@@ -131,6 +177,9 @@
+
+ Laravel +
Laravel
Raised $57M in Series A funding from Accel in 2023
+
+ Shopware (Symfony-based) +
Shopware (Symfony-based)
Secured $100M investment in 2022
+
+ Spryker +
Spryker
Raised $130M in 2020
+
+ WordPress parent company Automattic +
WordPress parent company Automattic
Valued at $7.5B