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\tests\cases\extensions; | |
use lithium\util\Validator; | |
class ValidatorTest extends \lithium\test\Unit { | |
public function testValidationRule() { | |
$result = Validator::rule('match', 'match', 'any', array('other_field' => 'field', 'values' => array('field' => 'match'))); | |
$this->assertTrue($result); |
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 Test extends AppModel { | |
public $name = 'Test'; | |
public $validate = array( | |
'field' => array( | |
array( | |
'rule' => array('match','field_confirm.'), | |
'message' => 'The field must match.' |
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 Test extends \lithium\data\Model { | |
public $validates = array( | |
'field' => array( | |
array( | |
'customRule', | |
'message' => 'The field must validate', | |
'extraOption' => 'Value of the extra option.' |
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 Test extends AppModel { | |
public $validate = array( | |
'field' => array( | |
array( | |
'rule' => array('customRule','Extra argument.'), | |
'message' => 'The field must validate.' | |
) | |
), |
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 Test extends \lithium\data\Model { | |
public $validates = array( | |
'field' => array( | |
array( | |
'maatch', | |
'message' => 'The field must match', | |
'field' => 'field_confirm' |
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 | |
if ('master' == gethostname()) { | |
exit; | |
} | |
require_once "rscapi.php"; | |
define("API_USER", ""); | |
define("API_KEY", ""); | |
define("LOADBALANCER_ID",); |
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 | |
require_once "rscapi.php"; | |
define("API_USER", ""); | |
define("API_KEY", ""); | |
define("LOADBALANCER_ID",5873); | |
define("FLAVOUR_ID",2); | |
$rsc = new RscApi(API_USER, API_KEY); |
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 | |
/** | |
* Rackspace Cloud Server API PHP Library | |
* | |
* @package RscApi | |
*/ | |
/** | |
* Rackspace Cloud Server API PHP Library | |
* |
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
check system localhost | |
if memory usage > 65% then exec "/usr/bin/php /root/cloud/create.php" | |
if memory usage < 20% then exec "/usr/bin/php /root/cloud/terminate.php" |
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 | |
require_once ('Net/Gearman/Client.php'); | |
$client = new Net_Gearman_Client(array('127.0.0.1:4730')); | |
$client->Example("Hello Universe"); |