Skip to main content

Posts

Showing posts from 2016

Installing/Upgrading Drush on Ubuntu

Install composer globally: $ curl - sS https : //getcomposer.org/installer | php $ sudo mv composer . phar / usr / local / bin / composer Install drush globally (for your user), you can specify the version:   $ composer global require drush / drush : 7 . * Add the composer path to your path (in your *.bashrc* or *.zshrc* or other): export PATH = "$HOME/.composer/vendor/bin:$PATH"   While not recommended, Drush can easily be installed on Ubuntu by using Aptitude or apt-get. If you have sudo rights the quickest way to install Drush is from the Ubuntu repository: $ sudo apt - get install drush However, the version this currently will give you is 4.5 (using Ubuntu 12.04). Newer versions have many improvements so you should use Drush to upgrade itself to the latest stable: $ sudo drush dl drush -- destination = '/usr/share' Then you can check the update has been successful by executing: $ drush -- version You could also install Drush manuall

Installation of Drush for Drupal through composer

What is Drush ? Drush  is a command-line interface specifically made for dealing with Drupal. It provides a much faster management experience and is recommended if you are not afraid of using the command line. 1. Clone Drush master branch from git We want to get the master branch from the Drush github repository. This will be placed under “usr/local/lib” as a new folder named “drush”. Launch your Terminal and type: > cd /usr/local/lib/ > git clone --branch master https://github.com/drush-ops/drush.git if suppose after executing the above command , if it says "permission denied" you can just try getting permission or else just change the directory and install it over there for time being .... which solves your problem , but not a permanent solution  Note:-  2. Get composer Drush 8 requires composer to install, so you need to get that if you don’t have it already. We also want to move composer to /usr/local/bin/ so that it’s easier to use. > curl

How to Create a PDF file in Cakephp 2.0 using Fpdf

Step 1: Download FPDF folder from  http://www.fpdf.org/  . Step 2: Unzip the downloaded Fpdf file and name it “fpdf” or however you require and make sure that you use the same name while calling it. Step 3: Move the “fpdf” unzipped files to  your /app/Vendor directory within Cakephp. Now you should have the directory path as   /app/Vendor/fpdf. Step 4: Create a new Cakephp layout file for the pdfs. We will use this layout when serving a pdf to the client. Create a file called pdf.ctp inside of /app/View/Layouts. Add the following code to /app/View/Layouts/pdf.ctp Layout: /app/View/Layouts/pdf.ctp 1 2 3 4 <?php      header ( 'Content-Disposition: attachment; filename="downloaded.pdf"' ) ;      echo $content_for_layout ; ?> The header function above tells the browser that it is going to receive a file called download.pdf. If you want to change the name