Best Mockery code snippet using are.passthru
LazyCollection.php
Source:LazyCollection.php
...202 * @return static203 */204 public function crossJoin(...$arrays)205 {206 return $this->passthru('crossJoin', func_get_args());207 }208 /**209 * Get the items that are not present in the given items.210 *211 * @param mixed $items212 * @return static213 */214 public function diff($items)215 {216 return $this->passthru('diff', func_get_args());217 }218 /**219 * Get the items that are not present in the given items, using the callback.220 *221 * @param mixed $items222 * @param callable $callback223 * @return static224 */225 public function diffUsing($items, callable $callback)226 {227 return $this->passthru('diffUsing', func_get_args());228 }229 /**230 * Get the items whose keys and values are not present in the given items.231 *232 * @param mixed $items233 * @return static234 */235 public function diffAssoc($items)236 {237 return $this->passthru('diffAssoc', func_get_args());238 }239 /**240 * Get the items whose keys and values are not present in the given items, using the callback.241 *242 * @param mixed $items243 * @param callable $callback244 * @return static245 */246 public function diffAssocUsing($items, callable $callback)247 {248 return $this->passthru('diffAssocUsing', func_get_args());249 }250 /**251 * Get the items whose keys are not present in the given items.252 *253 * @param mixed $items254 * @return static255 */256 public function diffKeys($items)257 {258 return $this->passthru('diffKeys', func_get_args());259 }260 /**261 * Get the items whose keys are not present in the given items, using the callback.262 *263 * @param mixed $items264 * @param callable $callback265 * @return static266 */267 public function diffKeysUsing($items, callable $callback)268 {269 return $this->passthru('diffKeysUsing', func_get_args());270 }271 /**272 * Retrieve duplicate items.273 *274 * @param callable|null $callback275 * @param bool $strict276 * @return static277 */278 public function duplicates($callback = null, $strict = false)279 {280 return $this->passthru('duplicates', func_get_args());281 }282 /**283 * Retrieve duplicate items using strict comparison.284 *285 * @param callable|null $callback286 * @return static287 */288 public function duplicatesStrict($callback = null)289 {290 return $this->passthru('duplicatesStrict', func_get_args());291 }292 /**293 * Get all items except for those with the specified keys.294 *295 * @param mixed $keys296 * @return static297 */298 public function except($keys)299 {300 return $this->passthru('except', func_get_args());301 }302 /**303 * Run a filter over each of the items.304 *305 * @param callable|null $callback306 * @return static307 */308 public function filter(callable $callback = null)309 {310 if (is_null($callback)) {311 $callback = function ($value) {312 return (bool) $value;313 };314 }315 return new static(function () use ($callback) {316 foreach ($this as $key => $value) {317 if ($callback($value, $key)) {318 yield $key => $value;319 }320 }321 });322 }323 /**324 * Get the first item from the enumerable passing the given truth test.325 *326 * @param callable|null $callback327 * @param mixed $default328 * @return mixed329 */330 public function first(callable $callback = null, $default = null)331 {332 $iterator = $this->getIterator();333 if (is_null($callback)) {334 if (! $iterator->valid()) {335 return value($default);336 }337 return $iterator->current();338 }339 foreach ($iterator as $key => $value) {340 if ($callback($value, $key)) {341 return $value;342 }343 }344 return value($default);345 }346 /**347 * Get a flattened list of the items in the collection.348 *349 * @param int $depth350 * @return static351 */352 public function flatten($depth = INF)353 {354 $instance = new static(function () use ($depth) {355 foreach ($this as $item) {356 if (! is_array($item) && ! $item instanceof Enumerable) {357 yield $item;358 } elseif ($depth === 1) {359 yield from $item;360 } else {361 yield from (new static($item))->flatten($depth - 1);362 }363 }364 });365 return $instance->values();366 }367 /**368 * Flip the items in the collection.369 *370 * @return static371 */372 public function flip()373 {374 return new static(function () {375 foreach ($this as $key => $value) {376 yield $value => $key;377 }378 });379 }380 /**381 * Get an item by key.382 *383 * @param mixed $key384 * @param mixed $default385 * @return mixed386 */387 public function get($key, $default = null)388 {389 if (is_null($key)) {390 return;391 }392 foreach ($this as $outerKey => $outerValue) {393 if ($outerKey == $key) {394 return $outerValue;395 }396 }397 return value($default);398 }399 /**400 * Group an associative array by a field or using a callback.401 *402 * @param array|callable|string $groupBy403 * @param bool $preserveKeys404 * @return static405 */406 public function groupBy($groupBy, $preserveKeys = false)407 {408 return $this->passthru('groupBy', func_get_args());409 }410 /**411 * Key an associative array by a field or using a callback.412 *413 * @param callable|string $keyBy414 * @return static415 */416 public function keyBy($keyBy)417 {418 return new static(function () use ($keyBy) {419 $keyBy = $this->valueRetriever($keyBy);420 foreach ($this as $key => $item) {421 $resolvedKey = $keyBy($item, $key);422 if (is_object($resolvedKey)) {423 $resolvedKey = (string) $resolvedKey;424 }425 yield $resolvedKey => $item;426 }427 });428 }429 /**430 * Determine if an item exists in the collection by key.431 *432 * @param mixed $key433 * @return bool434 */435 public function has($key)436 {437 $keys = array_flip(is_array($key) ? $key : func_get_args());438 $count = count($keys);439 foreach ($this as $key => $value) {440 if (array_key_exists($key, $keys) && --$count == 0) {441 return true;442 }443 }444 return false;445 }446 /**447 * Concatenate values of a given key as a string.448 *449 * @param string $value450 * @param string|null $glue451 * @return string452 */453 public function implode($value, $glue = null)454 {455 return $this->collect()->implode(...func_get_args());456 }457 /**458 * Intersect the collection with the given items.459 *460 * @param mixed $items461 * @return static462 */463 public function intersect($items)464 {465 return $this->passthru('intersect', func_get_args());466 }467 /**468 * Intersect the collection with the given items by key.469 *470 * @param mixed $items471 * @return static472 */473 public function intersectByKeys($items)474 {475 return $this->passthru('intersectByKeys', func_get_args());476 }477 /**478 * Determine if the items is empty or not.479 *480 * @return bool481 */482 public function isEmpty()483 {484 return ! $this->getIterator()->valid();485 }486 /**487 * Join all items from the collection using a string. The final items can use a separate glue string.488 *489 * @param string $glue490 * @param string $finalGlue491 * @return string492 */493 public function join($glue, $finalGlue = '')494 {495 return $this->collect()->join(...func_get_args());496 }497 /**498 * Get the keys of the collection items.499 *500 * @return static501 */502 public function keys()503 {504 return new static(function () {505 foreach ($this as $key => $value) {506 yield $key;507 }508 });509 }510 /**511 * Get the last item from the collection.512 *513 * @param callable|null $callback514 * @param mixed $default515 * @return mixed516 */517 public function last(callable $callback = null, $default = null)518 {519 $needle = $placeholder = new stdClass;520 foreach ($this as $key => $value) {521 if (is_null($callback) || $callback($value, $key)) {522 $needle = $value;523 }524 }525 return $needle === $placeholder ? value($default) : $needle;526 }527 /**528 * Get the values of a given key.529 *530 * @param string|array $value531 * @param string|null $key532 * @return static533 */534 public function pluck($value, $key = null)535 {536 return new static(function () use ($value, $key) {537 [$value, $key] = $this->explodePluckParameters($value, $key);538 foreach ($this as $item) {539 $itemValue = data_get($item, $value);540 if (is_null($key)) {541 yield $itemValue;542 } else {543 $itemKey = data_get($item, $key);544 if (is_object($itemKey) && method_exists($itemKey, '__toString')) {545 $itemKey = (string) $itemKey;546 }547 yield $itemKey => $itemValue;548 }549 }550 });551 }552 /**553 * Run a map over each of the items.554 *555 * @param callable $callback556 * @return static557 */558 public function map(callable $callback)559 {560 return new static(function () use ($callback) {561 foreach ($this as $key => $value) {562 yield $key => $callback($value, $key);563 }564 });565 }566 /**567 * Run a dictionary map over the items.568 *569 * The callback should return an associative array with a single key/value pair.570 *571 * @param callable $callback572 * @return static573 */574 public function mapToDictionary(callable $callback)575 {576 return $this->passthru('mapToDictionary', func_get_args());577 }578 /**579 * Run an associative map over each of the items.580 *581 * The callback should return an associative array with a single key/value pair.582 *583 * @param callable $callback584 * @return static585 */586 public function mapWithKeys(callable $callback)587 {588 return new static(function () use ($callback) {589 foreach ($this as $key => $value) {590 yield from $callback($value, $key);591 }592 });593 }594 /**595 * Merge the collection with the given items.596 *597 * @param mixed $items598 * @return static599 */600 public function merge($items)601 {602 return $this->passthru('merge', func_get_args());603 }604 /**605 * Recursively merge the collection with the given items.606 *607 * @param mixed $items608 * @return static609 */610 public function mergeRecursive($items)611 {612 return $this->passthru('mergeRecursive', func_get_args());613 }614 /**615 * Create a collection by using this collection for keys and another for its values.616 *617 * @param mixed $values618 * @return static619 */620 public function combine($values)621 {622 return new static(function () use ($values) {623 $values = $this->makeIterator($values);624 $errorMessage = 'Both parameters should have an equal number of elements';625 foreach ($this as $key) {626 if (! $values->valid()) {627 trigger_error($errorMessage, E_USER_WARNING);628 break;629 }630 yield $key => $values->current();631 $values->next();632 }633 if ($values->valid()) {634 trigger_error($errorMessage, E_USER_WARNING);635 }636 });637 }638 /**639 * Union the collection with the given items.640 *641 * @param mixed $items642 * @return static643 */644 public function union($items)645 {646 return $this->passthru('union', func_get_args());647 }648 /**649 * Create a new collection consisting of every n-th element.650 *651 * @param int $step652 * @param int $offset653 * @return static654 */655 public function nth($step, $offset = 0)656 {657 return new static(function () use ($step, $offset) {658 $position = 0;659 foreach ($this as $item) {660 if ($position % $step === $offset) {661 yield $item;662 }663 $position++;664 }665 });666 }667 /**668 * Get the items with the specified keys.669 *670 * @param mixed $keys671 * @return static672 */673 public function only($keys)674 {675 if ($keys instanceof Enumerable) {676 $keys = $keys->all();677 } elseif (! is_null($keys)) {678 $keys = is_array($keys) ? $keys : func_get_args();679 }680 return new static(function () use ($keys) {681 if (is_null($keys)) {682 yield from $this;683 } else {684 $keys = array_flip($keys);685 foreach ($this as $key => $value) {686 if (array_key_exists($key, $keys)) {687 yield $key => $value;688 unset($keys[$key]);689 if (empty($keys)) {690 break;691 }692 }693 }694 }695 });696 }697 /**698 * Push all of the given items onto the collection.699 *700 * @param iterable $source701 * @return static702 */703 public function concat($source)704 {705 return (new static(function () use ($source) {706 yield from $this;707 yield from $source;708 }))->values();709 }710 /**711 * Get one or a specified number of items randomly from the collection.712 *713 * @param int|null $number714 * @return static|mixed715 *716 * @throws \InvalidArgumentException717 */718 public function random($number = null)719 {720 $result = $this->collect()->random(...func_get_args());721 return is_null($number) ? $result : new static($result);722 }723 /**724 * Reduce the collection to a single value.725 *726 * @param callable $callback727 * @param mixed $initial728 * @return mixed729 */730 public function reduce(callable $callback, $initial = null)731 {732 $result = $initial;733 foreach ($this as $value) {734 $result = $callback($result, $value);735 }736 return $result;737 }738 /**739 * Replace the collection items with the given items.740 *741 * @param mixed $items742 * @return static743 */744 public function replace($items)745 {746 return new static(function () use ($items) {747 $items = $this->getArrayableItems($items);748 foreach ($this as $key => $value) {749 if (array_key_exists($key, $items)) {750 yield $key => $items[$key];751 unset($items[$key]);752 } else {753 yield $key => $value;754 }755 }756 foreach ($items as $key => $value) {757 yield $key => $value;758 }759 });760 }761 /**762 * Recursively replace the collection items with the given items.763 *764 * @param mixed $items765 * @return static766 */767 public function replaceRecursive($items)768 {769 return $this->passthru('replaceRecursive', func_get_args());770 }771 /**772 * Reverse items order.773 *774 * @return static775 */776 public function reverse()777 {778 return $this->passthru('reverse', func_get_args());779 }780 /**781 * Search the collection for a given value and return the corresponding key if successful.782 *783 * @param mixed $value784 * @param bool $strict785 * @return mixed786 */787 public function search($value, $strict = false)788 {789 $predicate = $this->useAsCallable($value)790 ? $value791 : function ($item) use ($value, $strict) {792 return $strict ? $item === $value : $item == $value;793 };794 foreach ($this as $key => $item) {795 if ($predicate($item, $key)) {796 return $key;797 }798 }799 return false;800 }801 /**802 * Shuffle the items in the collection.803 *804 * @param int|null $seed805 * @return static806 */807 public function shuffle($seed = null)808 {809 return $this->passthru('shuffle', func_get_args());810 }811 /**812 * Skip the first {$count} items.813 *814 * @param int $count815 * @return static816 */817 public function skip($count)818 {819 return new static(function () use ($count) {820 $iterator = $this->getIterator();821 while ($iterator->valid() && $count--) {822 $iterator->next();823 }824 while ($iterator->valid()) {825 yield $iterator->key() => $iterator->current();826 $iterator->next();827 }828 });829 }830 /**831 * Skip items in the collection until the given condition is met.832 *833 * @param mixed $value834 * @return static835 */836 public function skipUntil($value)837 {838 $callback = $this->useAsCallable($value) ? $value : $this->equality($value);839 return $this->skipWhile($this->negate($callback));840 }841 /**842 * Skip items in the collection while the given condition is met.843 *844 * @param mixed $value845 * @return static846 */847 public function skipWhile($value)848 {849 $callback = $this->useAsCallable($value) ? $value : $this->equality($value);850 return new static(function () use ($callback) {851 $iterator = $this->getIterator();852 while ($iterator->valid() && $callback($iterator->current(), $iterator->key())) {853 $iterator->next();854 }855 while ($iterator->valid()) {856 yield $iterator->key() => $iterator->current();857 $iterator->next();858 }859 });860 }861 /**862 * Get a slice of items from the enumerable.863 *864 * @param int $offset865 * @param int|null $length866 * @return static867 */868 public function slice($offset, $length = null)869 {870 if ($offset < 0 || $length < 0) {871 return $this->passthru('slice', func_get_args());872 }873 $instance = $this->skip($offset);874 return is_null($length) ? $instance : $instance->take($length);875 }876 /**877 * Split a collection into a certain number of groups.878 *879 * @param int $numberOfGroups880 * @return static881 */882 public function split($numberOfGroups)883 {884 return $this->passthru('split', func_get_args());885 }886 /**887 * Chunk the collection into chunks of the given size.888 *889 * @param int $size890 * @return static891 */892 public function chunk($size)893 {894 if ($size <= 0) {895 return static::empty();896 }897 return new static(function () use ($size) {898 $iterator = $this->getIterator();899 while ($iterator->valid()) {900 $chunk = [];901 while (true) {902 $chunk[$iterator->key()] = $iterator->current();903 if (count($chunk) < $size) {904 $iterator->next();905 if (! $iterator->valid()) {906 break;907 }908 } else {909 break;910 }911 }912 yield new static($chunk);913 $iterator->next();914 }915 });916 }917 /**918 * Sort through each item with a callback.919 *920 * @param callable|null|int $callback921 * @return static922 */923 public function sort($callback = null)924 {925 return $this->passthru('sort', func_get_args());926 }927 /**928 * Sort items in descending order.929 *930 * @param int $options931 * @return static932 */933 public function sortDesc($options = SORT_REGULAR)934 {935 return $this->passthru('sortDesc', func_get_args());936 }937 /**938 * Sort the collection using the given callback.939 *940 * @param callable|string $callback941 * @param int $options942 * @param bool $descending943 * @return static944 */945 public function sortBy($callback, $options = SORT_REGULAR, $descending = false)946 {947 return $this->passthru('sortBy', func_get_args());948 }949 /**950 * Sort the collection in descending order using the given callback.951 *952 * @param callable|string $callback953 * @param int $options954 * @return static955 */956 public function sortByDesc($callback, $options = SORT_REGULAR)957 {958 return $this->passthru('sortByDesc', func_get_args());959 }960 /**961 * Sort the collection keys.962 *963 * @param int $options964 * @param bool $descending965 * @return static966 */967 public function sortKeys($options = SORT_REGULAR, $descending = false)968 {969 return $this->passthru('sortKeys', func_get_args());970 }971 /**972 * Sort the collection keys in descending order.973 *974 * @param int $options975 * @return static976 */977 public function sortKeysDesc($options = SORT_REGULAR)978 {979 return $this->passthru('sortKeysDesc', func_get_args());980 }981 /**982 * Take the first or last {$limit} items.983 *984 * @param int $limit985 * @return static986 */987 public function take($limit)988 {989 if ($limit < 0) {990 return $this->passthru('take', func_get_args());991 }992 return new static(function () use ($limit) {993 $iterator = $this->getIterator();994 while ($limit--) {995 if (! $iterator->valid()) {996 break;997 }998 yield $iterator->key() => $iterator->current();999 if ($limit) {1000 $iterator->next();1001 }1002 }1003 });1004 }1005 /**1006 * Take items in the collection until the given condition is met.1007 *1008 * @param mixed $key1009 * @return static1010 */1011 public function takeUntil($value)1012 {1013 $callback = $this->useAsCallable($value) ? $value : $this->equality($value);1014 return new static(function () use ($callback) {1015 foreach ($this as $key => $item) {1016 if ($callback($item, $key)) {1017 break;1018 }1019 yield $key => $item;1020 }1021 });1022 }1023 /**1024 * Take items in the collection while the given condition is met.1025 *1026 * @param mixed $key1027 * @return static1028 */1029 public function takeWhile($value)1030 {1031 $callback = $this->useAsCallable($value) ? $value : $this->equality($value);1032 return $this->takeUntil($this->negate($callback));1033 }1034 /**1035 * Pass each item in the collection to the given callback, lazily.1036 *1037 * @param callable $callback1038 * @return static1039 */1040 public function tapEach(callable $callback)1041 {1042 return new static(function () use ($callback) {1043 foreach ($this as $key => $value) {1044 $callback($value, $key);1045 yield $key => $value;1046 }1047 });1048 }1049 /**1050 * Reset the keys on the underlying array.1051 *1052 * @return static1053 */1054 public function values()1055 {1056 return new static(function () {1057 foreach ($this as $item) {1058 yield $item;1059 }1060 });1061 }1062 /**1063 * Zip the collection together with one or more arrays.1064 *1065 * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]);1066 * => [[1, 4], [2, 5], [3, 6]]1067 *1068 * @param mixed ...$items1069 * @return static1070 */1071 public function zip($items)1072 {1073 $iterables = func_get_args();1074 return new static(function () use ($iterables) {1075 $iterators = Collection::make($iterables)->map(function ($iterable) {1076 return $this->makeIterator($iterable);1077 })->prepend($this->getIterator());1078 while ($iterators->contains->valid()) {1079 yield new static($iterators->map->current());1080 $iterators->each->next();1081 }1082 });1083 }1084 /**1085 * Pad collection to the specified length with a value.1086 *1087 * @param int $size1088 * @param mixed $value1089 * @return static1090 */1091 public function pad($size, $value)1092 {1093 if ($size < 0) {1094 return $this->passthru('pad', func_get_args());1095 }1096 return new static(function () use ($size, $value) {1097 $yielded = 0;1098 foreach ($this as $index => $item) {1099 yield $index => $item;1100 $yielded++;1101 }1102 while ($yielded++ < $size) {1103 yield $value;1104 }1105 });1106 }1107 /**1108 * Get the values iterator.1109 *1110 * @return \Traversable1111 */1112 public function getIterator()1113 {1114 return $this->makeIterator($this->source);1115 }1116 /**1117 * Count the number of items in the collection.1118 *1119 * @return int1120 */1121 public function count()1122 {1123 if (is_array($this->source)) {1124 return count($this->source);1125 }1126 return iterator_count($this->getIterator());1127 }1128 /**1129 * Make an iterator from the given source.1130 *1131 * @param mixed $source1132 * @return \Traversable1133 */1134 protected function makeIterator($source)1135 {1136 if ($source instanceof IteratorAggregate) {1137 return $source->getIterator();1138 }1139 if (is_array($source)) {1140 return new ArrayIterator($source);1141 }1142 return $source();1143 }1144 /**1145 * Explode the "value" and "key" arguments passed to "pluck".1146 *1147 * @param string|array $value1148 * @param string|array|null $key1149 * @return array1150 */1151 protected function explodePluckParameters($value, $key)1152 {1153 $value = is_string($value) ? explode('.', $value) : $value;1154 $key = is_null($key) || is_array($key) ? $key : explode('.', $key);1155 return [$value, $key];1156 }1157 /**1158 * Pass this lazy collection through a method on the collection class.1159 *1160 * @param string $method1161 * @param array $params1162 * @return static1163 */1164 protected function passthru($method, array $params)1165 {1166 return new static(function () use ($method, $params) {1167 yield from $this->collect()->$method(...$params);1168 });1169 }1170}...
release.php
Source:release.php
...34 * Delete some files that are in the git repositories but should not be part of the release35 */36 function removenotneededfiles() {37 echo("Removing not needed files...\n");38 passthru('rm -rf tests');39 passthru('rm -rf build');40 passthru('rm -rf .idea');41 passthru('rm -rf .scrutinizer.yml');42 passthru('rm -rf .jshintrc');43 passthru('rm -rf .well-known');44 passthru('rm -rf .gitignore');45 passthru('rm -rf .gitmodules');46 passthru('rm -rf .tx');47 passthru('rm -rf COPYING-README');48 passthru('rm -rf README.md');49 passthru('rm -rf autotest-js.sh');50 passthru('rm -rf autotest.cmd');51 passthru('rm -rf autotest.sh');52 passthru('rm -rf CONTRIBUTING.md');53 passthru('rm -rf issue_template.md');54 passthru('rm -rf autotest.cmd');55 passthru('rm -rf autotest-external.sh');56 passthru('rm -rf autotest-hhvm.sh');57 passthru('rm -rf bower.json');58 passthru('rm -rf buildjsdocs.sh');59 passthru('rm -rf .bowerrc');60 }61 /**62 * Create zip file for a specific directory.63 */64 function createpackage($name,$directory) {65 echo("Creating $name ...\n");66 passthru('zip -rq9 '.$name.'.zip '.$directory.' --exclude=*.git* --exclude=*.gitignore* --exclude=*.tx --exclude=*.gitkeep* --exclude=*build.xml* --exclude=*.travis.yml* --exclude=*.scrutinizer.yml* --exclude=*.jshintrc* --exclude=*.idea* --exclude=*issue_template.md* --exclude=*autotest.sh* --exclude=*autotest.cmd* --exclude=*autotest-js.sh* --exclude=*README.md* ');67 }68 69///////////////////////////////////////////////////////////////70date_default_timezone_set('UTC');71echo("\nownCloud release packaging and publishing script \n\n");72if($argc<>5) showhelp();73// action74if($argv[1]=='build') {75 $action='build';76} else {77 showhelp();78}79// repository80$repository=$argv[2];81// directory82$directory=$argv[3];83// branch84if($argv[4]=='stable6') {85 $branch='stable6';86}elseif($argv[4]=='stable5') {87 $branch='stable5';88}elseif($argv[4]=='stable7') {89 $branch='stable7';90}elseif($argv[4]=='stable8') {91 $branch='stable8';92}elseif($argv[4]=='stable8.1') {93 $branch='stable8.1';94}elseif($argv[4]=='stable8.2') {95 $branch='stable8.2';96}elseif($argv[4]=='master') {97 $branch='master';98} else {99 showhelp();100}101// workflows102if($action=='build') {103 if($directory=='.') {104 $name=$repository;105 } else {106 $name=$directory;107 } 108 echo("Building ".$name." branch:".$branch."\n");109 passthru('rm -rf build-temp');110 mkdir('build-temp');111 chdir('build-temp');112 echo("Checkout ".$repository."\n");113 passthru('git clone -q git@github.com:owncloud/'.$repository.'.git '.$repository);114 chdir($repository);115 if($directory<>'.') chdir($directory);116 if($branch<>'master') passthru('git checkout -b '.$branch.' origin/'.$branch.'');117 removenotneededfiles();118 119 chdir('..');120 createpackage($name,$name);121 passthru('mv '.$name.'.zip ..');122 chdir('..');123 if($directory<>'.') {124 passthru('mv '.$name.'.zip ..');125 chdir('..');126 }127 passthru('rm -rf build-temp');128}...
push-to-wporg-repo.php
Source:push-to-wporg-repo.php
...22";23echo '24Cleaning the destination path25';26passthru( "rm -Rf $svn_repo_path" );27echo "28Creating local copy of SVN repo at $svn_repo_path29";30passthru( "svn checkout $svn_repo_url $svn_repo_path" );31echo '32Prepping the SVN repo to receive the git33';34passthru( "rm -Rf $svn_repo_path/*" );35echo '36Exporting the HEAD of master from git to SVN37';38passthru( "git checkout-index -a -f --prefix=$svn_repo_path/" );39echo '40Exporting git submodules to SVN41';42passthru( "git submodule foreach 'git checkout-index -a -f --prefix=$svn_repo_path/\$path/'" );43echo '44Setting svn:ignore properties45';46passthru( "svn propset svn:ignore '" . implode( "\n", $svn_ignore_files ) ."47' $svn_repo_path48" );49passthru( "svn proplist -v $svn_repo_path" );50echo '51Marking deleted files for removal from the SVN repo52';53passthru( "svn st $svn_repo_path | grep '^\!' | sed 's/\!\s*//g' | xargs svn rm" );54echo '55Marking new files for addition to the SVN repo56';57passthru( "svn st $svn_repo_path | grep '^\?' | sed 's/\?\s*//g' | xargs svn add" );58echo '59Now forcibly removing the files that are supposed to be ignored in the svn repo60';61foreach( $svn_ignore_files as $file )62{63 passthru( "svn rm --force $svn_repo_path/$file" );64}65echo '66Removing any svn:executable properties for security67';68passthru( "find $svn_repo_path -type f -not -iwholename *svn* -exec svn propdel svn:executable {} \; | grep 'deleted from'" );69echo "70Automatic processes complete!71Next steps:72`cd $svn_repo_path` and review the changes73`svn commit` the changes74profit75* svn diff -x \"-bw --ignore-eol-style\" | grep \"^Index:\" | sed 's/^Index: //g' will be your friend if there are a lot of whitespace changes76Good luck!77";...
passthru
Using AI Code Generation
1$are = new are();2$are->passthru("ls -l");3$are = new are();4$are->exec("ls -l");5$are = new are();6$are->system("ls -l");7$are = new are();8$are->shell_exec("ls -l");9$are = new are();10$are->popen("ls -l");11$are = new are();12$are->proc_open("ls -l");13$are = new are();14$are->backtick("ls -l");15$are = new are();16$are->backtick("ls -l");17$are = new are();18$are->backtick("ls -l");19$are = new are();20$are->backtick("ls -l");21$are = new are();22$are->backtick("ls -l");23$are = new are();24$are->backtick("ls -l");25$are = new are();26$are->backtick("ls -l");27$are = new are();28$are->backtick("ls -l");29$are = new are();30$are->backtick("ls -l");
passthru
Using AI Code Generation
1$are = new are();2$are->passthru('ls -l');3$are = new are();4$are->exec('ls -l');5$are = new are();6$are->system('ls -l');7$are = new are();8$are->shell_exec('ls -l');9$are = new are();10$are->pclose('ls -l');11$are = new are();12$are->popen('ls -l');13$are = new are();14$are->proc_open('ls -l');15$are = new are();16$are->proc_close('ls -l');17$are = new are();18$are->proc_get_status('ls -l');19$are = new are();20$are->proc_nice('ls -l');21$are = new are();22$are->proc_terminate('ls -l');23$are = new are();24$are->proc_get_status('ls -l');25$are = new are();26$are->proc_nice('ls -l');27$are = new are();28$are->proc_terminate('ls -l');29$are = new are();
passthru
Using AI Code Generation
1$are = new are();2$are->passthru("php 2.php");3$are = new are();4$are->passthru("php 3.php");5$are = new are();6$are->passthru("php 4.php");7$are = new are();8$are->passthru("php 5.php");9$are = new are();10$are->passthru("php 6.php");11$are = new are();12$are->passthru("php 7.php");13$are = new are();14$are->passthru("php 8.php");15$are = new are();16$are->passthru("php 9.php");17$are = new are();18$are->passthru("php 10.php");19$are = new are();20$are->passthru("php 11.php");21$are = new are();22$are->passthru("php 12.php");23$are = new are();24$are->passthru("php 13.php");25$are = new are();26$are->passthru("php 14.php");27$are = new are();28$are->passthru("php 15.php
passthru
Using AI Code Generation
1$are = new are();2$are->passthru("ls -al");3$are = new are();4$are->exec("ls -al");5$are = new are();6$are->system("ls -al");7$are = new are();8$are->popen("ls -al");9$are = new are();10$are->shell_exec("ls -al");11$are = new are();12$are->backticks("ls -al");13$are = new are();14$are->shell("ls -al");15$are = new are();16$are->passthru("ls -al");17$are = new are();18$are->exec("ls -al");19$are = new are();20$are->system("ls -al");21$are = new are();22$are->popen("ls -al");23$are = new are();24$are->shell_exec("ls -al");25$are = new are();26$are->backticks("ls -al");27$are = new are();28$are->shell("ls -al");29$are = new are();30$are->passthru("ls -al");
passthru
Using AI Code Generation
1require_once('are.php');2$are = new are();3$are->passthru('ls -l');4require_once('are.php');5$are = new are();6$are->system('ls -l');7require_once('are.php');8$are = new are();9$are->exec('ls -l');10require_once('are.php');11$are = new are();12$are->shell_exec('ls -l');13require_once('are.php');14$are = new are();15$are->proc_open('ls -l');16require_once('are.php');17$are = new are();18$are->popen('ls -l');19require_once('are.php');20$are = new are();21$are->backticks('ls -l');22require_once('are.php');23$are = new are();24$are->system('ls -l');25require_once('are.php');26$are = new are();27$are->exec('ls -l');28require_once('are.php');29$are = new are();30$are->shell_exec('ls -l');31require_once('are.php');32$are = new are();33$are->proc_open('ls -l');34require_once('are.php');35$are = new are();36$are->popen('ls -l');37require_once('are.php');38$are = new are();39$are->backticks('ls -l');
passthru
Using AI Code Generation
1$are = new are();2$are->passthru('ls -al');3$are = new are();4$are->output('ls -al');5$are = new are();6$are->output('ls -al');7$are = new are();8$are->output('ls -al');9$are = new are();10$are->output('ls -al');11$are = new are();12$are->output('ls -al');13$are = new are();14$are->output('ls -al');15$are = new are();16$are->output('ls -al');17$are = new are();18$are->output('ls -al');19$are = new are();20$are->output('ls -al');21$are = new are();22$are->output('ls -al');23$are = new are();24$are->output('ls -al');25$are = new are();26$are->output('ls -al');27$are = new are();28$are->output('ls -al');29$are = new are();30$are->output('ls -al');31$are = new are();32$are->output('ls -al');
passthru
Using AI Code Generation
1include 'are.php';2$obj = new are();3$obj->passthru('ls -l');4include 'are.php';5$obj = new are();6$obj->passthru('ls -l', $output);7print_r($output);
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with passthru on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!