This file contains hidden or 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($this->getObject()->isNew() || $this->getValue('attachment_name') != $this->getObject()->getAttachmentName()) | |
| { | |
| //check if attachment filename field or attachment file field are both filled, they both have to be filled if you want to upload an attachemnt file | |
| $this->mergePostValidator(new AttachementNameAndAttachmentFileValidatorSchema()); | |
| } |
This file contains hidden or 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 AttachementNameAndAttachmentFileValidatorSchema extends sfValidatorSchema | |
| { | |
| protected function configure($options = array(), $messages = array()) | |
| { | |
| $this->addMessage('attachment_name', 'Il nome dell\'allegato è obbligatorio.'); | |
| $this->addMessage('attachment_file', 'Caricare un file.'); | |
| } | |
This file contains hidden or 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 doClean($values) | |
| { | |
| $originalValues = $values; | |
| $table = Doctrine_Core::getTable($this->getOption('model')); | |
| if (!is_array($this->getOption('column'))) | |
| { | |
| $this->setOption('column', array($this->getOption('column'))); | |
| } |
This file contains hidden or 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 | |
| $string = "1234567890"; | |
| $n = 3; | |
| $numberOfCarachter = strlen($string); | |
| echo "Number of Character: ".$numberOfCarachter."\n"; | |
| $newString = array(); | |
| $stringInitialPosition = 0; | |
This file contains hidden or 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 | |
| $string = "1234567890"; | |
| $n = 3; | |
| $numberOfCarachter = strlen($string); | |
| $newStringArray = array(); | |
| $stringInitialPosition = 0; | |
| echo "Number of Character: ".$numberOfCarachter."\n"; | |
| while($stringInitialPosition < $numberOfCarachter){ |
This file contains hidden or 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 | |
| $number = '0123456789394872394'; | |
| $match = array(); | |
| preg_match_all('/(.{1,3})/', $number, $match); | |
| $res = implode(' ', $match[0]); | |
| var_dump($res); | |
| ?> |
This file contains hidden or 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
| RoomForumThread: | |
| tableName: room_forum_threads | |
| actAs: | |
| Timestampable: | |
| Sluggable: | |
| unique: true | |
| fields: [title] | |
| canUpdate: true | |
| columns: | |
| id: |
This file contains hidden or 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
| <HTML> | |
| <BODY> | |
| <% | |
| String cmd = "/tmp/test.sh" ; | |
| Runtime run = Runtime.getRuntime() ; | |
| Process pr = run.exec(cmd) ; | |
| InputStream in = pr.getInputStream(); | |
| BufferedReader reader = new BufferedReader(new InputStreamReader(in)); | |
| StringBuilder sb = new StringBuilder(); |
This file contains hidden or 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 Sandbox; | |
| use Doctrine\Common\ClassLoader, | |
| Doctrine\ORM\Configuration, | |
| Doctrine\ORM\EntityManager, | |
| Entities\User, Entities\Address; | |
| require '../../lib/Doctrine/Common/ClassLoader.php'; |
This file contains hidden or 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 ArrayTest extends PHPUnit_Framework_TestCase { | |
| public function testNextAndPrev1(){ | |
| $rs = array(1=>1,2=>2,3=>3,4=>4,5=>5); | |
| $curID = 3; | |
| reset($rs); | |
| $prev = null; | |
| foreach ($rs as $ID => $r){ |