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 | |
$sequence[0] = '1'; | |
//$sequence[1] = (count of numbers in $sequence[0]) //11 | |
//$sequence[2] = (count of numbers in $sequence[1]) //21 | |
function populate_sequence_row($sequence, $rowNumber) | |
{ | |
if($rowNumber == 0) return 1; | |
$order = 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
/* bootstrap file */ | |
define('_TABLE_PREFIX', $config->db->table->prefix); | |
class Extend_Db_Table extends Zend_Db_Table_Abstract | |
{ | |
/** | |
* This will automatically set table name with prefix from bootstrap file | |
* @return void | |
*/ | |
protected function _setupTableName() |
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
class Mist_Db_Table extends Zend_Db_Table | |
{ | |
public function __construct($config = array(), $definition = null) | |
{ | |
parent::__construct($config, $definition); | |
$config = $this->getAdapter()->getConfig(); | |
if(array_key_exists('prefix', $config)) | |
{ |
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 | |
$str = "abcd 01234 87 01235 6 абвгд"; | |
$words = preg_split("/\s/", $str, -1, PREG_SPLIT_NO_EMPTY); | |
function uniord($ch) { | |
$n = ord($ch{0}); | |
if ($n < 128) { | |
return $n; // no conversion required |
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 | |
protected function _initViewHelpers() | |
{ | |
$view= new Zend_View(); | |
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); | |
$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); | |
$viewRenderer->setView($view); |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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
public function autoload($className) | |
{ | |
$className = ltrim($className, '\\'); | |
$fileName = ''; | |
$namespace = ''; | |
if ($lastNsPos = strripos($className, '\\')) { | |
$namespace = substr($className, 0, $lastNsPos); | |
$className = substr($className, $lastNsPos + 1); | |
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; | |
} |
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
if(!empty($remote)) { | |
$config = array( | |
'adapter' => 'Zend_Http_Client_Adapter_Curl', | |
'curloptions' => array( | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_HEADER => 0, | |
CURLOPT_CONNECTTIMEOUT => 5, | |
), | |
); |
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
set_error_handler('handle'); | |
function foo(integer $p1, bool $p2) { | |
echo "ok" . PHP_EOL; | |
} | |
$param1 = 123; | |
$param2 = 'string val!'; | |
foo($param1, $param2); |
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
base: | |
components: | |
db: | |
connectionString: 'mysql:host=localhost;dbname=default_crm' | |
username: o.mikhailov | |
password: ahPi7faiwei | |
connections: | |
developer: | |
connectionString: 'mysql:host=localhost;dbname=crm_extended' | |
username: o.mikhailov |
OlderNewer