Projects STRLCPY hiphp Commits b2bd2283
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    CHANGELOG
    skipped 9 lines
    10 10   - Fixed websites scanner on hiphp-cli.
    11 11   - Changed license from "Apache Software License" to "MIT License."
    12 12   - Fix "--cd" command on "hiphp-cli".
     13 + - Add "--mv" as a new command on "hiphp-cli".
    13 14   - Addressed bug fixes and implemented performance improvements for a more reliable experience.
    14 15  
    15 16  ## 0.3.1 [06-03-2023]
    skipped 215 lines
  • ■ ■ ■ ■
    Dockerfile
    skipped 34 lines
    35 35  # docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t ghcr.io/yasserbdj96/hiphp:latest
    36 36   
    37 37  #START{
    38  -FROM python:3.11.2
     38 +FROM python:3.11.3
    39 39   
    40 40  # start install google-chrome:
    41 41  # Download the Chrome Driver
    skipped 24 lines
  • ■ ■ ■ ■ ■ ■
    hiphp/__init__.py
    skipped 200 lines
    201 201   #about
    202 202   elif command[0:7].lower()=="--about" or command[0:5].lower()=="about":
    203 203   print(about())
     204 + #cp
     205 + elif command[0:4].lower()=="--mv" or command[0:2].lower()=="mv":
     206 + ppth=command.split(" ")
     207 + try:
     208 + command=simulate_mv(ppth[1],ppth[2])
     209 + print(hiphp.do(self,self.key,self.url,self.headers,True,command))
     210 + except:
     211 + help(__version__,"--mv")
    204 212   #download
    205 213   elif command[0:6].lower()=="--down" or command[0:4].lower()=="down" or command[0:8].lower()=="download":
    206 214   down=command.split(" ")
    skipped 284 lines
    491 499  
    492 500   #upload:
    493 501   def upload(self,path_to_upluad,to=""):
     502 + self.DS=hiphp.do(self,self.key,self.url,self.headers,True,DIRECTORY_SEPARATOR())
    494 503   try:
    495 504   with open(path_to_upluad,"rb") as base64_file:
    496 505   encoded_string=tobase64(base64_file.read().decode("utf-8"))
    skipped 19 lines
    516 525  
    517 526   #download:
    518 527   def download(self,path_x,outpath=""):
     528 + def get_download_folder():
     529 + if os.name == 'nt': # Windows
     530 + download_folder = os.path.expanduser('~/Downloads')
     531 + elif os.name == 'posix': # Linux, macOS, and other UNIX-based systems
     532 + download_folder = os.path.expanduser('~/Downloads')
     533 + else:
     534 + # Unsupported operating system
     535 + download_folder = None
     536 +
     537 + return download_folder
     538 + download_folder = get_download_folder()
     539 + if download_folder:
     540 + outpath=download_folder
     541 + else:
     542 + outpath=os.path.abspath(os.getcwd())
     543 +
     544 +
    519 545   new_command=file_to_b64(path_x)
    520 546   path_x=os.path.basename(path_x)
    521  - if outpath=="":
    522  - outpath=os.path.abspath(os.getcwd())
     547 + #if outpath=="":
     548 + # outpath=os.path.abspath(os.getcwd())
    523 549  
    524 550   if outpath[-1]!=self.sep:
    525 551   outpath+=self.sep
    skipped 29 lines
  • ■ ■ ■ ■ ■
    hiphp/hiphphelp.py
    skipped 119 lines
    120 120   --rm -f [FILE_PATH] # Delete a file.
    121 121   --rm -d [DIR_PATH] # Delete a folder.
    122 122  """
     123 + 
     124 +#
     125 + mv_c="""
     126 + --mv, mv # Move files and folders.
     127 + Usage: --mv [SOURCE] [DESTINATION]
     128 +"""
     129 + 
    123 130   #
    124 131   ABOUT="""
    125 132  About:
    skipped 4 lines
    130 137   --version, version # Get the current version number."""
    131 138   
    132 139   if opt=="":
    133  - return header+OPTIONS+ACTIONS+ls_c+spsbar+cat_c+spsbar+set_c+spsbar+cd_c+spsbar+rf_c+spsbar+up_c+spsbar+down_c+spsbar+zip_c+spsbar+edt_c+spsbar+rm_c+spsbar+ABOUT
     140 + return header+OPTIONS+ACTIONS+ls_c+spsbar+cat_c+spsbar+set_c+spsbar+cd_c+spsbar+rf_c+spsbar+up_c+spsbar+down_c+spsbar+zip_c+spsbar+edt_c+spsbar+rm_c+spsbar+mv_c+spsbar+ABOUT
    134 141   else:
    135 142   opt=opt.replace("--","")
    136 143   opt=opt+"_c"
    skipped 3 lines
  • ■ ■ ■ ■ ■ ■
    hiphp/hiphpphpfunctions.py
    skipped 143 lines
    144 144  def file_get_contents(dirx):
    145 145   return f"""echo file_get_contents('{dirx}');"""
    146 146   
     147 +def simulate_mv(path, newpath):
     148 + php_code = f"""
     149 + // Check if the source file or directory exists
     150 + if (!file_exists('{path}')) {{
     151 + echo "[✗] Source doesn't exist.";
     152 + return;
     153 + }}
     154 + 
     155 + // Check if the destination exists
     156 + if (file_exists('{newpath}')) {{
     157 + echo "[!] Destination already exists. Please choose a different destination.";
     158 + return;
     159 + }}
     160 + 
     161 + // Check if the source is a file
     162 + if (is_file('{path}')) {{
     163 + // Move the file to the destination
     164 + if (rename('{path}', '{newpath}')) {{
     165 + echo "[✓] File moved successfully.";
     166 + }} else {{
     167 + echo "[✗] Error moving the file.";
     168 + }}
     169 + }} elseif (is_dir('{path}')) {{
     170 + // Move the directory to the destination
     171 + if (mkdir('{newpath}') && rename('{path}', '{newpath}/' . basename('{path}'))) {{
     172 + echo "[✓] Directory moved successfully.";
     173 + }} else {{
     174 + echo "[✗] Error moving the directory.";
     175 + }}
     176 + }} else {{
     177 + echo "[✗] Unsupported source type.";
     178 + }}
     179 + """
     180 + 
     181 + return php_code
     182 + 
    147 183  #
    148 184  def zip_path(path="./"):
    149 185   php_zip_code="""// Get real path for our folder
    skipped 162 lines
  • ■ ■ ■ ■ ■ ■
    requirements.txt
    skipped 6 lines
    7 7  twine
    8 8  #for ipynb
    9 9  pyngrok
    10  -#for hiphp-desktop
    11  -eel
    12 10  #for hiphp-tk
    13 11  tk
    14 12  chardet
     13 +#for hiphp-desktop
     14 +eel
  • screenshot/HIPHP_HOLE_CODE.png
  • screenshot/screenshot.png
  • screenshot/screenshot0.png
  • screenshot/screenshot1.png
  • screenshot/screenshot14.png
  • screenshot/screenshot2.png
  • screenshot/screenshot3.png
Please wait...
Page is in error, reload to recover