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 | |
namespace App\Traits; | |
use Crypt; | |
trait Encryptable | |
{ | |
/** | |
* Get a models attribute on select |
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
// OLD CODE | |
// Wait for one minute for data source operation status to be IDLE | |
// Database operation (add/remove records) is asynchronous | |
public function waitForIdle($dataSourceId) | |
{ | |
$end = time() + 60; // up to one minute | |
while (time() < $end) | |
{ | |
try | |
{ |
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 | |
/* | |
* Copyright 2013 Disqus, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="name-of-project" default="build"> | |
<target name="build" | |
depends="prepare,dbtest,cake,lint,phpcs-ci,phploc,pdepend,phpmd-ci,phpcpd"/> | |
<target name="build-parallel" | |
depends="prepare,dbtest,cake,lint,tools-parallel"/> | |
<target name="tools-parallel" description="Run tools in parallel"> |
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 | |
function palindrome($string) { | |
$string = strtolower(ereg_replace("[^A-Za-z0-9]", "", $string )); | |
$palindromes = array(); | |
$longest = ""; | |
$word = ""; | |
$length = strlen($string); | |
for ($i =0; $i <= $length; $i++) { |
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 | |
/** | |
* PHPUnit wrapper | |
* | |
* To use, set unit.engine in .arcconfig, or use --engine flag | |
* with arc unit. Currently supports only class & test files | |
* (no directory support). | |
* To use custom phpunit configuration, set phpunit_config in | |
* .arcconfig (e.g. app/phpunit.xml.dist). |