-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improvement speed performance in app bootstrap - Update Packager module - Add Scanner and StringUtils class
- Loading branch information
Showing
5 changed files
with
81 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
namespace classes\helper; | ||
|
||
class StringUtils { | ||
/** | ||
* First char checker (alternative to preg_match) | ||
* | ||
* @param match = is the text to match | ||
* @param string = is the source text | ||
* | ||
* @return bool | ||
*/ | ||
public static function isMatchFirst($match,$string){ | ||
if (substr($string, 0, abs(strlen($match))) == $match) return true; | ||
return false; | ||
} | ||
|
||
/** | ||
* Any char checker (alternative to preg_match) | ||
* | ||
* @param match = is the text to match | ||
* @param string = is the source text | ||
* | ||
* @return bool | ||
*/ | ||
public static function isMatchAny($match,$string){ | ||
if(strpos($string,$match) !== false) return true; | ||
return false; | ||
} | ||
|
||
/** | ||
* Last char checker (alternative to preg_match) | ||
* | ||
* @param match = is the text to match | ||
* @param string = is the source text | ||
* | ||
* @return bool | ||
*/ | ||
public static function isMatchLast($match,$string){ | ||
if (substr($string, (-1 * abs(strlen($match)))) == $match) return true; | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters