How to Properly Maintain Macs for a Business

How to Properly Maintain Macs for a Business

Nowadays Macs are becoming more and more popular in business environments – even outside of areas where they’ve conventionally been strong such as video and photo editing. The reason for that is simple: Macs are viewed as reliable and secure machines that will deliver strong performance levels over the long term.

While all that is certainly true, if you want your Macs to deliver on their promise then it is important that you properly maintain them. Don’t worry that isn’t as complicated as it sounds, and there are just a few easy tasks that you should perform:

Run Disk Utility

Within every Mac is a helpful tool called Disk Utility that can help you to check your hard drive for fragmentation as well as repair it. All you need to do is select your hard drive and use the ‘First Aid’ tab to check and repair it.

Check the Activity Monitor

If your Mac seems to be slower than you’re used to the first thing you should do is check the Activity Monitor to see if anything is using up its memory (i.e. RAM). In the Activity Monitor you can force any unnecessary apps to close, or just track down which apps are taking up memory and close them the normal way.

Remove unneeded login items

Did you know that your Mac automatically launches some apps whenever it is booted, and these apps tend to run in the background? Head over to your System Preferences then to Accounts and Login Items to see a list of what is being launched and remove anything you don’t need.

Update OS X regularly

Every OS X update contains numerous fixes for various bugs as well as vulnerabilities. If you are using your Mac for business purposes, it is important that you update it regularly so that you aren’t exposed.

Reboot the Mac periodically

Although Macs can run for weeks on end without rebooting – that isn’t necessarily good for it. If you’re one of the many people who rarely ever reboot their Mac, try to get in the habit of doing so at least once a week – if not more frequently.

Free up space on your hard drive

It is never a good idea to let your Mac’s hard drive get too full – as that will impact its performance. Try to clean out any unnecessary junk files from your Mac regularly, and also uninstall apps that aren’t being used.

As you can see there’s nothing too hard about any of that – though you may need a little bit of help from Mac cleaning software. On that front Movavi Mac Cleaner will be all that you need really as it will automatically scan and find any junk files then let you delete them in just a single click.

On top of that Movavi Mac Cleaner will let you free up even more space with its ‘Uninstaller’ by tracking down leftovers from apps and deleting them as well as removing any apps you no longer need. It also includes a ‘Shredder’ to delete confidential files, as well as its own antivirus and firewall to protect your Mac.

All in all if you want to keep your Mac in tip top condition, Movavi Mac Cleaner should help you to do that quite conveniently. Give it a try and you’ll see how easy it makes it to clean your Mac, free up space, and keep it well-maintained for your business.

ecommerce-shoping-carts

10 Best PHP Based eCommerce Shopping Carts

Looking for Best PHP based eCommerce Shopping Carts? Following is a list of 10 most popular and widely used PHP based shopping cart systems, softwares which helps you get started in very short time. Magento is the market leader in all PHP based shopping carts.

Most Popular PHP eCommerce Shopping Carts

Following is a list of PHP based eCommerce shopping carts in no particular order.

Magento Templates

Magento eCommerce holds the largest market share in all php based eCommerce shopping carts (softwares). Magento eCommerce Templates and Themes are the bestsellers in the eCommerce world. Magento powered online stores provide your customers with a rich shopping experience and a very user friendly flow from shopping to checkout.

ZenCart Templates

Zen-cart ecommerce templates engine is the oldest player of the e-Commerce market and offer you to start your own online business without any problem. Zen cart e-Commerce store is very user-friendly software and can be easily installed by the users with little experience.

OpenCart Templates

Opencart eCommerce platform that gets more and more popular all over the world, It is affordable and easy to configure with cleaner html, pure css, sliders, image galleries, and much more.

WordPress E-commerce

WordPress E-commerce Templates are clean, super flexible and has a fully responsive design along with high quality plugins for creating WP commerce sites. WordPress commerce themes are easy to configure and offers integration options with some of the most popular and free  e-commerce plugins.

PrestaShop Templates

The Shopping – eCommerce Prestashop Template is an open source eCommerce tool very convenient and easy to handle. The incredible administrative interface of Prestashop helps you to manage the complex inventory easily and offers features like Import and export quickly, set attributes, sort products, bulk discounts, and much more.

Joomla Shopping Cart

The Joomla Shopping Cart system is rich and user friendly eCommerce & Shopping Cart tool with full-featured e-commerce component with an easy to use and visually appealing interface. Joomla is also known as one of the best content management systems in the market.

Drupal e-Commerce

Drupal Commerce is an open source e-Commerce framework build truly flexible, It has a solid collection of E-commerce modules and themes that are ready to convert a site to online store.

CubeCart Templates

The CubeCart Templates are packed full of features and beautifully presented with a clean layout and offers  high-quality E-Commerce theme and skins.

CS-Cart Templates

CS-Cart templates and skins offers on-line store a professional look and feel with very elegant and functional web design templates.cs-cart e-commerce shopping cart is very easy to install and template management system from user-friendly admin area.

OS-Commerce

OS-Commerce or open source commerce is an e-commerce online shop e-commerce solution and online store-management software program that offers a wide range of out-of-the-box features that allows online stores to be setup quickly.

php-domain-information

How To Get Domain, Subdomain, TLD, CTLD & Path from URL In PHP

Recently for one of our project i was supposed to get Country Name, Sub Domain, Top Level Domain (TLD), Country Level Domain (CTLD) and Path from the given URL which will further be inserted into the database. Many functions which we used to test different scenarios, failed to perform on some logic or another. While searching for a better approach i ended up finding one answer in Stackoverflow by “Whatever Kitchen” which did the job perfectly. Here is a modified version of the function

Code Explaination

This function expects three parameters:

  1. URL
  2. Get What (default is everything)
  3. Output Format (default is an Array)

Calling the Function In Your App

You can call this function like url_information($myUrl, 'ALL', 'array'); within your application by sending those 3 parameters. Default output format will be an Array. Following are examples of how this function can be called to get the value.

I hope this function will help you get the information you need by providing proper parameters. Please feel free to suggest any further enhancements if you like. Subscribe our RSS to receive latest updates.

12 Most Popular PHP Based Content Management Systems

Content management systems aka CMS have changed the definition of websites in last decade. These powerful tool help anyone setup a fully customizable and highly scalable websites in matter of minutes. The real beauty lies in plugins which essentially are core feature enhancements for these frameworks.

Top 12 PHP Content Management Systems

Followings are top 12 PHP based content management systems (CMS) listed in order or popularity.

WordPress

Wordpress_CMS

WordPress is most popular free open source blogging tool as well as a content management system based on PHP. It is one of the most user friendly CMS in the market and offers simple flow to integrate themes,widgets and plugins.

Joomla

Joomla_CMS

Joomla is an open source content management system to build powerful websites and on-line template based applications. It also offers themes and other templates for user friendly actions.

Drupal

Drupal_CMS

The open source content management system distributed under the General Public License. It is use to build very flexible eCommerce websites and web based applications.

ModX

Modx_CMS

The CMS is a web application framework for publishing content on the world wide web. MODx frontend and backed is very easy to set-up and use.

Concrete5

Concrete5_CMS

Concrete5 is the Next generation Content Management System available with wide range of themes,plugins and add-ons. It is well designed to publish content on the internet and truly delivers the best.

MotoCMS

Moto_CMS

The Next generation Content Management is one of the advanced Flash based CMS, allow to create stunning Flash Websites without and programming skills and flash knowledge.

Contao

Contao_CMS

Conato is the free CMS is mostly used for medium to large websites and allow the pages to generate under the guidelines W3C/WAI and as per XHTML, HTML5 and CSS standards.

Frog CMS

Frog_CMS

Frog CMS is the small and fast content management system software developed in PHP5 with MySQL database. It offers simple hierarchical structured page creation and navigation.

TextPattern

TextPattern_CMS

Textpattern CMS is very flexible, elegant and easy-to-use Content Management System and allows easily create, edit and publish content over the world wide web.

ExpressionEngine

Expressionengine_CMS

ExpressionEngine CMS is one of the incredible open-source PHP framework multi-purpose content management system. It offers powerful list of features and best for e-commerce.

SilverStripe

SilverStripe_CMS

SilverStripe is open source content management system (CMS) software for building, editing and maintaining websites. Its design works on smartphones, tablets, and desktop computers and offers extensible web application interface.

CMS Made Simple

CMS Made Simple

CMS Made Simple is free open source platform for content management system to provide developers, programmers and site owners a web-based development and administration area.

I personally use WordPress and Joomla but i have given almost all of them a try and they simply amaze me. Please leave me a comment and let me know your favorite content management system?

Integrating BrainTree Payment Gateway With PHP

BrainTree Payment Gateway API is cool enough for you to understand, but you need to setup the prerequisites first. This article assumes that you have installed the dependencies on your server. BrainTree API expect the followings:

  1. A Developer Sandbox Account – Create one here
  2. BrainTree Client Framework within your application – Download from here

Now, lets create a php file called _environment.php and place the following code in it

BrainTree Control Panel API Key

Now, login to your Sandbox account. You will see your merchant Id, Public Key and Private Key. Replace those values in this code.

BrainTree Transparent Redirect

We will use BrainTree Transparent Redirect to accept one time transactions. Create a file called single_transactions.php and place the following code in it.

Code Explanation

Above code is simple to understand. First we are showing a form to customers, taking their information and passing to BrainTree without actually redirecting our customers to BrainTree Payment Gateway. You can use these test credit card information:
Credit Card #: 5105105105105100
Expiry: 05/2015
CVV: 123

This is the most important piece of code, notice the transaction array in which we are passing amount and type to BrainTree PG.

$result holds the processor responses from BrainTree.

Now, we have the full information in $transaction and you can display the transaction information like

This is how you can use BrainTree Payment Gateway’s Transparent Redirect Method to make one time transactions. In the next part we are going to explain how to subscribe customers for recurring payments.

Creating Transactions from the Vault

BrainTree Payment Gateway expects Secure Credit Card Storage before actually initiating recurring billing to any customers. This is how it is expected.

  1. Secure Credit Card Storage
  2. Creating Transactions from the Vault

To develop recurring billing option first we will setup Secure Credit Cart Storage. This is fairly easy just use the following code.

Above code is straightforward, all commented code is optional but you can specify additional information you want to attach to a customer. First we can taking customers information on a form and then passing all the information to this function via AJAX or POST. The function calls BrainTree Payment Gateway and creates a record in BrainTree vault.

While creating a transaction we will need this token to tell BrainTree which credit card is going to be used for recurring billing. Finally, you will see your customer record in your sandbox like this

BrainTree Customer Record in Vault

If you can see your newly created customer in BrainTree Sandbox Vault, you are good to create Transactions (recurring in our case).

Creating BrainTree Recurring Billing Using PHP

To create a recurring billing option first, you need to create recurring billing plan under your sandbox account. Login to your sandbox account => Recurring Billing => Plans => Add New Fill the form and create a valid billing plan. Once you plan is created note the Plan ID as this is what we are going to associate our customers to. Following is the function to subscribe customers already in BrainTree vault to recurring billing plan we have just created.

Congratulations, you have just created your first recurring billing transaction. Should you need to cancel a subscription, you will need the $subscriptionID, simply use the following code

BrainTree on CVV

BrainTree’s stand on storing CVV

We can’t store the CVV according to PCI guidelines, but you can send it in with the Vault tokens. CVV rules will be applied to these transactions if the CVV is sent in with the tokens. However, CVV is not required when creating a transaction from Vault tokens. If the CVV is not passed CVV rules will not be applied.

I hope these methods will help you create BrainTree Payment Gateway one time or recurring billing transactions. I would love to hear your own experiences of using BrainTree Payment Gateway with PHP.

How to create XML with PHP Mysql

How To Create XML With PHP MySQL

Nobody can deny the power and benefits of XML which is mostly used in Java and .Net environment extensively. Using XML in PHP is also very popular and you will notice many PHP based web applcations using XML to it’s extent. A popular PHP/Zend software Magento ecommerce is also using XML a lot which tells that XML is here to stay with PHP as well.

I am going to introduce you to using PHP and MySQL to manipulate XML. I’ll execute a MySQL query and format the data into well-formed XML. Finally, I’ll explain how to write XML to a file and examine the system setup before diving into the code.

To use the code I’ve included in this article, you must have PHP and MySQL running, and you need to know your MySQL host name, username, and password to fully use the samples. The sample MySQL database has the format shown in Figure A. Let’s look at how to connect to the sample database with PHP.

Create XML With PHP MySQL

Establishing a database connection with PHP
The following sample PHP script connects to the database and executes a query:

If necessary, you can add attributes later. For now, execute the query like so:

PHP.net is a great source to view all PHP and even MySQL functions.

Create and write the XML

At this point, you’re ready to create a new XML document. There are many ways to approach it, but I think the approach used in Listing A suffices for most purposes:

Here’s a breakdown of what’s happening. Variable num represents the presence of row data from your query, measurable using MySQL’s mysql_num_rows function. This leads us into your procedural output of the XML. Variable $file contains a pointer to the file object produced when PHP successfully reads the file system in search of results.xml. If results.xml is found, your PHP file object, named file, is created and made writeable. Now you can print the contents of a variable to it, which is what you’ll do because your directory permissions are set up to allow PHP to do this.

Keep in mind that for security reasons, this is a dumb thing to do in real-world Web applications. To make sure your implementation of the concepts covered in this article are secure, you should provide a full path to a directory containing the files you wish to open for writing, and make sure it’s in a directory above your Web root.

Next, PHP’s mysql_fetch_array function converts the query variable $result to an array, and loops through its keys. If pageTitle was among the columns returned in the query, for each row returned, some XML-formatted text is written to string variable $_xml.

Note that the operator “.=”, which is being used to append the XML-formatted strings as values, is read from $row. When the loop is finished, the root XML node is printed to variable $_xml, and the whole variable is written to file.xml using PHP’s fwrite function.

At this point, a link appears on the screen. Make sure this link points to the path of your XML file, or you won’t be able to see the formatted XML produced by PHP from your MySQL query.

A test drive

You can easily test the code by running it in a browser. If all goes well, you will see a new file in your directory called results.xml. This is the XML file created with the PHP. It should look like this:

This is just a very basic of XML created with PHP and MySQL. The resulting code from this article would be useful as an include file in the context of a larger application. It is a tried-and-true technique for creating and updating XML documents, but it’s not the only solution: There are other technologies that extend PHP—PEAR, for instance—that present some exciting alternatives.

I would love to hear your experiences of using XML with PHP and MySQL. Please leave us a comment and let us know. Subscribe our RSS to receive latest PHP, MySQL and XML Updates.

RBS WorldPay Integration With PHP

Integrating RBS WorldPay XML Direct Method with PHP

RBS Worldpay XML Direct model enables you to capture payment details on your own secure server and send the captured data to WorldPay for processing in preference to using WorldPay’s hosted payment pages. This connection model provides you with complete control over the look-and-feel of the payment experience for your customers.

This model supports cardholder authentication, so using it you can comply with MasterCard’s mandate that all Maestro payments are processed using MasterCard’s SecureCode security protocol – the legacy ‘invisible’ connection method still used by some of our customers cannot support this.

Unfortunately, you can’t simply test this unless your server is scanned by RBS and you make your site PCI compliant. While working for one of our customer i indulged into RBS worldpay payment gateway and found it too complex to start with but with time things started looking good.

Basically i was never so dependent on PEAR simply because many of my customers run their sites on shared server where we don’t have access to PEAR libraries often. In this particular case i had to use PEAR to make HTTP_REQUESTS.

Steps to connect to RBS Worldpay

1. RBS Worldpay access only HTTP_REQUESTS from an authenticated servers only so make sure you are posting HTTP_REQUEST from a PCI compliant server.
2. Make sure you have PEAR installed on your server with support to Net libraries containing two main files “Socket.php” and “URL.php”.
3. Now make a folder called HTTP and place the following code in Request.php file, so it looks like “HTTP/Request.php”

Now, we should create a test order which will be posted to RBS Worldpay server for authentication and processing payment.

The above code will authenticate, and process the payment in backend. I will write how to recieve payment notifications and responses in my other post.

PHP 5.3.0RC1 Release Candidate Available

Finally, PHP community have released their new candidate PHP 5.3.0 RC1 with lots of new features which were needed by the PHP developers from long time. This can be treated as the final release of PHP 5.x series, they will continue with PHP6 soon after they release it completely.

Added Features

PHP 5.3.0 offers many new features which are as follows:

  1. They Now Support Namespaces, this is one of the major functionality needed in PHP
  2. Late Static Binding
  3. Various Performance Improvements
  4. Lambda functions and Closures
  5. Syntax additions: NOWDOC, limited GOTO, ternary short cut “?:” and __callStatic()
  6. Garbage Collection for cyclic references (Optional)
  7. mysqlnd; PHP native replacement for libmysql (Optional)
  8. Improved support for windows including VC6 and VC9 binaries
  9. Changes in rounding of float to be more consistent now then ever
  10. Deprecation notices are now handle via E_DEPRECATED (part of E_ALL) instead of the E_STRICT error level
  11. New bundled extensions: ext/phar, ext/intl, ext/fileinfo, ext/sqlite3, ext/enchant
  12. Several enhancements to enable more flexiblity in php.ini (and ini parsing in general)
  13. Countless bug fixes and improvements to existing extensions in particular to: ext/openssl, ext/spl and ext/date

Removed Features

They have also dumped several several extensions and unifies usage of internal APIs. So if you are using the followings think twice before upgrading otherwise you may end up with a broken application

  1. Moved the following extensions to PECL: ext/ming, ext/fbsql, ext/ncurses, ext/fdf
  2. Removed the following extensions: ext/mhash (see ext/hash), ext/msql, ext/pspell (see ext/enchant), ext/sybase (see ext/sybase_ct)
  3. Parameter parsing API unification will cause some functions to behave more or less strict when it comes to type juggling
  4. Removed zend.ze1_compatibility_mode
  5. Read the entire changes guide before upgrading (recommended)

Read the Upgrade Guide beforehand. You can download (Windows and Linux (source) ) from http://qa.php.net/

I would love to hear your thoughts on how you found this post and New PHP 5.3.0 RC1. If you’ve got any thoughts, comments or suggestions for things we could add, leave a comment! Also please Subscribe to our RSS for latest tips, tricks and examples on cutting edge stuff.

How to Import CSV File In Your PHP Application

PHP gives an ease when it comes to Import flat data (Data without hierarchical structure). If you are using XML to fetch and store data that is fine but what about the case when your client have excel sheet ready with multiple records to go into database. CSV (Comma Separated Values) format is a good candidate format to import or export your application data.

Importing data from CSV files

Since we have lines of values separated by commas, the easiest way to process them is to parse each line using the PHP explode() function:

Dealing with special characters

This simple solution will not work if you have a comma in a value, like for instance when the column is an address and it has a value is like “North street, 1”.

In such cases, the column value in the CSV file is quoted to indicate that the data between quotes should be read as a single column. To deal with this situation, you can use a specially tailored regular expression or use the PHP fgetcsv() function.

Note that locale settings may affect how fgetcsv() function works. As noted in the PHP manual, if LANG locale setting is for instance “en_US.UTF-8”, files in one-byte encoding are read wrong by this function, so be aware.

Importing CSV data directly into the database

If you are importing data from a CSV file into a MySQL database, you import it directly into a database table. It will be much faster than processing it line by line using PHP. Fortunately, most relational database have tools for the bulk data import from CSV files. Load data command will help you here. For instance, in MySQL you can use LOAD DATA INFILE query statement.

Friendly User Interface to Import CSV Data into a Database

An alternative solution to import CSV data is to use my class Quick CSV Import. This is even more user-friendly alternative to import CSV data into a database consists in using the application “Quick CSV import with visual mapping”. This application helps importing CSV files into a database table allowing to define with CSV file columns are mapped to which columns of the database table. This application can even suggest automatically separator character besides the comma. Following is an example of Quick CSV import