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
<?php | |
/** | |
* Generates an url | |
* | |
* @param array $params List of params | |
* | |
* @internal string $params['baseUrl'] The base url, default: $_SERVER['REQUEST_URI'] | |
* @internal array $params['queryAdd'] Adds extra query params as associative array | |
* @internal array $params['queryRemove'] Removes query parameters as simple array |
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
<?php | |
/** | |
* Parses the given datetime string and changes it to the given format. This uses strtotime() | |
* to convert the datetime to timestamp, then changes format using date() | |
* | |
* @param string $dateStr String representing the datetime. If empty current datetime is used. | |
* @param string $format The desired format. Default: d/m/Y | |
* @param string $defaultIfInvalid A value to be returned if the given datetime is invalid | |
* |
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
<?php | |
/** | |
* Class CurlFetch | |
* | |
* A simple class to fetch content from an URL via GET or POST | |
*/ | |
class CurlFetch { |
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
<?php | |
/** | |
* Class UrlGenerator | |
* | |
* A class to generate url, while adding or removing query string parameters | |
*/ | |
class UrlGenerator { |
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
<?php | |
$pageNo = isset($limitParams['_ticketPage']) ? (int)$limitParams['_ticketPage'] : 1; | |
if($pageNo < 1) { | |
$pageNo = 1; | |
} | |
$recordsNo = isset($limitParams['_ticketRecords']) ? (int)$limitParams['_ticketRecords'] : 20; |
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
<?php | |
/** | |
* Convert date/time string to given format | |
* | |
* @param string $dateTimeString | |
* @param string $format | |
* @param string $noValueStr | |
* | |
* @return bool|string | |
*/ |
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
RewriteCond %{HTTPS} off | |
# First rewrite to HTTPS: | |
# Don't put www. here. If it is already there it will be included, if not | |
# the subsequent rule will catch it. | |
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# Now, rewrite any request to the wrong domain to use www. | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: anjan | |
* Date: 9/30/15 | |
* Time: 9:23 AM | |
*/ | |
class SimplePager { |
NewerOlder