Search

Rahul Rajoria

Web Developer || Techspawn Solution

PHP 7

PHP 7Are you looking for the latest status, news, articles, features or updates about the newest version after PHP 5.X? After a long voting process by the community, the name for the next major PHP version has been finalized! The winning proposal is to call the latest major version PHP 7.
So here’s the top 5 things you must know about PHP 7!
1:  THE LATEST PHP VERSION WILL BE RELEASED LATER THIS YEAR

The PHP 7 Timeline RFC was approved in a near unanimous vote, and aims to release PHP 7 in October 2015. Even if it’s delayed a bit, we’re still likely to see it before the year is out!! The final feature set for PHP 7 is almost completely finalized, and will officially close by the end of March.
See the PHP 7 timeline

2 : PHP SPACE SHIPS

080326-lynx-flying-02

PHP 7 will introduce a new operator <=> conveniently similar to a TIE fighter and dubbed the Spaceship Operator. It can be used for combined comparisons – mostly when dealing with sorting.
See more info

3: DECLARATIONS & SCALER TYPE HINTS

php7-scalar-type-hints-return-types-8-638

PHP 7 will allow developers to declare what kind of return type a function is expected to have – similar to argument Type Hints.

In addition, argument type hints and the new return-type declarations now support new scalar types, allowing developers to denote that they’re expecting strings, floats, ints or bools to be passed or returned.

4: PHP 7 PERFORMANCE

performance

PHP 7 is based on the PHPNG project (PHP Next-Gen), that was led by Zend to speed up PHP applications. The performance gains realized from PHP 7 are huge! They vary between 25% and 70% on real-world apps, and all of that just from upgrading PHP, without having to change a single line of code!

5: PHP 7 IS 2X FASTER

A6-faster

Since PHPNG was open sourced and later merged into PHP 7, its performance more than doubled in many cases, and we’re continuing to improve it all the time.

To put things in perspective – when PHPNG was published, the WordPress homepage required approx. 9.4 billion CPU instructions to execute.  As of now – it requires only 2.6 billion – that’s 72% less!

SOLR Configuration with Magento

Step By Stem Integration of SOLR on system With Magento Site :

Things we nedded :

1. JAVA Development Kit (JDK)

2. PHP

3. Apache Server

4. Solr extension (From Magento Connect )

If you are using Linix :

First open the Terminal :

Type :

rahul@rahul:~$ java -version (To check java is install or not ).

If not available then :

Follow this step ono by one :

rahul@rahul:~$ sudo rm /var/lib/dpkg/info/oracle-java7-installer*

rahul@rahul:~$ sudo apt-get purge oracle-java7-installer*

rahul@rahul:~$ sudo rm /etc/apt/sources.list.d/*java*

rahul@rahul:~$ sudo apt-get update

rahul@rahul:~$ sudo apt-get update

rahul@rahul:~$ sudo add-apt-repository ppa:webupd8team/java

rahul@rahul:~$ sudo apt-get install oracle-java7-installer

rahul@rahul:~$ java -version

Result :

rahul@rahul:~$ java version “1.7.0_04”

rahul@rahul:~$ Java(TM) SE Runtime Environment (build 1.7.0_04-b20)

rahul@rahul:~$ Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

Now we have install java Successfully ;

Now come to apache server :

Install Apache server if not installed :

for 32-bit:

Type this on terminal or cmd :

rahul@rahul:~$ wget http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/xampp-linux-1.8.3-2-installer.run/download

For 64-bit:

rahul@rahul:~$ wget http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/xampp-linux-x64-1.8.3-2-installer.run/download

Now go to the download folder and rename the download file to :

xampp-linux-x64-1.8.3-2-installer.run

rahul@rahul:~$ sudo chmod +x xampp-linux-x64-1.8.3-2-installer.run

rahul@rahul:~$ sudo ./xampp-linux-x64-1.8.3-2-installer.run

To stop the XAMPP service:

rahul@rahul:~$ sudo /opt/lampp/lampp stop

To start the XAMPP service:

rahul@rahul:~$ sudo /opt/lampp/lampp start

Now we have install Lampp on our local server ;

still having any problem so visit :

http://ubuntuportal.com/2013/12/how-to-install-xampp-1-8-3-for-linux-in-ubuntu-desktop.html

Now we will install SOLR Server :

Download it from here : Download

Next unzip the package:

unzip solr-4.10.4.zip

Move newly created directory to /opt

Type this command on Terminal :

rahul@rahul:~$ sudo mv solr-4.10.4 /opt/

rahul@rahul:~$ cd /opt/solr-4.10.4/example/

if getting error bash permission denied or file directory not found, then provide permission to opt

by typing :

rahul@rahul:~$ sudo chmod 777 ‘/opt’ -R

rahul@rahul:~$ cd /opt

rahul@rahul:/opt$ cd solr

rahul@rahul:/opt/solr$ cd example

rahul@rahul:/opt/solr/example$ java -jar start.jar

Now it will show like this ;

4146 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.search.SolrIndexSearcher – Opening Searcher@5bcfdbdb[collection1] main

4152 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.rest.ManagedResourceStorage – File-based storage initialized to use dir: /opt/solr/example/solr/collection1/conf

4152 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.rest.RestManager – Initializing RestManager with initArgs: {storageDir=/opt/solr/example/solr/collection1/conf}

4163 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.rest.ManagedResourceStorage – Reading _rest_managed.json using file:dir=/opt/solr/example/solr/collection1/conf

4189 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.rest.ManagedResourceStorage – Loaded LinkedHashMap at path _rest_managed.json using file:dir=/opt/solr/example/solr/collection1/conf

4190 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.rest.ManagedResource – Loaded initArgs {} for /rest/managed

4190 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.rest.RestManager – Initializing 0 registered ManagedResources

4191 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.handler.component.SpellCheckComponent – Initializing spell checkers

4199 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.handler.component.SpellCheckComponent – Registering newSearcher listener for spellchecker: default

4199 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.handler.component.SpellCheckComponent – No queryConverter defined, using default converter

4213 [searcherExecutor-6-thread-1] INFO org.apache.solr.core.SolrCore – [collection1] Registered new searcher Searcher@5bcfdbdb[collection1] main{StandardDirectoryReader(segments_f:38:nrt _e(4.10.4):C5)}

4213 [coreLoadExecutor-5-thread-1] INFO org.apache.solr.core.CoreContainer – registering core: collection1

4214 [main] INFO org.apache.solr.servlet.SolrDispatchFilter – user.dir=/opt/solr/example

4215 [main] INFO org.apache.solr.servlet.SolrDispatchFilter – SolrDispatchFilter.init() done

4249 [main] INFO org.eclipse.jetty.server.AbstractConnector – Started SocketConnector@0.0.0.0:8983

Now go to the browser and type :

http://localhost:8983/solr/#/

The solr server run on 8983 port .

Now open your magento site Admin panel and go to the extension magento connect :

and type this in extension field :

http://connect20.magentocommerce.com/community/JeroenVermeulen_Solarium

install it and proceed it .

Now return to admin panel :

And go to System -> Configuration -> Catalog -> and find :

In this panel open General setting and Solr server

Enabled it and in solr server every thing is already set

Click on test connection if the result is success :

then only solr will run correct :

Now one more thing to do that is very important and o it very carefully :

Go to you root directory :

or : open : opt/lampp/htdocs/magento-folder/app/code/community/JeroenVermeulen/Solarium/docs/

And copy two file :

1: Schema.xml

2. Solrconfig.xml

And paste it at given folder :

Note : before pasting take backup of that file :

folder : opt/solr/example/solr/collection1/conf/

Congratulation now you have successfully configured Solr to your magento site , now add category and products to see the solr working .

Go to you home page of you website and search your product :

For solr documentation visit :

1: http://lucene.apache.org/solr/

Download some important notes :  Magento_For_Php_Mvc

magento

Download Continent Country State Mysql Datababse

Download It from here

Happy Holi #holi #india

Happy-Holi-Pictures


a.png

oops

Class : 

A class is used to specify the form of an object and it combines data representation and methods for manipulating that data into one neat package. The data and functions within a class are called members of the class.

ex-> 

<?php
class Rahul {
public $name ;
private $lastname;
protected $fullname ;

function Name() // method
{
echo “Rahul”;

}
}

$name = new Rahul();
$name->Name();

?>

Object :

An individual instance of the data structure defined by a class . You  defines a class once and then make many object that belongs to it . Object are also know as instance.

Example 1 ->

class Example {
public $name ;
public $item ;

function Sample(){

$this->test();
}

function Test(){

echo ‘Test’;
echo $this->item;
$regular = 500;
echo $regular ;
}

}

$e = new Example() ;
$e->Sample();

?>

Example  2 ->

<?php
class A
{
private $a;
function set($a)
{
$this->a=$a;
}
function disp()
{
echo $this->a.”<br>”;
}

};
$obj=array(new A(),new A,new A(),new A(),new A());

$data=array(10,20,30,40,50);

for($i=0;$i<count($obj);$i++)
{
$obj[$i]->set($data[$i]);
}

foreach($obj as $v)
$v->disp();

?>

Inheritance :

When a class is defined by inheriting existing function of a parent class then it is called inheritance . Here child class will inherit all or few member function and variables of a parent class.

Example ->

<?php

class Foo
{
public function printItem($string)
{
echo ‘Foo: ‘ . $string . PHP_EOL;
}

public function printPHP()
{
echo ‘PHP is great.’ . PHP_EOL;
}
}

class Bar extends Foo
{
public function printItem($string)
{
echo ‘Bar: ‘ . $string . PHP_EOL;
}
}

$foo = new Foo();
$bar = new Bar();
$foo->printItem(‘baz’); // Output: ‘Foo: baz’
$foo->printPHP();       // Output: ‘PHP is great’
$bar->printItem(‘baz’); // Output: ‘Bar: baz’
$bar->printPHP();       // Output: ‘PHP is great’

?>

Ploymorphism : 

This is a object oriented  concept where same function can be used for different purpose,

Example ->

<?php

class lineitem {
var $amount,$what;
function lineitem ($amount,$desc) {
$this->amount = $amount;
$this->what = $desc;
}

function getname () {
return $this->what;
}

function getval () {
return $this->amount;
}

}

class bill extends lineitem {
function bill ($amount,$desc) {
$this->amount = -$amount;
$this->what = $desc;
}

}

class income extends lineitem {

}

$acc[0] = new bill(15.40,”Break Rolls”);
$acc[1] = new bill(17.75,”Carpet leaner”);
$acc[2] = new income(37.84,”options added by Berks Folks”);

$tot = 0;
$format = “%-35s … %8.2f\n”;

foreach ($acc as $item) {
$amount = $item->getval();
$whom = $item->getname();
printf($format, $whom,$amount);
$tot += $amount;
}

printf($format, “TOTAL …”,$tot);

?>

OUTPUT:

DerivedClass method called

In the above example, object $c of class DerievedClass is executed and passed to the processClass() method. The parameter accepted in processClass() is that of BassClass. Within the processClass() the method myMethod() is being called. Since the method is being called on the class variable of BaseClass, it would not be wrong to assume that myMethod() of class BaseClass will be called. But, as per the definition “When the decision to invoke a function call is made by inspecting the object at runtime it is called Polymorphism”, myMethod() will be called on object DerievedClass. The reason why this happens is because the object of DerievedClass is being passed and hence the method myMethod() of DerievedClass will be called.

function name will remain same but it make different number of arguments and can do different task.

Overloding :

Overloading is ability of one function to perform different tasks, i.e,it allows creating several methods with the same name which differ from each other in the type of the input and the output of the function.
Overloading can be used with functions and members.

Example ->

int volume(int s),
double volume(double r,int h),
long volume(long l,int b,int h)

Depending on the parameter passed the corresponding function will be called.

Data Abstraction : 

Any representation of data in which the implementation data are hidden(abstracted) is known as data abstraction.

Example – >

<?php

abstract class Cheese
{
//can ONLY be inherited by another class
}

class Cheddar extends Cheese
{
}

$dinner = new Cheese; //fatal error
$lunch = new Cheddar; //works!

?>

Encapsulation : 

Refers To a concept where we encapsulate all the data and member function together to form object.

 

PIP PHP FRAME WORK

PIP PHP FRAME WORK

PHP Frameworks

TOP TEN BEST PHP FRAMEWORKS FOR 2014

PHP is a very powerful and well known platform. Almost 50% of the web is powered by PHP. If you are a PHP developer then you should know that framework make things simple, manageable and fun to work with. There are many PHP frameworks out there so its probably hard to chose one. In this post i have compiled a list of top ten PHP frameworks for 2014. Every framework stated here has it’s advantages and disadvantages. In this post i have briefly described about each framework and their uses. Enjoy!

Laravel

Laravel Top Ten Best PHP Frameworks For 2014

Laravel is an amazing PHP framework for web artisans. Build huge enterprise applications, or simple JSON APIs, Write powerful controllers, or slim restful routes. Laravel is perfect for jobs of all sizes.

Phalcon

phalcon Top Ten Best PHP Frameworks For 2014

Phalcon is a web framework implemented as a C extension offering high performance and lower resource consumption.

Symfony

Symfony Top Ten Best PHP Frameworks For 2014

Symfony is a PHP framework for web projects. It speed up the creation and maintenance of your PHP web applications. Replace the repetitive coding tasks by power, control and pleasure.

Code Igniter

CodeIgniter Top Ten Best PHP Frameworks For 2014

CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. CodeIgniter is a proven, agile & open PHP web application framework powering the next generation of web apps.

Yii

yii Top Ten Best PHP Frameworks For 2014

Yii is a high-performance PHP framework best for developing Web 2.0 applications. Yii comes with rich features: MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, etc. It can reduce your development time significantly.

Aura

Aura Top Ten Best PHP Frameworks For 2014

If you like clean code, fully decoupled libraries, and truly independent packages, then the Aura project is for you. Download a single package and start using it in your project today, with no added dependencies. The primary goal of Aura is to provide high-quality, well-tested, standards-compliant, decoupled libraries that can be used in any codebase. This means you can use as much or as little of the project as you like.

Cake

cakePHP Top Ten Best PHP Frameworks For 2014

CakePHP makes building web applications simpler, faster and require less code.

Zend

Zend Top Ten Best PHP Frameworks For 2014

Zend Framework 2 is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 2 uses 100% object-oriented code and utilises most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures.

Flight

Flight Top Ten Best PHP Frameworks For 2014

Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build restful web applications.

Kohana

Kohana Top Ten Best PHP Frameworks For 2014

An elegant HMVC PHP5 framework that provides a rich set of components for building web applications.

Accounting Tutorial For Developer

Blog at WordPress.com.

Up ↑

Little Local

littlelocal

playwithlifeorg

4 out of 5 dentists recommend this WordPress.com site

Crafsol Technology Solutions

Crafting Enterprise Services

Rahul Rajoria

Web Developer || Techspawn Solution

system care

best laptop repairing center in indore

%d bloggers like this: