@@ -97,6 +97,9 @@ |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + /** |
|
| 101 | + * @param \Symfony\Component\HttpFoundation\FileBag $file |
|
| 102 | + */ |
|
| 100 | 103 | private function initEvent($file,$model,$model_id) |
| 101 | 104 | { |
| 102 | 105 | $event = new UploadEvent(); |
@@ -109,6 +109,9 @@ |
||
| 109 | 109 | return $this->em->getRepository('MykeesMediaBundle:Media')->queryForModelAndId($model,$model_id); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | + /** |
|
| 113 | + * @param string $model |
|
| 114 | + */ |
|
| 112 | 115 | public function unlink($model, Media $media) |
| 113 | 116 | { |
| 114 | 117 | $info = pathinfo($media->getFile()); |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: Rafidion Michael |
|
| 5 | - * Date: 30/11/2014 |
|
| 6 | - * Time: 03:40 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: Rafidion Michael |
|
| 5 | + * Date: 30/11/2014 |
|
| 6 | + * Time: 03:40 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\Manager; |
| 10 | 10 | |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - /** |
|
| 150 | - * @param Media $media |
|
| 151 | - * @return bool |
|
| 152 | - */ |
|
| 149 | + /** |
|
| 150 | + * @param Media $media |
|
| 151 | + * @return bool |
|
| 152 | + */ |
|
| 153 | 153 | public function remove(Media $media) |
| 154 | 154 | { |
| 155 | 155 | $this->em->remove($media); |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | return true; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - /** |
|
| 161 | - * @param Mediable $model |
|
| 162 | - */ |
|
| 160 | + /** |
|
| 161 | + * @param Mediable $model |
|
| 162 | + */ |
|
| 163 | 163 | public function removeAllMediasForModel( Mediable $model ) |
| 164 | 164 | { |
| 165 | 165 | $model_name = Reflection::getClassShortName($model); |
@@ -232,6 +232,7 @@ |
||
| 232 | 232 | * Note: this function has been modified to simple return true or false |
| 233 | 233 | * @author <[email protected]> |
| 234 | 234 | * @param string UTF-8 encoded string |
| 235 | + * @param string $str |
|
| 235 | 236 | * @return boolean true if valid |
| 236 | 237 | * @see http://hsivonen.iki.fi/php-utf8/ |
| 237 | 238 | */ |
@@ -227,18 +227,18 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | - * Tests a string as to whether it's valid UTF-8 and supported by the |
|
| 231 | - * Unicode standard |
|
| 232 | - * Note: this function has been modified to simple return true or false |
|
| 233 | - * @author <[email protected]> |
|
| 234 | - * @param string UTF-8 encoded string |
|
| 235 | - * @return boolean true if valid |
|
| 236 | - * @see http://hsivonen.iki.fi/php-utf8/ |
|
| 237 | - */ |
|
| 230 | + * Tests a string as to whether it's valid UTF-8 and supported by the |
|
| 231 | + * Unicode standard |
|
| 232 | + * Note: this function has been modified to simple return true or false |
|
| 233 | + * @author <[email protected]> |
|
| 234 | + * @param string UTF-8 encoded string |
|
| 235 | + * @return boolean true if valid |
|
| 236 | + * @see http://hsivonen.iki.fi/php-utf8/ |
|
| 237 | + */ |
|
| 238 | 238 | public static function validUtf8($str) |
| 239 | 239 | { |
| 240 | 240 | $mState = 0; // cached expected number of octets after the current octet |
| 241 | - // until the beginning of the next UTF8 character sequence |
|
| 241 | + // until the beginning of the next UTF8 character sequence |
|
| 242 | 242 | $mUcs4 = 0; // cached Unicode character |
| 243 | 243 | $mBytes = 1; // cached expected number of octets in the current sequence |
| 244 | 244 | |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | $tmp = ($tmp & 0x0000003F) << $shift; |
| 305 | 305 | $mUcs4 |= $tmp; |
| 306 | 306 | /** |
| 307 | - * End of the multi-octet sequence. mUcs4 now contains the final |
|
| 308 | - * Unicode codepoint to be output |
|
| 309 | - */ |
|
| 307 | + * End of the multi-octet sequence. mUcs4 now contains the final |
|
| 308 | + * Unicode codepoint to be output |
|
| 309 | + */ |
|
| 310 | 310 | if (0 == --$mState) { |
| 311 | 311 | /* |
| 312 | 312 | * Check for illegal sequences and codepoints. |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | } |
| 331 | 331 | } else { |
| 332 | 332 | /** |
| 333 | - *((0xC0 & (*in) != 0x80) && (mState != 0)) |
|
| 334 | - * Incomplete multi-octet sequence. |
|
| 335 | - */ |
|
| 333 | + *((0xC0 & (*in) != 0x80) && (mState != 0)) |
|
| 334 | + * Incomplete multi-octet sequence. |
|
| 335 | + */ |
|
| 336 | 336 | return false; |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -360,9 +360,9 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | // More stripping. Replace spaces with dashes |
| 362 | 362 | $text = strtolower(preg_replace('/[^A-Z^a-z^0-9^\/]+/', $separator, |
| 363 | - preg_replace('/([a-z\d])([A-Z])/', '\1_\2', |
|
| 364 | - preg_replace('/([A-Z]+)([A-Z][a-z])/', '\1_\2', |
|
| 365 | - preg_replace('/::/', '/', $text))))); |
|
| 363 | + preg_replace('/([a-z\d])([A-Z])/', '\1_\2', |
|
| 364 | + preg_replace('/([A-Z]+)([A-Z][a-z])/', '\1_\2', |
|
| 365 | + preg_replace('/::/', '/', $text))))); |
|
| 366 | 366 | |
| 367 | 367 | return trim($text, $separator); |
| 368 | 368 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: Rafidion Michael |
|
| 5 | - * Date: 30/11/2014 |
|
| 6 | - * Time: 18:21 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: Rafidion Michael |
|
| 5 | + * Date: 30/11/2014 |
|
| 6 | + * Time: 18:21 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\Event; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: tetsu0o |
|
| 5 | - * Date: 29/12/14 |
|
| 6 | - * Time: 02:03 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: tetsu0o |
|
| 5 | + * Date: 29/12/14 |
|
| 6 | + * Time: 02:03 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\Helper; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: tetsu0o |
|
| 5 | - * Date: 30/12/14 |
|
| 6 | - * Time: 02:47 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: tetsu0o |
|
| 5 | + * Date: 30/12/14 |
|
| 6 | + * Time: 02:47 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\Twig\Extension; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: Rafidion Michael |
|
| 5 | - * Date: 02/12/2014 |
|
| 6 | - * Time: 01:56 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: Rafidion Michael |
|
| 5 | + * Date: 02/12/2014 |
|
| 6 | + * Time: 01:56 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\Interfaces; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: Rafidion Michael |
|
| 5 | - * Date: 30/11/2014 |
|
| 6 | - * Time: 18:22 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: Rafidion Michael |
|
| 5 | + * Date: 30/11/2014 |
|
| 6 | + * Time: 18:22 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\EventListener; |
| 10 | 10 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: tetsu0o |
|
| 5 | - * Date: 28/12/14 |
|
| 6 | - * Time: 12:45 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: tetsu0o |
|
| 5 | + * Date: 28/12/14 |
|
| 6 | + * Time: 12:45 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace Mykees\MediaBundle\Util; |
| 10 | 10 | |