-
Posts
1,649 -
Joined
-
Last visited
Community Answers
-
jurchiks's post in Runat ar WSDL servisu caur PHP SOAP client was marked as the answer
Ja tu zini pareizo SOAP request struktūru, tad uzrakstīt atbilstošu PHP SoapClient requestu nevajadzētu būt problēmām.
Iedod kaut vienu nestrādājoša pieprasījuma request struktūru.
Principā request body tev jau vajadzētu saprast, kā veidot, vnk $soap->SomeFunction(['foo' => 'bar']), bet request headerus tev @ SO tas čalis aprakstīja:
$headerValues = [ 'UserId' => $someUserId, 'ClientId' => $someClientId, 'SessionId' => $someSessionId ]; $ns = 'http://namespace.example.com/'; // šo ņem no <UserSessionCredentials xmlns="http://www.NSadrese.net/"> $header = new SOAPHeader($ns, 'UserSessionCredentials', $headerValues); $soap->__setSoapHeaders($header); Teorētiski ar to vajadzētu pietikt, tālāk izsauc `$soap->GetSystemSettings()` un vajadzētu aiziet.
P.S. Viņš tāpat paņēma copy-paste no šejienes: http://php.net/manual/en/soapclient.setsoapheaders.php#93460
-
jurchiks's post in php array sakaārtot augošā secībā pēc laika was marked as the answer
$opinions = array_merge($comments, $replays);
usort($opinions, function ($a, $b)
{
return $a['time'] <=> $b['time']; // PHP 7 spaceship operator
});
-
jurchiks's post in Prototype inheritance was marked as the answer
var A = function (paramsA) { this.paramsA = paramsA; this.init(); }; A.prototype = { paramsA: undefined, init: function () { console.log(this.paramsA); } }; var B = function (paramsB, paramsA) { A.call(this, paramsA); this.paramsB = paramsB; }; B.prototype = Object.create(A.prototype, { paramsB: { writable: true, configurable: true, enumerable: true, value: undefined }, click: { // not writable/configurable/enumerable value: function () { console.log(this.paramsB); } } }); B.prototype.constructor = B; var C = function (paramsC, paramsB, paramsA) { B.call(this, paramsB, paramsA); this.paramsC = paramsC; }; C.prototype = Object.create(B.prototype, { paramsC: { writable: true, configurable: true, enumerable: true, value: undefined }, render: { // not writable/configurable/enumerable value: function () { console.log(this.paramsC); } } }); C.prototype.constructor = C; var obj = new C(3, 2, 1); //console.log => 1 obj.click(); //console.log => 2 obj.render(); //console.log => 3 Sources:https://developer.mozilla.org/en/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty- writable/configurable/enumerable explanations
-
jurchiks's post in Kā uzlikt lai nelogojas Notices? was marked as the answer
Ne jau htaccess, vhost configs. htaccess var būt vairāki faili, neies tak visos likt error_reporting. Diemžēl ar PHP kodu ir tāpat - var būt vairāki entry pointi, īpaši sūdīgos saitos tādu ir tik, cik lapu.
-
jurchiks's post in masīvs was marked as the answer
$array = array(); $i = 5; while ($i > 0) { $array[] = $i--; } print_r($array);Bet ja nu šausmīgi vajag rekursīvu funkciju:
$array = array(); function buildArray($i, &$array) { if ($i < 1) { return; } $array[] = $i--; buildArray($i, $array); }; buildArray(5, $array); print_r($array);Šis ir tail-recursive, kam tehniski vajadzētu būt labākam, tiesa, es nezinu, vai PHP to optimizē. -
jurchiks's post in Ci parametru padošana no kontroliera modelim was marked as the answer
Vispār tev to `$upload_config` vajadzētu definēt iekš `if($this->input->post('upload'))`, jo tikai tur tu to izmanto.
`$path` definē pirms `if ($id)` kā tukšu stringu, iekš tā IFa uzseto tam vērtību, un visam vajadzētu būt OK.
-
jurchiks's post in ajax un mod_rewrite was marked as the answer
http://127.0.0.1/list/users
+
include/delete.php
=
http://127.0.0.1/list/include/delete.php
-
jurchiks's post in PHP skripta izpilde Win konsolē - lamājas par UTF-8 was marked as the answer
Ok, padebugoju skriptu tā nopietnāk, izskatās, ka preg_replace kaut ko ne tā izdara:
http://pastebin.com/67Hzehfb
Šis kods kaut ko izdara ar burtu "Š" un pirmo burtu no vārda "Робот"...
Pieliekot u modifikatoru visiem patterniem, problēmas vairs nav, vienīgi, cik atceros, man bija iemesls noņemt to, jo kaut kas strādāja nepareizi... Velns viņu zin, kas.
Cerams, ka nekas nenobruks.
-
jurchiks's post in display watermarked image was marked as the answer
Ja tas nav tavā kodā, tad, iespējams, kaut kur freimworkā ir closing PHP tagi...
-
jurchiks's post in Linux filename no mapes was marked as the answer
sāc rakstīt faila nosaukumu un uzspied Tab...
Bet ja negribi tā, tad vispār normālos termināļos var iekrāsot faila nosaukumu un vai nu tas automātiski tiek ievietots clipboardā (paste ar labo peles pogu tur, kur atrodas kursors), vai kaut kāda pogu kombinācija ļauj nokopēt un, attiecīgi, arī peistot.
P.S. Šim nav pilnīgi nekāda sakara ar PHP.