Posted on January 31, 2017, 5:30 pm, by admin, under
php.
<?php function recursive(&$myarray, $dir, $recursiveDir = null) { $items = scandir($dir); foreach ($items as $item) { if ($item != "." && $item != "..") { $file = $dir. DIRECTORY_SEPARATOR. $item; if (is_dir($file)) { definitions($routes, $file, $file); } else { // get name of api $expl = explode(".", $item); […]
Posted on January 31, 2017, 5:03 pm, by admin, under
php.
<?php $url = function($folder) use ($hostname) { return $hostname . DIRECTORY_SEPARATOR . $folder; }; $hostname = "https://" . $_SERVER[’SERVER_NAME’]; $myurl = $url(’pictures’); echo $myurl; // output // https://www.aghayev.com/pictures
Posted on January 27, 2017, 4:07 pm, by admin, under
dictionary,
php.
Stateless – when the application doesn’t save anything to the disk or to the RAM that is required to process future workloads. The benefit of stateless application is that it is possible to run multiple instances of an application in order to distribute workload and increase availability.
Posted on January 25, 2017, 4:46 pm, by admin, under
mysql.
CREATE DEFINER=`root`@`localhost` PROCEDURE `Sample`(IN inParameterID VARCHAR(10)) Sample:BEGIN DECLARE httpStatus INT DEFAULT 500; DECLARE errorCode INT DEFAULT NULL; DECLARE errorDetails TEXT DEFAULT NULL; DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING BEGIN ROLLBACK; SELECT 500 AS statusCode, ‘Failed’ AS statusMessage; END; SET @variableID = 0; SELECT TableA.ID INTO @variableID FROM TableA WHERE TableA.ParameterID […]
Posted on January 25, 2017, 2:40 pm, by admin, under
php.
How-to add namespaces to old php project https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md Simple project with namespaces https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md
Posted on January 25, 2017, 2:39 pm, by admin, under
tips.
Bitbucket is good for free private repos Github is good for free public repos, for demonstration of your work
Posted on January 5, 2017, 9:40 am, by admin, under
php.
A Strategy pattern is an operational pattern. Strategy pattern allows you to polymorphically change behavior of a class. Strategy pattern is to avoid conditionals switching in favor of polymorphism. So, Strategy pattern = polymorphism. A Factory pattern is a creational pattern. Factory pattern allows you to encapsulate object creation. Factory pattern = encapsulation. A difference […]