#symfony tips and tricks
Explore tagged Tumblr posts
kashinfosolutions1 · 5 months ago
Text
In this blog, I’ll share key Symfony tips and tricks to help you maximise the framework’s potential, speed up development, and leverage its powerful features for building custom applications.
1 note · View note
symfonie-yarns · 1 year ago
Text
Seasonal Color Palettes for Baby Garments
Do you want to create beautiful outfits for your little ones? If so, then you are at the right place. Check Symfonie Yarns’ website and find marvelous seasonal color palettes for baby garments and learn basic tips and tricks on how to choose beautiful colors. For details visit the link: https://www.symfonieyarns.com/seasonal-color-palettes-for-baby-garments
0 notes
symfonieyarns · 1 year ago
Text
How to Improve Your Crochet Skills – Tips and Tricks
Improve your crochet skills with expert tips. Invest in quality tools and hand-dyed Symfonie Yarns. Master basics, practice patterns regularly, and control yarn tension (you can make a neat and uniform crochet fabric by controlling yarn tension- not too tight and not too loose). Experiment with textured stitches and techniques like magic circle. Stay inspired and creative to transform yarn into masterpieces.
Read full blog here: 
0 notes
iterongroup-blog · 7 years ago
Link
FRAMEWORK EXPERTISE
Symfony
Laravel
Drupal
Joomla
CakePHP
Zend
OFFERINGS
Application Integrations
Mobile Integration
Legacy Migration
Upgrades
Database Performance Tuning
UI / UX Expertise
SOLUTIONS
Agile Custom web development
Open source web developments
Website Maintenance and Suport
E-Commerce Portals
Payment Gateway & Social Media Integration
Content Management System
Get your free proof of concept
0 notes
t-baba · 7 years ago
Photo
Tumblr media
Building an Image Gallery Blog with Symfony Flex: the Setup
This post begins our journey into Performance Month's zero-to-hero project. In this part, we'll set our project up so we can fine tune it throughout the next few posts, and bring it to a speedy perfection.
Now and then you have to create a new project repository, run that git init command locally and kick off a new awesome project. I have to admit I like the feeling of starting something new; it's like going on an adventure!
Lao Tzu said:
The journey of a thousand miles begins with one step
We can think about the project setup as the very first step of our thousand miles (users!) journey. We aren't sure where exactly we are going to end up, but it will be fun!
We also should keep in mind the advice from prof. Donald Knuth:
Premature optimization is the root of all evil (or at least most of it) in programming.
Our journey towards a stable, robust, high-performance web app will start with the simple but functional application --- the so-called minimum viable product (MVP). We'll populate the database with random content, do some benchmarks and improve performance incrementally. Every article in this series will be a checkpoint on our journey!
This article will cover the basics of setting up the project and organizing files for our Symfony Flex project. I'll also show you some tips, tricks and helper scripts I'm using for speeding up the development.
What Are We Building?
Before starting any project, you should have a clear vision of the final destination. Where are you headed? Who will be using your app and how? What are the main features you're building? Once you have that knowledge, you can prepare your environment, third-party libraries, and dive into developing the next big thing.
In this series of articles, we'll be building a simple image gallery blog where users can register or log in, upload images, and create simple public image galleries with descriptions written in Markdown format.
We'll be using the new Symfony Flex and Homestead (make sure you've read tutorials on them, as we're not going to cover them here). We picked Flex because Symfony 4 is just about to come out (if it hasn't already, by the time you're reading this), because it's infinitely lighter than the older version and lends itself perfectly to step-by-step optimization, and it's also the natural step in the evolution of the most popular enterprise PHP framework out there.
All the code referenced in this article is available at the GitHub repo.
We're going to use the Twig templating engine, Symfony forms, and Doctrine ORM with UUIDs as primary keys.
Entities and routes will use annotations; we'll have simple email/password based authentication, and we'll prepare data fixtures to populate the database.
Getting Started with the app
To try out the example we've prepared, do the following:
Set up an empty database called "blog".
Clone the project repository from GitHub.
Run composer install.
If you now open the app in your browser, you should see an exception regarding missing database tables. That's fine, since we haven't created any tables so far.
Update the .env file in your project root directory with valid database connection string (i.e., update credentials).
Run the database init script ./bin/refreshDb.sh and wait until it generates some nice image galleries.
Open the app in your browser and enjoy!
After executing bin/refreshDb.sh you should be able to see the home page of our site:
Tumblr media
You can log in to the app with credentials [email protected] and password 123456. See LoadUserData fixture class for more details regarding generated users.
Starting from scratch
In this section, we'll describe how to set up a new project from scratch. Feel free to take a look at the sample app codebase and see the details.
After creating a new project based on symfony/skeleton by executing the command
composer create-project "symfony/skeleton:^3.3" multi-user-gallery-blog
… we can first set minimum stability to "dev" because of some cutting edge packages:
composer config minimum-stability dev
… and then require additional packages (some of them are referenced by their aliases, the new feature brought by Flex):
composer req annotations security orm template asset validator ramsey/uuid-doctrine
Dependencies used only in the dev environment are required with the --dev flag:
composer req --dev fzaninotto/faker doctrine/Doctrine-Fixtures-Bundle
Flex is doing some serious work for us behind the scenes, and most of the libraries (or bundles) are already registered and configured with good-enough defaults! Check the config directory. You can check all the dependencies used in this project in the composer.json file.
Routes are defined by annotations, so the following will be automatically added into config/routes.yaml:
controllers: resource: ../src/Controller/ type: annotation
Database, Scripts and Fixtures
Configure the DATABASE_URL environment variable (for example, by editing the .env file) to set up a working DB connection. If you're using our own Homestead Improved (recommended), you've got a database set up called homestead with the user / pass homestead / secret. A DB schema can be generated from existing entities by executing:
./bin/console doctrine:schema:create
If this doesn't run, try executing the console by invoking the PHP binary, like so:
php bin/console doctrine:schema:create
If this step executed fine in the "Getting Started with the app" section above, you should be able to see newly created tables in the database (for Gallery, Image and User entities).
If you want to drop the database schema, you can run:
./bin/console doctrine:schema:drop --full-database --force
Fake it 'til you make it!
I can't imagine developing an app today without having data fixtures (i.e., scripts for seeding the DB). With a few simple scripts, you can populate your database with realistic content, which is useful when it comes to rapid app development and testing, but it's also a requirement for a healthy CI pipeline.
I find the Doctrine Fixtures Bundle to be an excellent tool for handling data fixtures as it supports ordered fixtures (i.e., you can control the order of execution), sharing objects (via references) between scripts, and accessing the service container.
Default Symfony services configuration doesn't allow public access to services, as best practice is to inject all dependencies. We'll need some services in our fixtures, so I'm going to make all services in App\Services publicly available by adding the following to config/services.yaml:
App\Service\: resource: '../src/Service/*' public: true
I'm also using Faker to get random but realistic data (names, sentences, texts, images, addresses, …).
Take a look at the script for seeding galleries with random images to get a feeling of how cool this combination is.
Usually, I combine commands for dropping the existing DB schema, creating the new DB schema, loading data fixtures, and other repetitive tasks into a single shell script --- for example, bin/refreshDb.sh --- so I can easily regenerate the schema and load dummy data:
# Drop schema ./bin/console doctrine:schema:drop --full-database --force # Create schema ./bin/console doctrine:schema:create # Load fixtures ./bin/console doctrine:fixtures:load -n --fixtures src/DataFixtures/ORM # Install assets ./bin/console assets:install --symlink # Clear cache ./bin/console cache:clear
Make sure you restrict execution of this script on production, or you're going to have some serious fun at one point.
One can argue that randomly generated data can't reproduce different edge cases, so your CI can sometimes fail or pass depending on the data generation. It's true, and you should make sure all edge cases are covered with your fixtures.
Every time you find an edge case causing a bug, make sure you add it to data fixtures. This will help you build a more robust system and prevent similar errors in the future.
The post Building an Image Gallery Blog with Symfony Flex: the Setup appeared first on SitePoint.
by Zoran Antolovic via SitePoint https://ift.tt/2ymuK8X
0 notes
symfonie-yarns · 1 year ago
Text
A Comprehensive Guide To Fiber Care And Maintenance
Preserving the beauty and longevity of handmade knitted and crocheted treasures is crucial. The content offers detailed guidance on caring for different yarn fibers, laundering techniques, drying methods, storage tips, and unique tricks like freezing sweaters to refresh them without washing. Following these comprehensive instructions ensures cherished handmade pieces remain in pristine condition for years.
URL: https://symfonieyarnscom.wixsite.com/symfonie-yarns/post/how-to-take-care-of-your-knit-and-crochet-projects
0 notes
t-baba · 8 years ago
Photo
Tumblr media
Web App Performance Testing with Siege – Plan, Test, Learn
Building a simple web application today isn’t that hard. The web development community is friendly, and there are lots of discussions on Stack Overflow or similar platforms, and various sites with lessons and tutorials.
Almost anyone can build an app locally, deploy it to a server, and proudly show it to your friends. I hope you’ve already done all of this, and your project went viral, so you’re obviously here because you want to learn how to make sure your app is ready for some high traffic.
If we think about a web app as a black box, things are quite simple - the app waits for a request, processes it, and returns the response presentation of a resource (HTML, JSON, XML, etc.). One could think: “Yeah, that’s simple, we should be able to scale our app with ease.” Sadly, the world of web development ain't all sunshine and rainbows, and you’ll encounter a lot of performance issues while your traffic grows! You will learn and improve both your skills and the app over time. In this article, designed to speed this process up, I will cover the basic concepts of testing the app (regression, load, and stress testing) with Siege and some tips and tricks I like to use when I’m testing my own web apps.
The Types of Testing
Let’s say we want to achieve the daily goal of 1 million unique users. How should we prepare for that amount of traffic? How do we make sure nothing will break under normal traffic or peaks? This type of testing is called load testing, since we know exactly how much traffic we want our app to endure - the load. If you want to push your app to its limits and beyond until it breaks, you’re stress testing your app.
In addition to those, are you aware of how code changes you’ve deployed might affect performance? One simple update can degrade or improve the performance of a high traffic web app to a large extent, and you won’t even know what happened or why until the storm is over. To make sure an app is performing the same before and after a change, we’re doing regression testing.
Another great motivation for regression testing is infrastructure change: for whatever reason, you might want to move from provider A to provider B (or switch from Apache to Nginx). You know that your app is usually handling N requests per minute (on average) and what its normal traffic is (a quick look at analytics would do the job). You’re expecting that your app will behave the same (or better) once deployed provider B's server. Are you sure, though? Would you take that risk? You already have all the data you need, don’t guess! Test your new setup before deploying and sleep better!
Before you start randomly hitting your app with virtual requests, you should know that testing is not an easy job, and the numbers you’ll get from Siege or any other testing tool should be used as a reference to analyze relative changes. Running both Siege and the app locally for five minutes and concluding your app can handle a few hundred or thousand requests within a few seconds is not something I’d recommend.
The Steps for Successful Testing
Plan
Think about what you want to test. and what you expect. How much traffic, on which URLs, with what payload? Define parameters up front, don’t just randomly hit your app.
Prepare
Make sure your environments are as isolated as possible - use the same environment for testing, for every test run. A good guide on how to accomplish this can be found in this book about setting up PHP environments.
Analyze and Learn
Learn something from the numbers and make educated decisions. Results should always be evaluated within their context - don’t jump to conclusions. Check everything at least twice.
Getting started with Siege
Siege is an awesome tool for benchmarking and testing web apps. It simulates concurrent users requesting resources at a given URL (or multiple URLs) and lets the user heavily customize the testing parameters. Run siege --help to see all available options; we’ll cover some of them in detail below.
Preparing the test app
With Siege, you can test an app's stability, performance, and improvements between code (or infrastructure) changes. You can also use it to make sure your Wordpress website can handle the peak you’re expecting after publishing a viral photo of a cat, or to set up and evaluate the benefits of an HTTP cache system such as Varnish.
For the tests in this article, I will be using a slightly modified Symfony Demo application deployed to one Digital Ocean node in Frankfurt, and SIEGE 4.0.2 installed on a second Digital Ocean node in New York.
As I said earlier, it’s crucial to have both the app and test server isolated whenever possible. If you’re running any of them on your local machine, you can’t guarantee the same environment because there are other processes (email client, messaging tools, daemons) running which may affect performance; even with high quality virtual machines like Homestead Improved, resource availability isn't 100% guaranteed (though these isolated VMs are a valid option if you don't feel like spending money on the load testing phase of your app).
The Symfony Demo application is pretty simple and fast when used out of the box. In real life, we’re dealing with complex and slow apps, so I decided to add two modules to the sidebar of a single post page: Recent posts (10 latest posts) and Popular posts (10 posts with most comments). By doing so, I’ve added more complexity to the app which is now querying the DB at least three times. The idea is to get as real a situation as possible. The database has been populated with 62,230 dummy articles and ~1,445,505 comments.
Continue reading %Web App Performance Testing with Siege – Plan, Test, Learn%
by Zoran Antolovic via SitePoint http://ift.tt/2rDQ459
0 notes