Jump to content

Rommeo

Members
  • Content Count

    312
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Rommeo

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. Rommeo

    Declaration Error, help needed

    But it looks like same : Here is Authenticator::authenticate() namespace Cog\Contracts\YouTrack\Rest\Authenticator; use Cog\Contracts\YouTrack\Rest\Client\Client as ClientContract; /** * Interface Authorizer. * * @package Cog\Contracts\YouTrack\Rest\Authenticator */ interface Authenticator { /** * Authenticate API Client. * * @param \Cog\Contracts\YouTrack\Rest\Client\Client $client * @return void * * @throws \Cog\Contracts\YouTrack\Rest\Authenticator\Exceptions\AuthenticationException */ public function authenticate(ClientContract $client): void; /** * Retrieve authentication token. * * @return string */ public function token(): string; }
  2. I'm getting an error like : Fatal error: Declaration of Cog\YouTrack\Rest\Authenticator\CookieAuthenticator::authenticate (Cog\Contracts\YouTrack\Rest\Client\Client $client): Cog\YouTrack\Rest\Authenticator\void must be compatible with Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator::authenticate (Cog\Contracts\YouTrack\Rest\Client\Client $client): Cog\Contracts\YouTrack\Rest\Authenticator\void in /var/www/html/vendor/cybercog/youtrack-rest-php/src/Authenticator/CookieAuthenticator.php on line 24 my index file is : require_once 'vendor/autoload.php'; use Cog\YouTrack\Rest; // use Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator; // Application configuration (replace with your YouTrack server values) $apiBaseUri = 'http://111.111.111.111:8080'; $apiUsername = 'username'; $apiPassword = 'password'; // Instantiate PSR-7 HTTP Client $psrHttpClient = new \GuzzleHttp\Client([ 'base_uri' => $apiBaseUri, 'debug' => true, ]); // Instantiate YouTrack API HTTP Client $httpClient = new Rest\HttpClient\GuzzleHttpClient($psrHttpClient); // Instantiate YouTrack API Cookie Authenticator $authenticator = new Rest\Authenticator\CookieAuthenticator(); CookieAuthenticator.php file is : namespace Cog\YouTrack\Rest\Authenticator; use Cog\Contracts\YouTrack\Rest\Authenticator\Authenticator as AuthenticatorContract; use Cog\Contracts\YouTrack\Rest\Client\Client as ClientContract; /** * Class CookieAuthenticator. * * @package Cog\YouTrack\Rest\Authenticator */ class CookieAuthenticator implements AuthenticatorContract // <--line 24 where the error is { /** * @var string */ private $username = ''; /** * @var string */ private $password = ''; /** * @var string */ private $cookie = ''; /** * Determine is trying to authenticate. * * @var bool */ private $isAuthenticating = false; /** * CookieAuthenticator constructor. * * @param string $username * @param string $password */ public function __construct(string $username, string $password) { $this->username = $username; $this->password = $password; } /** * Authenticate client and returns cookie on success login. * * @param \Cog\Contracts\YouTrack\Rest\Client\Client $client * @return void * * @throws \Cog\Contracts\YouTrack\Rest\Authenticator\Exceptions\AuthenticationException */ public function authenticate(ClientContract $client): void { $client = new ClientContract; if ($this->cookie !== '' || $this->isAuthenticating) { return; } $this->isAuthenticating = true; $response = $client->request('POST', '/user/login', [ 'login' => $this->username, 'password' => $this->password, ]); $this->isAuthenticating = false; if ($response->isStatusCode(200)) { $this->cookie = $response->cookie(); } } /** * Retrieve authentication token. * * @return string */ public function token(): string { return $this->cookie; } } Why I'm getting this error? I think there is something wrong with CookieAuthanticator.php file but unfortunately I could not find it
  3. Rommeo

    MyISAM to InnoDB?

    Hello, In one project I'm working on, all the tables' engine is MyISAM, and due to some reasons a friend of mine told me that InnoDB would be better in the project, so if I click operations in phpmyadmin and change myisam to innodb for all the tables, would it cause any trouble? (Would I have to change the queries etc?)
  4. Rommeo

    For Pros; How to import XML?

    Thank you Barand. I m working on it.
  5. Rommeo

    For Pros; How to import XML?

    Well It's not actually 900, // So the loop is gonna be something like; for( <"900 data") { $query1 = "insert a data of 900" $query2 = "select productid of data where = product_code" || "take the last inserted row". for(<"count of stock lets say 5") $query insert productid,stock; for(<"count of photos lets say 6") $query insert productid,photoname; } Well, I thought about it but I wanna see if there is any better alternatives..
  6. Rommeo

    For Pros; How to import XML?

    Thank you for the suggestion. What I actually wonder is; how to insert that amount of data? Should I put in a loop and insert? That may take time and cause an error 500 maybe?
  7. Hi, I have two xml files, one has 750 products, and the other one has 900 products (including product informations, stock information, sizes and photos) so shortly one product in xml file is like this; product_name: x t-shirt product_code: x-t-shirt-101 (Alphanumerical) Stocks(loop): +Small: 50 +Large:200 Photo1 : http://....../main.jpg Photo2: http://....../2.jpg And my tables are like this: Product (product_id (numerical), product_code (alphanumerical), name) Photos (product_id, id.. ) Stocks (product_id, id..) (So that I need to insert one product in my db, and take the id, and insert the xml-photos-data with the correct product_id to photos table, same goes with the stocks table) So I m thinking about the easiest and most healthy way to import this amount of data, and I need to update it daily or weekly (planning to do it by cron jobs for now). I have found some solutions but since I have not done this before could not decide which is the most secure way. Need to add that I can have other xml files from different companies to import later on, so I think I should code for long term. Thank you in advance for your help.
  8. Hello, I m working on a VPS and will use this server for many subdomains. And I want to use these domains with SSL support (free ones, self or let's encrypt etc) So my question is; Can I use one certificate for many subdomains?(By adding the certificate directories links into apache virtual hosts .conf files) (if yes: is it good or bad?) Or should I create certificate for each of the domains? (So that there will be unique certificate link for each domain in virtual hosts' .conf files) Thank you in advance.
  9. I m trying to use a template, in one of the page there is a modal inserted in the code, so it works correctly if i just unzip the template and click an item ( a modal pop up window appears and all buttons work well. ) But I need to use the db, so that I have tried to fill the modal from an external php file, it also works, I m able to fill the fields in modal, but jquery/bootstrap buttons not working at this time. Here is my code; html: (where I call the model ) <a href="#" data-href="http://www.mywebsite.com/info.php?id=4" class="block2-btn flex-c-m stext-103 cl2 size-102 bg0 bor2 hov-btn1 p-lr-15 trans-04 js-show-modal1"> Check </a> jquery ; $('.js-show-modal1').on('click',function(e){ e.preventDefault(); var dataURL = $(this).attr('data-href'); $('#myproinfo').load(dataURL,function(e){ $('.js-modal1').addClass('show-modal1'); }); }); $('.js-hide-modal1').on('click',function(){ $('.js-modal1').removeClass('show-modal1'); }); modal : <!-- content tables are here --> <!-- modal part here --> <div class="wrap-modal1 js-modal1 p-t-60 p-b-20"> <div class="overlay-modal1 js-hide-modal1"></div> <div class="container"> <div class="bg0 p-t-60 p-b-30 p-lr-15-lg how-pos3-parent"> <button class="how-pos3 hov3 trans-04 js-hide-modal1"> <img src="images/icons/icon-close.png" alt="CLOSE"> </button> <div class="row" id="myproinfo"> <!-- DATA GOES HERE --> </div> </div> </div> </div> <!-- jquery, bootstrap etc includes here --> info.php; $query = "Select * data .. etc."; for($i=0) echo " <tr> <td><img src="'.$photo[$i].'" alt="IMG-PRODUCT"></td> <td>'$name[$i]'</td> <td>'$title[$i]'</td> </tr> How can I solve this? Thank you in advance for your replies.
  10. Thank you so much Barand, I really appreciate it.
  11. The question is still "if i just write "mysqli_real_escape_string" would be enough?..Well this is what I wonder actually.".. Well I m not able to re-code everything, as I said this is just a favor that I m doing for my customer. So now my question is still: if i just write "mysqli_real_escape_string" would it be enough?.. If you think you are wasting time, you don't need to reply Barand, I'm not forcing you, thank you for the suggestions in your first post though.
  12. lol, the question is very simple: "if i just write "mysqli_real_escape_string" would be enough?..Well this is what I wonder actually.". I have no time for chatting -sorry.
  13. Thank you for your replies, I ll definitely search more about using PDO. But for my case now, I have a script that my customer has sent me and that was coded ages ago by anyone else that we can not reach now. And my customer is saying that sometimes the script gives errors, and when I check the code, I could not find any check process before inserting the data into db. I m not gonna change the whole script, as a favor and for to help him I just want to add the functions to secure the script and since I m not a php expert, I just wondered what should I write before inserting the text into db? I don't know if i just write "mysqli_real_escape_string" would be enough?..Well this is what I wonder actually.
  14. What is the best way for form validation before inserting the data into db? ( Let's say the field is textarea which is the "Bio" part of the user & html tags are allowed) According to w3schools, this may be enough; function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } But some say " mysqli_real_escape_string " is needed also, so should i add that one too? function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); $data = mysqli_real_escape_string($dblink,$data); return $data; } So as a newbie, I m wondering the best and most secure way for validation before inserting the data into db. Thanks in advance.
  15. Hi, I have been using Hostgator (shared) for years. Recently, last 4 weeks, almost every week for a day when ever I enter my websites, they give me an error like "Error: No Database Connection", then everytime I contact to Hostgator support and they fix it, but they don't tell me what is really going on with my database system. (They just say my websites are not hacked or something they are doing some update, that is the reason.) So my questions are; 1- What can be the problem that I always have an database connection error and my websites are down for some hours everyweek? (I m not a db expert, so can't figure it out) Is it same with other hostings too? (I have not used any others before) 2- Hostgator users: Do you face this kind of problems too? 3- I have seen the "Web Host List" topic, but i don't know if the list was updated, so I would like to know if you have any hosting suggestions that you don't face this kind of problems. Thank you in advance for your replies.
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.