Compare commits

...
Sign in to create a new pull request.

7 commits
master ... 1.5

Author SHA1 Message Date
Joshua Sherman
c865e74ebd Updated headers and dropped tests
The tests weren't complete nor were they being used so I dropped them. Since
this branch is still actively being maintained as it's the PHP 5.3 compatible
stuff I figured I should update the headers to have the current year and
explicitly show that it's PHP 5.3+ and not just PHP 5.
2014-01-26 21:35:56 -05:00
Joshua Sherman
8bc9d52e06 Added travis config to resolve build failures
This branch doesn't get tested, just master for right now. For historical
purposes, all of your branches must contain the configuration.
2014-01-26 15:16:38 -05:00
Joshua Sherman
43da0ac172 Added fix for broken UTF-8 2 byte characters 2014-01-26 15:03:26 -05:00
Joshua Sherman
0c3b239417 Updated preg_match to preg_replace_callback
Was throwing a deprecation error, figured it's worth fixing.
2014-01-22 12:31:57 -05:00
Joshua Sherman
d8e6c43868 Added sanity check for loggable_query variable 2014-01-22 12:23:56 -05:00
Joshua Sherman
ed90ee3501 Fixed issue with profilers always being to true 2014-01-22 11:56:17 -05:00
Joshua Sherman
8752540f31 Fixed the case sensitivity issue on this branch.
Just a bug fix, happened months ago but I deleted the branch.
2014-01-17 10:50:59 -05:00
46 changed files with 140 additions and 341 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@
##########################
.*
!.gitignore
!.travis.yml
*~
# Global/OSX.gitignore #

3
.travis.yml Normal file
View file

@ -0,0 +1,3 @@
branches:
only:
- master

View file

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2007-2013 Joshua Sherman
Copyright (c) 2007-2014 Joshua Sherman
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View file

@ -3,13 +3,13 @@
/**
* Common API Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Google Profanity Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Gravatar Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Tinychat Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Browser Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Caching System for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Configuration Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles
@ -171,19 +171,10 @@ class Config extends Object
// Defaults profiler to true if it doesn't match an option exactly
if (isset($this->data['pickles']['profiler']))
{
if ($this->data['pickles']['profiler'] !== true)
// If we have an array convert to a string
if (is_array($this->data['pickles']['profiler']))
{
// If we have an array convert to a string
if (is_array($this->data['pickles']['profiler']))
{
$this->data['pickles']['profiler'] = implode(',', $this->data['pickles']['profiler']);
}
// Checks that one of our known values exists, if not, force true
if (preg_match('/(objects|timers|queries|explains)/', $this->data['pickles']['profiler'] == false))
{
$this->data['pickles']['profiler'] = true;
}
$this->data['pickles']['profiler'] = implode(',', $this->data['pickles']['profiler']);
}
}
else

View file

@ -3,13 +3,13 @@
/**
* Single Entry Controller
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles
@ -487,7 +487,14 @@ class Controller extends Object
// Scrubs class names with hyphens
if (strpos($module_class, '-') !== false)
{
$module_class = preg_replace('/(-(.{1}))/e', 'strtoupper("$2")', $module_class);
$module_class = preg_replace_callback(
'/(-(.{1}))/',
function ($matches)
{
return strtoupper($matches[2]);
},
$module_class
);
}
return array($module_class, $module_filename, $template_basename, $css_class, $js_basename);

View file

@ -3,13 +3,13 @@
/**
* Converter
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Database Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Common Database Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* PDO Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles
@ -227,7 +227,7 @@ class Database_PDO_Common extends Database_Common
$end_time = microtime(true);
$duration = $end_time - $start_time;
if ($duration >= 1)
if ($duration >= 1 && isset($loggable_query))
{
Log::slowQuery($duration . ' seconds: ' . $loggable_query);
}

View file

@ -3,13 +3,13 @@
/**
* MySQL Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* PostgreSQL Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* SQLite Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Date Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Common Display Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* JSON Display Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* PHP Display Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* RSS Display Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* XML Display Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Distance
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Dynamic Content Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Error Reporting for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* File Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Form Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* HTML Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Logging System for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Model Parent Class for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Module Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Number Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Object Class File for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Profiler
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Security System for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Session Handling for PICKLES
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Sorting Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* String Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles
@ -225,11 +225,11 @@ class String
{
if ($hover == true)
{
$string = '<span title="' . $string . '">' . substr($string, 0, $length) . '&hellip;</span>';
$string = '<span title="' . $string . '">' . mb_strcut($string, 0, $length, 'UTF-8') . '&hellip;</span>';
}
else
{
$string = substr($string, 0, $length) . '...';
$string = mb_strcut($string, 0, $length, 'UTF-8') . '&hellip;';
}
}

View file

@ -3,13 +3,13 @@
/**
* Time Utility Collection
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -3,13 +3,13 @@
/**
* Validator
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles

View file

@ -8,13 +8,13 @@
* base is established as well as the path that Smarty will use to store
* the compiled pages.
*
* PHP version 5
* PHP version 5.3+
*
* Licensed under The MIT License
* Redistribution of these files must retain the above copyright notice.
*
* @author Joshua Sherman <pickles@joshtronic.com>
* @copyright Copyright 2007-2013, Joshua Sherman
* @author Joshua Sherman <josh@gravityblvd.com>
* @copyright Copyright 2007-2014, Joshua Sherman
* @license http://www.opensource.org/licenses/mit-license.html
* @package PICKLES
* @link https://github.com/joshtronic/pickles
@ -140,7 +140,7 @@ function __autoload($class)
if ($class == 'AYAH')
{
$loaded = require_once PICKLES_VENDOR_PATH . '/ayah/' . $filename;
$loaded = require_once PICKLES_VENDOR_PATH . '/ayah/' . strtolower($filename);
}
else
{

View file

@ -1,59 +0,0 @@
<?php
require_once 'classes/Convert.php';
define('JSON_AVAILABLE', true);
class ConvertTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider providerToJSON
*/
public function testToJSON($a, $b)
{
$this->assertEquals(Convert::toJSON($a), $b);
}
public function providerToJSON()
{
$object = (object)'object';
$object->foo = 'foo';
$object->bar = 'bar';
return array(
array('', '""'),
array('foo', '"foo"'),
array(array('bar'), '["bar"]'),
array(array('foo', 'bar'), '["foo","bar"]'),
array(19810223, '19810223'),
array(array(1981, 02, 23), '[1981,2,23]'),
array(array('foo', 1981), '["foo",1981]'),
array(array('foo', array('bar')), '["foo",["bar"]]'),
array($object, '{"scalar":"object","foo":"foo","bar":"bar"}'),
array(true, 'true'),
array(false, 'false'),
array(null, 'null'),
);
}
/**
* @dataProvider providerArrayToXML
*/
public function testArrayToXML($a, $b, $c)
{
$this->assertEquals(Convert::arrayToXML($a, $b), $c);
}
public function providerArrayToXML()
{
return array(
array('foo', false, ''),
array(array('foo', 'bar'), false, '<0>foo</0><1>bar</1>'),
array(array('foo', 'bar'), true, "<0>foo</0>\n<1>bar</1>\n"),
array(array('foo' => 'bar'), false, '<foo>bar</foo>'),
array(array('children' => array('child' => array('foo', 'bar'))), false, '<children><child>foo</child><child>bar</child></children>'),
array(array('children' => array('child' => array('foo', 'bar'))), true, "<children>\n\t<child>foo</child>\n\t<child>bar</child>\n</children>\n"),
);
}
}
?>

View file

@ -1,32 +0,0 @@
<?php
require_once 'classes/Date.php';
class DateTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider providerAge
*/
public function testAge($a, $b)
{
$this->assertEquals(Date::age($a), $b);
}
public function providerAge()
{
ini_set('date.timezone', 'America/New_York');
$time = strtotime('-25 years');
return array(
array(date('Y-m-d', $time), '25'),
array(date('m/d/Y', $time), '25'),
array(date('r', $time), '25'),
array('today', '0'),
array('400 days ago', '1'),
array(true, Date::age('1969-12-31')),
);
}
}
?>

View file

@ -1,112 +0,0 @@
<?php
require_once 'classes/String.php';
class StringTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider providerFormatPhoneNumber
*/
public function testFormatPhoneNumber($a, $b)
{
$this->assertEquals(String::formatPhoneNumber($a), $b);
}
public function providerFormatPhoneNumber()
{
return array(
array('1234567890', '123-456-7890'),
array('123 456 7890', '123-456-7890'),
array('123.456.7890', '123-456-7890'),
array('123_456_7890', '123-456-7890'),
array('1234567890', '123-456-7890'),
array('1234-56-7890', '123-456-7890'),
array('(123) 456-7890', '123-456-7890'),
array('1234567890 x1000', '123-456-7890x1000'),
array('(123) 456-7890_x10.00', '123-456-7890x1000'),
);
}
/**
* @dataProvider providerGenerateGravatarHash
*/
public function testGenerateGravatarHash($a, $b)
{
$this->assertEquals(String::generateGravatarHash($a), $b);
}
public function providerGenerateGravatarHash()
{
return array(
array('foo@bar.com', 'f3ada405ce890b6f8204094deb12d8a8'),
array('FOO@BAR.COM', 'f3ada405ce890b6f8204094deb12d8a8'),
);
}
public function testIsEmpty()
{
$this->assertTrue(String::isEmpty(''));
$this->assertTrue(String::isEmpty(' '));
$this->assertTrue(String::isEmpty(false));
$this->assertTrue(String::isEmpty(null));
$this->assertTrue(String::isEmpty(true, false));
$this->assertFalse(String::isEmpty(0));
$this->assertFalse(String::isEmpty('foo'));
$this->assertFalse(String::isEmpty(' bar '));
$this->assertFalse(String::isEmpty(true));
}
public function testRandom()
{
$this->assertEquals(strlen(String::random()), 8);
$this->assertEquals(strlen(String::random(16)), 16);
$this->assertEquals(preg_match('/[A-Z0-9]/', String::random(32, true, true)), 1);
$this->assertEquals(preg_match('/[A-Z]/', String::random(32, true, false)), 1);
$this->assertEquals(preg_match('/[0-9]/', String::random(32, false, true)), 1);
$this->assertEquals(preg_match('/[0-9]/', String::random(32, true, false)), 0);
$this->assertEquals(preg_match('/[A-Z]/', String::random(32, false, true)), 0);
$this->assertEquals(preg_match('/[A-Z0-9]/', String::random(32, false, false)), 0);
}
/**
* @dataProvider providerTruncate
*/
public function testTruncate($a, $b, $c, $d)
{
$this->assertEquals(String::truncate($a, $b, $c), $d);
}
public function providerTruncate()
{
return array(
array('foo bar', 3, true, '<span title="foo bar" style="cursor:help">foo...</span>'),
array('foo bar', 3, false, 'foo...'),
array('foo bar', 7, true, 'foo bar'),
array('foo bar', 8, true, 'foo bar'),
);
}
/**
* @dataProvider providerUpperWords
*/
public function testUpperWords($a, $b)
{
$this->assertEquals(String::upperWords($a), $b);
}
public function providerUpperWords()
{
return array(
array('foo bar', 'Foo Bar'),
array('FOO BAR', 'Foo Bar'),
array('fOO bAR', 'Foo Bar'),
array('foo@bar.com', 'foo@bar.com'),
array('FOO@BAR.COM', 'FOO@BAR.COM'),
);
}
}
?>