groupInfo expandAfterMode 0 groupName PHP snippetsTE2 abbreviation pear:install abbreviationMode 1 creationDate 2011-12-31T01:35:07Z flags 2 label Intall PHP Pear extension modificationDate 2012-03-18T08:35:06Z plainText pear install Console_Table snippetType 3 useCount 0 uuidString 48B8579E-361A-4EEC-A18D-9FAF4459FE47 abbreviation php:code:mysql:convert:tables abbreviationMode 0 creationDate 2012-03-16T06:18:04Z flags 0 label modificationDate 2012-03-16T06:18:04Z plainText <?php $tables = db_query('SHOW TABLE STATUS'); while ($table = db_fetch_array($tables)) { if ($table['Engine'] == 'MyISAM') { db_query('ALTER TABLE {%s} ENGINE = InnoDB', $table['Name']); } } ?> snippetType 0 useCount 0 uuidString BA9DB47A-92B4-4C7F-BBBE-0A6CE13203E3 abbreviation php:includepath abbreviationMode 0 creationDate 2012-03-16T05:37:19Z flags 0 label Check PHP include path via command line modificationDate 2012-03-16T05:37:44Z plainText php -c /path/to/php.ini -r 'echo get_include_path()."\n";' snippetType 0 useCount 0 uuidString A45D49BC-9994-472D-88C9-29F5BFF4E871 abbreviation php:ini abbreviationMode 0 creationDate 2012-03-16T05:35:44Z flags 0 label List PHP ini config files modificationDate 2012-03-16T05:36:06Z plainText php --ini snippetType 0 useCount 0 uuidString F310B795-ACFA-40E6-B41A-AEE35DFC5E06 abbreviation pear:where abbreviationMode 0 creationDate 2012-03-16T05:34:22Z flags 0 label Find wear PEAR include files are located modificationDate 2012-03-16T05:34:22Z plainText pear config-get php_dir snippetType 0 useCount 0 uuidString DDC46E52-14E1-40E2-87D4-CF633B2CA572 abbreviation pear:version abbreviationMode 0 creationDate 2012-03-16T05:33:54Z flags 0 label Get PEAR version modificationDate 2012-03-16T05:34:18Z plainText pear version snippetType 0 useCount 0 uuidString 6718AE5C-9DEC-4D5A-9ECF-A8804403B0B7 abbreviation php:code:info abbreviationMode 0 creationDate 2012-03-16T04:15:45Z flags 0 label Output PHP info modificationDate 2012-03-16T04:25:02Z plainText <?php // Show all information, defaults to INFO_ALL phpinfo(); ?> snippetType 0 useCount 0 uuidString 1B2FB360-8380-4EF7-B335-FC32A2D11F5D abbreviation php:ini:disable abbreviationMode 0 creationDate 2012-03-16T03:32:05Z flags 0 label Disable PHP module or ini file modificationDate 2012-03-16T03:33:35Z plainText cd /etc/php.d/ && mv %fill:filename%.{ini,disable} snippetType 0 useCount 0 uuidString 67FE9144-D776-4995-92A4-272C4FDF04E1 abbreviation php:ini:security abbreviationMode 0 creationDate 2012-03-16T03:30:10Z flags 0 label PHP security.ini (template) modificationDate 2012-03-16T03:53:37Z plainText # Standard PHP security ################## # Hide PHP expose_php=Off # Hide errors display_errors=Off # Log errors log_errors=On error_log=/var/log/httpd/php_scripts_error.log # Turn off Remote Code Execution allow_url_fopen=Off allow_url_include=Off # PHP 5.3.x or higher magic_quotes_gpc=Off # Resource Control (DoS Control) # set in seconds max_execution_time = 30 max_input_time = 30 memory_limit = 128M # Control POST size #post_max_size=1K # Higher security ################## # Disallow file uploads #file_uploads=Off # Or limit file uploads #upload_max_filesize=1M # Enable SQL Safe Mode #sql.safe_mode=On # Disabling Dangerous PHP Functions # disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source # PHP Fastcgi / CGI - cgi.force_redirect Directive ; Enable cgi.force_redirect for security reasons in a typical *Apache+PHP-CGI/FastCGI* setup cgi.force_redirect=On ; Limits the PHP process from accessing files outside ; of specifically designated directories such as /var/www/html/ #open_basedir="/var/www/html/" ; ------------------------------------ ; Multiple dirs example ; open_basedir="/home/httpd/vhost/cyberciti.biz/html/:/home/httpd/vhost/nixcraft.com/html/:/home/httpd/vhost/theos.in/html/" ; ------------------------------------ # Session Path ;session.save_path="/var/lib/php/session" ; Set the temporary directory used for storing files when doing file upload ;upload_tmp_dir="/var/lib/php/session" snippetType 0 useCount 0 uuidString 5BA32DAF-53B7-470D-B6D6-C118B3E6FF87 abbreviation php:modules abbreviationMode 0 creationDate 2012-01-02T17:02:32Z flags 2 label List PHP modules installed modificationDate 2012-03-16T03:31:29Z plainText php -m snippetType 3 useCount 0 uuidString 3ED4586B-EB85-420F-8E56-3D4CFD91737F abbreviation php:info abbreviationMode 0 creationDate 2012-01-02T17:02:31Z flags 2 label Display PHP configuration & settings modificationDate 2012-03-16T03:31:43Z plainText php -i snippetType 3 useCount 0 uuidString B6F50BF2-2C56-43E0-B5E6-81F999FCF920 abbreviation php:version abbreviationMode 0 creationDate 2012-01-02T17:02:03Z flags 2 label Get PHP version modificationDate 2012-03-16T03:31:48Z plainText php -v snippetType 3 useCount 0 uuidString D62477DE-D20F-432D-BC5E-077F70E1AD73 abbreviation php:code:timeago abbreviationMode 1 creationDate 2011-12-31T02:14:48Z flags 0 label Date - time ago modificationDate 2012-03-18T08:35:55Z plainText function date_time_ago($timestamp){ $difference = time() - $timestamp; $periods = array("second", "minute", "hour", "day", "week", "month", "years", "decade"); $lengths = array("60","60","24","7","4.35","12","10"); for($j = 0; $difference >= $lengths[$j]; $j++) { $difference /= $lengths[$j]; $difference = round($difference); if($difference != 1) $periods[$j].= "s"; $text = "$difference $periods[$j] ago"; return $text; } snippetType 0 useCount 0 uuidString A3114A06-C803-4307-B37F-2985139CA92A