Post is under moderationLove Circle - Can you break this ?Stream item published successfully. Item will now be visible on your stream.
Post is under moderationposted in php on 16th Mar, 2017
ORms are the fronters for data views in your opinion who are the contenders
PHP ORM's doctrine vs propel what do you think .. comments below
Codeigniter Vs CakePHP Vs Yii Vs Laravel
Codeigniter vs Yii
Codeigniter is a framework specially built for PHP developers. The framework provides a simple toolkit to create fully featured web applications. Codeigniter is a documented framework that helps in simplifying the process of development.
Here are some key advantages of using Codeigniter for PHP site development.
- Provides a rich set of libraries for common tasks
- The structure of the libraries is simple to understand and use
- Minimizes the amount of code needed for each task
- The framework is faster and more reliable than other frameworks
- It is a lightweight framework
- The framework help in easy removal of errors on the site
- Modular programs can be easily utilized using Codeigniter
- The platform is compatible across operating systems, servers and platforms
- Codeigniter developers are easily available and the project can be easily outsourced
Cake PHP vs Codeigniter
Cake PHP is a free and very useful development framework for PHP development. This too is a very popular development framework because of its features:
- It is a secure framework and helps in authenticating users with ease.
- The framework is easy to learn and helps in simplified development of applications
- The framework is useful for large sites and applications as it is an MVC driven framework
- The site location and configuration are all done by the framework automatically. One only has to connect the database.
- One of the key advantages of cake PHP is that it provides ready to use templates. This makes the process of web application development faster
- The framework is easy to manage and even a lesser experienced developer can work on it with ease.
- The framework provides custom testing features which makes the testing task quick and simple for developers.
Yii vs Codeigniter
Yii too is a lightweight development framework with powerful caching. The helps in creating faster sites as it uses the lazy loading technique.
- Yii performs much better than other platforms as far as number of requests it can take per second.
- The security features of yii include: Cross-site Scripting Prevention, Cross-site Request Forgery Prevention and Cookie Attack Prevention. The platform has an inbuilt authentication that helps in enhanced security of the website.
- Yii is a framework that this compatible with third party codes.
- One can use different kinds of widgets and extensions with this framework. The framework has an easy to use code structure and makes development easier and faster
- The framework has got useful caching features like memcache, APC, XCache and DB based page and segment caching
Laravel vs Yii performance
Laravel is a PHP framework purely meant for developing MVC based applications. It is an open source PHP framework is known to be the finest of the PHP frameworks. Here are some of the key advantages of developing with Laravel:
- Laravel helps with enforcing constraints between multiple database objects with the helps of an advanced query builder mechanism.
- The framework has an auto-loading facility and does not need manual maintenance and inclusion paths.
- The framework helps in generating new tools with the help of an LOC container.
- The framework provides an easy version control system that helps with simplified management of migrations.
- The laravel framework is fast and easy to setup and customize
Here is a feature based comparison among Yii vs CakePHP vs Codeigniter vs Laravel
Here is a chart that compares the popularity of the various PHP frameworks:
The bottom line of Codeigniter Vs CakePHP Vs Yii Vs Laravel war:
While finalizing your decision, let us remind you that it is never about the number of features that a particular PHP framework provides. It’s about the overall functionality of the specific framework and how the functionalities can be utilized within your web development project. Hence, choose one of the above mentioned PHP frameworks as per your project needs and save cost and time.Stream item published successfully. Item will now be visible on your stream.
Post is under moderationposted in weboga on 8th Mar, 2017
Question: I typically use wget to download files. On some systems, wget is not installed and only curl is available. Can you explain me with a simple example on how I can download a remote file using curl? Are there any difference between curl and wget?
Answer: On a high-level, both wget and curl are command line utilities that do the same thing.
- They both can be used to download files using FTP and HTTP(s).
- You can also send HTTP POST request using curl and wget
- However curl provides APIs that can be used by programmers inside their own code. curl uses libcurl which is a cross-platform library.
- wget is just a command-line tool without any APIs.
- Curl also supports lot more protocols that wget doesn’t support. For example: SCP, SFTP, TFTP, TELNET, LDAP(S), FILE, POP3, IMAP, SMTP, RTMP and RTSP.
- There is a major advantage of using wget. wget supports recursive download, while curl doesn’t.
The following example downloads the file and stores in the same name as the remote server.
The following example download the file and stores in a different name than the remote server. This is helpful when the remote URL doesn’t contain the file name in the url as shown in the example below.
wget -O taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701
More wget examples: The Ultimate Wget Download Guide With 15 Awesome Examples
$ curl -O http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 28 3762k 28 1085k 0 0 72771 0 0:00:52 0:00:15 0:00:37 54267
Option -O (upper-case O) is important. Without this, curl will start dumping the downloaded file on the stdout. Using -O, it downloads the files in the same name as the remote server. In the above example, we are downloading strx25-0.9.2.1.tar.bz2, so the downloaded file will also be the same name.
Instead of -O, you an also specify, “–remote-name” as shown below. Both are the same.
$ curl --remote-name http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2
While curl is downloading it gives the following useful information:
- % – The total % of the download that was completed as of now. When it gets to 100% the download is completed. In the above example, it has downloaded only 28% of the file.
- Total – The total size of the file
- Received – The total size of the file that was has been downloaded so far. In the above example, it has downloaded 1085k so far (out of 3762k total)
- Xferd – This will be used when you upload some files to the remote server. During upload, this will indicate the total size of the file that has been uploaded so far. Since we are downloading a file, in this example, this is 0.
- Average Speed Dload – This indicates the average download speed.
- AVerage Speed Upload – While uploading a file, this will indicate the average upload speed
- Time Total – This indicates the total time it will take to download (or upload) the whole file based on the current download (or upload) speed. In this example, it will take approximately a total of 52 seconds to download this file.
- Time Spend – The time curl has spent so far downloading (or uploading) the file. In this example, it has spent 15 seconds so far.
- Time Left – This is caculated based on “Time Total” – “Time Spent”.
- Current Speed – This indicates the current download/upload speed. Compare this with Average Spped Dload/UPload to see how fast or slow your system is downloading currently.
If you want to download the file and store it in a different name than the name of the file in the remote server, use -o (lower-case o) as shown below. This is helpful when the remote URL doesn’t contain the file name in the url as shown in the example below.
$ curl -o taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 50243 100 50243 0 0 170k 0 --:--:-- --:--:-- --:--:-- 400k
In the above example, there is no file name in the remote URL, it just calls a php script that passes some parameter to it. However, the file will be downloaded and saved as taglist.zip on your local system. Instead of -o, you an also specify, “–output”.
More curl examples: 15 Practical Linux cURL Command ExamplesStream item published successfully. Item will now be visible on your stream.
Post is under moderationposted in php on 8th Mar, 2017
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g.
vendor) inside your project. By default it does not install anything globally. Thus, it is a dependency manager. It does however support a "global" project for convenience via the global command.
- You have a project that depends on a number of libraries.
- Some of those libraries depend on other libraries.
- Enables you to declare the libraries you depend on.
- Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project).
See the Basic usage chapter for more details on declaring dependencies.
Composer requires PHP 5.3.2+ to run. A few sensitive php settings and compile flags are also required, but when using the installer you will be warned about any incompatibilities.
To install packages from sources instead of simple zip archives, you will need git, svn, fossil or hg depending on how the package is version-controlled.
Composer is multi-platform and we strive to make it run equally well on Windows, Linux and OSX.
Installation - Linux / Unix / OSX#
Downloading the Composer Executable#
Composer offers a convenient installer that you can execute directly from the commandline. Feel free to download this file or review it on GitHub if you wish to know more about the inner workings of the installer. The source is plain PHP.
There are in short, two ways to install Composer. Locally as part of your project, or globally as a system wide executable.
Installing Composer locally is a matter of just running the installer in your project directory. See the Download page for instructions.
The installer will just check a few PHP settings and then download
composer.pharto your working directory. This file is the Composer binary. It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things.
Now just run
php composer.pharin order to run Composer.
You can install Composer to a specific directory by using the
--install-diroption and additionally (re)name it as well using the
--filenameoption. When running the installer when following the Download page instructions add the following parameters:
php composer-setup.php --install-dir=bin --filename=composer
Now just run
php bin/composerin order to run Composer.
You can place the Composer PHAR anywhere you wish. If you put it in a directory that is part of your
PATH, you can access it globally. On unixy systems you can even make it executable and invoke it without directly using the
After running the installer following the Download page instructions you can run this to move composer.phar to a directory that is in your path:
mv composer.phar /usr/local/bin/composer
Note: If the above fails due to permissions, you may need to run it again with sudo.
Note: On some versions of OSX the
/usrdirectory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding:
mkdir -p /usr/local/bin.
Note: For information on changing your PATH, please read the Wikipedia article and/or use Google.
Now just run
composerin order to run Composer instead of
Installation - Windows#
Using the Installer#
This is the easiest way to get Composer set up on your machine.
Download and run Composer-Setup.exe. It will install the latest Composer version and set up your PATH so that you can just call
composerfrom any directory in your command line.
Note: Close your current terminal. Test usage with a new terminal: This is important since the PATH only gets loaded when the terminal starts.
Change to a directory on your
PATHand run the installer following the Download page instructions to download
Create a new
C:\bin>echo @php "%~dp0composer.phar" %*>composer.bat
Add the directory to your PATH environment variable if it isn't already. For information on changing your PATH variable, please see this article and/or use Google.
Close your current terminal. Test usage with a new terminal:
C:\Users\username>composer -V Composer version 1.0.0 2016-01-10 20:34:53
Now that you've installed Composer, you are ready to use it! Head on over to the next chapter for a short and simple demonstration.Stream item published successfully. Item will now be visible on your stream.