Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Thursday, February 7, 2013

SublimeLinter not working for PHP files

Sublime Text 2 is a great code editor. I've been using it for over a year as my default editor after moving on from EditPlus2. It's fast and features a great file overview sidebar, file tabbing, project saving and a customisable colour interface.

After an unsuccessful attempt at installing SublimeLinter months ago, I decided to give it another go. SublimeLinter is a syntax checker package for SublimeText and allows for auto syntax checking.

You need the Package Control plugin first to automate the installation and upgrading of plugins. Follow the instructions on the Installing section of SublimeLinter page to install it.

From here, PHP linting did not work for me.
After searching online, 2 fixes on Stack Overflow worked for me:

1. Set the syntax type for PHP files to PHP instead of HTML5

2. Point SublimeLinter to your PHP exe:
  • Set your PC PATH environment variable e.g. C:\xampp\php, then update the SublimeLinter executable map by:
    • Preferences -> Package Settings -> SublimeLinter -> Settings-Default
    • In "sublimelinter_executable_map", enter "php":"php" between the { and }


After this, SublimeLinter highlights any PHP syntax errors automatically :-)

Wednesday, November 23, 2011

Drupal DDBlock Error: [cycle] terminating; too few slides

When trying to configure the DDBlock module in Drupal 7, the following javascript error appeared:

[cycle] terminating; too few slides

CAUSE:
The jquery.cycle code cannot detect image slides because the Content Container name is set incorrectly in the configuration settings of the block.

SOLUTION
Edit the block configuration and use the suggested value for Content Container:

div.slide

Tuesday, November 8, 2011

Extending EditPlus with PHP IDE Functionality

An excellent article detailing how to add PHP syntax checking, context sensitive PHP help commands, and google searching to Editplus for PHP development.
The most useful in my view is the Syntax Checker, which can be added as a user tool in Tools -> Configure User Tools-> Add Tool >> Program, and enter:

Menu text   : PHP syntax checker
Command     : c:\php\php.exe -l
Argument    : $(FileName)

You can then map it to a keyboard shortcut using the Keyboard subtree option on the left. I have found SHIFT-S and very handy companion to CTRL-S for saving and verifying your PHP file.

SOURCE
http://www.base64.co.uk/extend-editplus-php-ide/

Thursday, November 3, 2011

How to add multiple servers to phpMyAdmin

Add the following to your phpmyadmin/config.inc.php file for each additional server:


$i++;
$cfg['Servers'][$i]['host'] = '192.245.1.234';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['only_db'] = '';
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // 'phpmyadmin' - see scripts/create_tables.sql
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // 'pma_bookmark'
$cfg['Servers'][$i]['relation'] = 'pma_relation'; // 'pma_relation'
$cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // 'pma_table_info'
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // 'pma_table_coords'
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // 'pma_pdf_pages'
$cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // 'pma_column_info'
$cfg['Servers'][$i]['history'] = 'pma_history'; // 'pma_history'
$cfg['Servers'][$i]['verbose_check'] = TRUE;
$cfg['Servers'][$i]['AllowRoot'] = TRUE;
$cfg['Servers'][$i]['AllowDeny']['order']
= '';
$cfg['Servers'][$i]['AllowDeny']['rules']
= array();




If you have only one server configured, $cfg['ServerDefault'] = 1;


// If you have more than one server configured, you can set $cfg['ServerDefault']
// to any one of them to autoconnect to that server when phpMyAdmin is started,
// or set it to 0 to be given a list of servers without logging in
// If you have only one server configured, $cfg['ServerDefault'] *MUST* be
// set to that server.
//$cfg['ServerDefault'] = 1; // Default server (0 = no default server)


Append the following lines if you have configured multiple servers to your phpmyadmin.


$cfg['ServerDefault'] = 0; // Default server (0 = no default server)
$cfg['Server'] = '';
unset($cfg['Servers'][0]);


SOURCE:
http://www.facebook.com/topic.php?uid=115960095095777&topic=70